diff --git a/CHANGELOG.md b/CHANGELOG.md index 83af8e69f..77c0a015f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # [Hyperledger Burrow](/~https://github.com/hyperledger/burrow) Changelog +## [0.33.1] - 2021-05-24 +### Fixed +- [JS] Return bytesNN as Buffer to agree with typings + +### Added +- [JS] Inline sources and source maps + + ## [0.33.0] - 2021-05-24 ### Changed - [JS] Changed Burrow interface and renamed Burrow client object to to Client (merging in features needed for solts support) @@ -767,6 +775,7 @@ This release marks the start of Eris-DB as the full permissioned blockchain node - [Blockchain] Fix getBlocks to respect block height cap. +[0.33.1]: /~https://github.com/hyperledger/burrow/compare/v0.33.0...v0.33.1 [0.33.0]: /~https://github.com/hyperledger/burrow/compare/v0.32.1...v0.33.0 [0.32.1]: /~https://github.com/hyperledger/burrow/compare/v0.32.0...v0.32.1 [0.32.0]: /~https://github.com/hyperledger/burrow/compare/v0.31.3...v0.32.0 diff --git a/NOTES.md b/NOTES.md index 6985f3c7b..7b7b53441 100644 --- a/NOTES.md +++ b/NOTES.md @@ -1,12 +1,6 @@ -### Changed -- [JS] Changed Burrow interface and renamed Burrow client object to to Client (merging in features needed for solts support) - ### Fixed -- [JS] Fixed RLP encoding extra leading zeros on uint64 (thanks Matthieu Vachon!) -- [JS] Improved compatibility with legacy Solidity bytes types and padding conventions -- [Events] Fixed Burrow event stream wrongly switching to streaming mode for block ranges that are available in state (when the latest block is an empty block - so not stored in state) +- [JS] Return bytesNN as Buffer to agree with typings ### Added -- [JS] Added Solidity-to-Typescript code generation support (merging in solts) - this provides helpers (build.ts, api.ts) to compile Solidity files into corresponding .abi.ts files that include types for functions, events, the ABI, and EVM bytecode, and includes bindings into Burrow JS to deploy and interact with contracts via Typescript/Javascript with strong static types -- [JS] Improved interactions with events which can now be queried over any range and with strong types, see the listenerFor, reduceEvents, readEvents, and iterateEvents functions. +- [JS] Inline sources and source maps diff --git a/js/src/convert.ts b/js/src/convert.ts index 4073e1027..b3edb7c51 100644 --- a/js/src/convert.ts +++ b/js/src/convert.ts @@ -68,10 +68,6 @@ function postDecode(arg: unknown, type: string): unknown { if (/address/.test(type)) { return recApply(unprefixedHexString, arg as NestedArray); } - if (bytesNN.test(type)) { - // Handle bytes32 differently - for legacy reasons they are used as identifiers and represented as hex strings - return recApply(unprefixedHexString, arg as NestedArray); - } if (/bytes/.test(type)) { return recApply(toBuffer, arg as NestedArray); } diff --git a/js/src/test/functional.test.ts b/js/src/test/functional.test.ts index accd58766..45e7ef340 100644 --- a/js/src/test/functional.test.ts +++ b/js/src/test/functional.test.ts @@ -46,20 +46,9 @@ describe('Functional Contract Usage', function () { instance1.getCombination.at(address2)(), ]); - const expected1 = [ - 100, - address1, - 'hello moto', - '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', - '88977A37D05A4FE86D09E88C88A49C2FCF7D6D8F', - ]; - const expected2 = [ - 100, - address2, - 'hello moto', - '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', - 'ABCDEFABCDEFABCDEFABCDEFABCDEFABCDEF0123', - ]; + const randomBytes = Buffer.from('000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', 'hex'); + const expected1 = [100, address1, 'hello moto', randomBytes, '88977A37D05A4FE86D09E88C88A49C2FCF7D6D8F']; + const expected2 = [100, address2, 'hello moto', randomBytes, 'ABCDEFABCDEFABCDEFABCDEFABCDEFABCDEF0123']; assert.deepStrictEqual([...ret1], expected1); assert.deepStrictEqual([...ret2], expected2); // Check we are assigning names to hybrid record/array Result object diff --git a/js/src/test/get-set.test.ts b/js/src/test/get-set.test.ts index 9d6f75487..42b730d68 100644 --- a/js/src/test/get-set.test.ts +++ b/js/src/test/get-set.test.ts @@ -60,7 +60,7 @@ contract GetSet { `; const testUint = 42; - const testBytes = 'DEADBEEF00000000000000000000000000000000000000000000000000000000'; + const testBytes = Buffer.from('DEADBEEF00000000000000000000000000000000000000000000000000000000', 'hex'); const testString = 'Hello World!'; const testBool = true; @@ -86,7 +86,7 @@ contract GetSet { it('Bytes', async () => { await TestContract.setBytes(testBytes); const output = await TestContract.getBytes(); - assert.strictEqual(output[0], testBytes); + assert.deepStrictEqual(output[0], testBytes); }); it('String', async () => { diff --git a/js/src/test/handler-overwriting.test.ts b/js/src/test/handler-overwriting.test.ts index 1453c3b7c..b0c5c8cba 100644 --- a/js/src/test/handler-overwriting.test.ts +++ b/js/src/test/handler-overwriting.test.ts @@ -41,14 +41,15 @@ describe('Testing Per-contract handler overwriting', function () { }); const address = getMetadata(instance).address; const returnObject = await instance.getCombination(); + const randomBytes = Buffer.from('000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', 'hex'); const expected = { values: { _number: 100, _address: address, _saying: 'hello moto', - _randomBytes: '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', + _randomBytes: randomBytes, }, - raw: [100, address, 'hello moto', '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE'], + raw: [100, address, 'hello moto', randomBytes], }; assert.deepStrictEqual(returnObject, expected); }); diff --git a/js/src/test/return-types.test.ts b/js/src/test/return-types.test.ts index e6ac608c7..5c68ea542 100644 --- a/js/src/test/return-types.test.ts +++ b/js/src/test/return-types.test.ts @@ -36,19 +36,15 @@ describe('Multiple return types', function () { }; }, }); + const randomBytes = Buffer.from('000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', 'hex'); const expected = { values: { _number: 100, _address: getAddress(instance), _saying: 'hello moto', - _randomBytes: '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', + _randomBytes: randomBytes, }, - raw: [ - 100, - getAddress(instance), - 'hello moto', - '000000000000000000000000000000000000000000000000DEADBEEFFEEDFACE', - ], + raw: [100, getAddress(instance), 'hello moto', randomBytes], }; const result = await instance.getCombination(); assert.deepStrictEqual(result, expected); diff --git a/js/src/test/solts.test.ts b/js/src/test/solts.test.ts index dfe1c8fdb..71d7bf20c 100644 --- a/js/src/test/solts.test.ts +++ b/js/src/test/solts.test.ts @@ -34,7 +34,8 @@ describe('solts', () => { // Look ma, type narrowing! events.map((event) => { if (event.name === 'Init') { - assert.strictEqual(event.payload.eventId, '6576656E74310000000000000000000000000000000000000000000000000000'); + const eventId = Buffer.from('6576656E74310000000000000000000000000000000000000000000000000000', 'hex'); + assert.deepStrictEqual(event.payload.eventId, eventId); } else if (event.name === 'MonoRampage') { assert.strictEqual(event.payload.timestamp, 123); } diff --git a/js/tsconfig.json b/js/tsconfig.json index 2a60e64ed..c574ce6a4 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -5,7 +5,8 @@ "preserveSymlinks": true, "esModuleInterop": true, "alwaysStrict": true, - "sourceMap": true, + "inlineSourceMap": true, + "inlineSources": true, "declaration": true, "strict": true, "noImplicitAny": true, diff --git a/project/history.go b/project/history.go index d2814ecd1..a35b837b6 100644 --- a/project/history.go +++ b/project/history.go @@ -47,7 +47,14 @@ func FullVersion() string { // To cut a new release add a release to the front of this slice then run the // release tagging script: ./scripts/tag_release.sh var History relic.ImmutableHistory = relic.NewHistory("Hyperledger Burrow", "/~https://github.com/hyperledger/burrow"). - MustDeclareReleases("0.33.0 - 2021-05-24", + MustDeclareReleases("0.33.1 - 2021-05-24", + `### Fixed +- [JS] Return bytesNN as Buffer to agree with typings + +### Added +- [JS] Inline sources and source maps +`, + "0.33.0 - 2021-05-24", `### Changed - [JS] Changed Burrow interface and renamed Burrow client object to to Client (merging in features needed for solts support)