Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Return byte arrays as Buffer's as expected downstream
Browse files Browse the repository at this point in the history
Signed-off-by: Silas Davis <silas@monax.io>
  • Loading branch information
Silas Davis committed May 15, 2021
1 parent 62cf0f3 commit 6676e6e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions NOTES.md
Original file line number Diff line number Diff line change
@@ -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)

6 changes: 5 additions & 1 deletion js/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,18 @@ export function withoutArrayElements(result: Result): Record<string, unknown> {
function abiToBurrow(arg: unknown, type: string): unknown {
if (/address/.test(type)) {
return recApply(unprefixedHexString, arg as NestedArray<string>);
} 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<string>);
} else if (/bytes/.test(type)) {
return recApply(toBuffer, arg as NestedArray<string>);
} else if (/int/.test(type)) {
return recApply(numberToBurrow, arg as NestedArray<BigNumber>);
}
return arg;
}


function burrowToAbi(arg: unknown, type: string): unknown {
if (/address/.test(type)) {
return recApply(prefixedHexString, arg as NestedArray<string>);
Expand Down
1 change: 1 addition & 0 deletions project/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6676e6e

Please sign in to comment.