diff --git a/CHANGELOG.md b/CHANGELOG.md index f4b768e78..8c973999d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## [0.32.1] - 2021-05-15 ### Changed - [Execution] CallErrors no longer emit very long rather pointless (since there is no tooling to help interpret them currently) EVM call traces +- [JS] Return byte arrays as Buffers from decode (only return fixed-width byteNN types as hex strings) ## [0.32.0] - 2021-05-14 diff --git a/NOTES.md b/NOTES.md index d26325279..1596c5f82 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,3 +1,4 @@ ### Changed - [Execution] CallErrors no longer emit very long rather pointless (since there is no tooling to help interpret them currently) EVM call traces +- [JS] Return byte arrays as Buffers from decode (only return fixed-width byteNN types as hex strings) diff --git a/js/src/convert.ts b/js/src/convert.ts index 72ca41f88..ae7d77399 100644 --- a/js/src/convert.ts +++ b/js/src/convert.ts @@ -48,14 +48,18 @@ export function withoutArrayElements(result: Result): Record { function abiToBurrow(arg: unknown, type: string): unknown { if (/address/.test(type)) { return recApply(unprefixedHexString, arg as NestedArray); - } else if (/bytes/.test(type)) { + } else if (/bytes[0-9]+/.test(type)) { + // Handle bytes32 differently - for legacy reasons they are used as identifiers and represented as hex strings return recApply(unprefixedHexString, arg as NestedArray); + } else if (/bytes/.test(type)) { + return recApply(toBuffer, arg as NestedArray); } else if (/int/.test(type)) { return recApply(numberToBurrow, arg as NestedArray); } return arg; } + function burrowToAbi(arg: unknown, type: string): unknown { if (/address/.test(type)) { return recApply(prefixedHexString, arg as NestedArray); diff --git a/project/history.go b/project/history.go index 7dc63ee30..169d84b0e 100644 --- a/project/history.go +++ b/project/history.go @@ -50,6 +50,7 @@ var History relic.ImmutableHistory = relic.NewHistory("Hyperledger Burrow", "htt MustDeclareReleases("0.32.1 - 2021-05-15", `### Changed - [Execution] CallErrors no longer emit very long rather pointless (since there is no tooling to help interpret them currently) EVM call traces +- [JS] Return byte arrays as Buffers from decode (only return fixed-width byteNN types as hex strings) `, "0.32.0 - 2021-05-14", `### Changed