diff --git a/.changeset/blue-dancers-guess.md b/.changeset/blue-dancers-guess.md deleted file mode 100644 index 37bdf738..00000000 --- a/.changeset/blue-dancers-guess.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -- Tests updated and double-checked. -- Fixed regexp for log extracting. -- Added ability to skip transaction signatures validation. -- Updated GitHub actions to show code coverage report diff --git a/.changeset/bright-comics-fold.md b/.changeset/bright-comics-fold.md deleted file mode 100644 index e5a14940..00000000 --- a/.changeset/bright-comics-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Fix the warning about deprecated default compute limit for transactions diff --git a/.changeset/brown-bugs-fry.md b/.changeset/brown-bugs-fry.md deleted file mode 100644 index 3a76574b..00000000 --- a/.changeset/brown-bugs-fry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Add explicit scoping to arguments for scripts in nested await functions to hint microbunde into doing the right thing diff --git a/.changeset/clean-oranges-hammer.md b/.changeset/clean-oranges-hammer.md deleted file mode 100644 index 2a57217e..00000000 --- a/.changeset/clean-oranges-hammer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Allow custom transaction signers to be provided as object with `addr`, `privateKey`, `keyId`, `hashAlgorithm`, `signatureAlgorithm` keys as an alternative to supplying merely the signer's account address and having Flow JS Testing determine the rest. This allows for more complex transaction authorizers. See [documentation for examples](/docs/send-transactions.md). diff --git a/.changeset/friendly-snails-push.md b/.changeset/friendly-snails-push.md deleted file mode 100644 index de212c7a..00000000 --- a/.changeset/friendly-snails-push.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Bump @onflow/flow-cadut to 0.2.0-alpha.7 (fixes bug where optional array, dictionary, path arguments did not work) diff --git a/.changeset/giant-dots-trade.md b/.changeset/giant-dots-trade.md deleted file mode 100644 index a7447d79..00000000 --- a/.changeset/giant-dots-trade.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Version bump @onflow/flow-cadut (fixes "transaction" keyword not allowed in templates & adds PublicPath/PrivatePath/StoragePath/CapabilityPath argument compatibility) diff --git a/.changeset/gold-cheetahs-attend.md b/.changeset/gold-cheetahs-attend.md deleted file mode 100644 index 83654d26..00000000 --- a/.changeset/gold-cheetahs-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Fix flow-cadut imports that prevented CLI from working diff --git a/.changeset/happy-gifts-bake.md b/.changeset/happy-gifts-bake.md deleted file mode 100644 index f06f536c..00000000 --- a/.changeset/happy-gifts-bake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Fix imports for flow-cadut generator diff --git a/.changeset/kind-fishes-switch.md b/.changeset/kind-fishes-switch.md deleted file mode 100644 index 58e782f0..00000000 --- a/.changeset/kind-fishes-switch.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Flow JS Testing now exports multiple new API methods: - -- [`pubFlowKey`](/docs/api.md#pubflowkeykeyobject) - may be used to generate an RLP-encoded `Buffer` representing a public key corresponding to a particular private key. -- [`createAccount`](/docs/accounts.md#createaccountname-keys) method which may be used to manually create an account with a given human-readable name & specified keys. - -And exports the following two enums which may be used with [`createAccount`](/docs/accounts.md#createaccountname-keys) and [`sendTransaction`](/docs/send-transactions.md): - -- [`SignatureAlgorithm`](/docs/api.md#signaturealgorithm) -- [`HashAlgorithm`](/docs/api.md#hashalgorithm) diff --git a/.changeset/long-hairs-collect.md b/.changeset/long-hairs-collect.md deleted file mode 100644 index 63bdccf0..00000000 --- a/.changeset/long-hairs-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Add getTimeOffset/setTimeOffset utilities, allowing to advance the time while testing smart-contracts diff --git a/.changeset/moody-moose-work.md b/.changeset/moody-moose-work.md deleted file mode 100644 index d52aa199..00000000 --- a/.changeset/moody-moose-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Emulator logs are now captured when calling `executeScript`, `sendTransaction`, `deployContract`, and `deployContractByName`. They part of the tuple returned by these functions (i.e. `[result, error, logs]`) and are provided as an array of strings. diff --git a/.changeset/olive-fishes-tap.md b/.changeset/olive-fishes-tap.md deleted file mode 100644 index 482cd0b8..00000000 --- a/.changeset/olive-fishes-tap.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -**BREAKING** Bumped @onflow/fcl to 1.1.1-alpha.1 - -Developers should note that `[U]Int*` and `Word*` types are now decoded into strings by @onflow/fcl and no longer implicitly decoded into numbers. This means that these types will need to be explicitly converted to JavaScript Number types if required. - -This potentially affects the return values or event data for the following flow-js-testing features. - - - `sendTransaction` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) - - `executeScript` (any `[U]Int*` and `Word*` return values will be decoded into a string instead of number) - - `deployContract`/`deployContractByName` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) - - `updateContract` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) - - `getBlockOffset` (return value will be string instead of number, and must be explicitly converted if JavaScript Number is required) - -[See more here](https://github.com/onflow/fcl-js/blob/%40onflow/fcl%401.0.3-alpha.1/packages/sdk/CHANGELOG.md#100-alpha0) \ No newline at end of file diff --git a/.changeset/polite-apes-shop.md b/.changeset/polite-apes-shop.md deleted file mode 100644 index d82743a5..00000000 --- a/.changeset/polite-apes-shop.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Introduce changesets diff --git a/.changeset/poor-sloths-love.md b/.changeset/poor-sloths-love.md deleted file mode 100644 index 7abc0693..00000000 --- a/.changeset/poor-sloths-love.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -No longer compress the packaged version of the library diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index ef069efb..00000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "mode": "exit", - "tag": "alpha", - "initialVersions": { - "@onflow/flow-js-testing": "0.2.3-alpha.7" - }, - "changesets": [ - "blue-dancers-guess", - "bright-comics-fold", - "brown-bugs-fry", - "clean-oranges-hammer", - "friendly-snails-push", - "giant-dots-trade", - "gold-cheetahs-attend", - "happy-gifts-bake", - "kind-fishes-switch", - "long-hairs-collect", - "moody-moose-work", - "olive-fishes-tap", - "polite-apes-shop", - "poor-sloths-love", - "quick-carrots-type", - "rare-starfishes-mate", - "red-vans-explode", - "rude-turtles-grab", - "selfish-turtles-do", - "sweet-penguins-cry", - "tough-swans-itch", - "wet-pillows-applaud" - ] -} diff --git a/.changeset/quick-carrots-type.md b/.changeset/quick-carrots-type.md deleted file mode 100644 index 70201017..00000000 --- a/.changeset/quick-carrots-type.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Add `signUserMessage` utility to sign a message with an arbitrary signer and `verifyUserMessage` to verify signatures. [See more here](/docs/api.md#signusermessagemessage-signer) diff --git a/.changeset/rare-starfishes-mate.md b/.changeset/rare-starfishes-mate.md deleted file mode 100644 index 55d9d1f7..00000000 --- a/.changeset/rare-starfishes-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Dynamically select ports for emulator instead of supplying admin port statically through emulator.start arguments, deprecate use of this argument diff --git a/.changeset/red-vans-explode.md b/.changeset/red-vans-explode.md deleted file mode 100644 index beaf0b4a..00000000 --- a/.changeset/red-vans-explode.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Block & timestamp offsets (e.g. `setBlockOffset`/`setTimestampOffset` now work in contracts. As well, `deployContract` & `deployContractByName` have the option of [accepting code transformers](/docs/api.md#deploycontractprops) like scripts/transactions. - -Additionally, passing the `builtInMethods` code transformer is now deprecated for scripts & transactions which require usage of block/timestamp offsets as transformer is applied by default internally by Flow JS Testing. - -[See more here](/TRANSITIONS.md#0002-depreaction-of-builtinmethods-code-transformer) diff --git a/.changeset/rude-turtles-grab.md b/.changeset/rude-turtles-grab.md deleted file mode 100644 index da7d2567..00000000 --- a/.changeset/rude-turtles-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Add explicit scoping to arguments in nested await functions to hint microbunde into doing the right thing diff --git a/.changeset/selfish-turtles-do.md b/.changeset/selfish-turtles-do.md deleted file mode 100644 index c1866149..00000000 --- a/.changeset/selfish-turtles-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Convert examples to run in Jest environment instead of ESM loader diff --git a/.changeset/sweet-penguins-cry.md b/.changeset/sweet-penguins-cry.md deleted file mode 100644 index 0cc57c4d..00000000 --- a/.changeset/sweet-penguins-cry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Fix numbers as values deprecation warnings for tests diff --git a/.changeset/tough-swans-itch.md b/.changeset/tough-swans-itch.md deleted file mode 100644 index 4569756e..00000000 --- a/.changeset/tough-swans-itch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": patch ---- - -Bumped @onflow/fcl to ^1.2.1-alpha.0 diff --git a/.changeset/wet-pillows-applaud.md b/.changeset/wet-pillows-applaud.md deleted file mode 100644 index 2ba2c5a1..00000000 --- a/.changeset/wet-pillows-applaud.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@onflow/flow-js-testing": minor ---- - -Add optional error message match to shallRevert Jest assertion diff --git a/CHANGELOG.md b/CHANGELOG.md index f2c9b663..8930ad63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,82 @@ # flow-js-testing +## 0.4.0 + +### Minor Changes + +- [#155](https://github.com/onflow/flow-js-testing/pull/155) [`9dcab53`](https://github.com/onflow/flow-js-testing/commit/9dcab535393654e3c6ba41a3ac41095519446c27) Thanks [@jribbink](https://github.com/jribbink)! - Allow custom transaction signers to be provided as object with `addr`, `privateKey`, `keyId`, `hashAlgorithm`, `signatureAlgorithm` keys as an alternative to supplying merely the signer's account address and having Flow JS Testing determine the rest. This allows for more complex transaction authorizers. See [documentation for examples](/docs/send-transactions.md). + +* [#158](https://github.com/onflow/flow-js-testing/pull/158) [`57edf7d`](https://github.com/onflow/flow-js-testing/commit/57edf7d215dd535ee8c4fa0e3dbc2d998efa8c79) Thanks [@jribbink](https://github.com/jribbink)! - Flow JS Testing now exports multiple new API methods: + + - [`pubFlowKey`](/docs/api.md#pubflowkeykeyobject) - may be used to generate an RLP-encoded `Buffer` representing a public key corresponding to a particular private key. + - [`createAccount`](/docs/accounts.md#createaccountname-keys) method which may be used to manually create an account with a given human-readable name & specified keys. + + And exports the following two enums which may be used with [`createAccount`](/docs/accounts.md#createaccountname-keys) and [`sendTransaction`](/docs/send-transactions.md): + + - [`SignatureAlgorithm`](/docs/api.md#signaturealgorithm) + - [`HashAlgorithm`](/docs/api.md#hashalgorithm) + +- [#126](https://github.com/onflow/flow-js-testing/pull/126) [`3fc34f3`](https://github.com/onflow/flow-js-testing/commit/3fc34f3f52f2623ca825ba84e05c774996bce67e) Thanks [@refi93](https://github.com/refi93)! - Add getTimeOffset/setTimeOffset utilities, allowing to advance the time while testing smart-contracts + +* [#170](https://github.com/onflow/flow-js-testing/pull/170) [`da5e666`](https://github.com/onflow/flow-js-testing/commit/da5e6667fd9cf134ea536d6c82ce5e649e86d28f) Thanks [@jribbink](https://github.com/jribbink)! - Emulator logs are now captured when calling `executeScript`, `sendTransaction`, `deployContract`, and `deployContractByName`. They part of the tuple returned by these functions (i.e. `[result, error, logs]`) and are provided as an array of strings. + +- [#142](https://github.com/onflow/flow-js-testing/pull/142) [`9aecfdd`](https://github.com/onflow/flow-js-testing/commit/9aecfdd67a98f4eb16b7350b8892c08d83dbd0f7) Thanks [@jribbink](https://github.com/jribbink)! - **BREAKING** Bumped @onflow/fcl to 1.1.1-alpha.1 + + Developers should note that `[U]Int*` and `Word*` types are now decoded into strings by @onflow/fcl and no longer implicitly decoded into numbers. This means that these types will need to be explicitly converted to JavaScript Number types if required. + + This potentially affects the return values or event data for the following flow-js-testing features. + + - `sendTransaction` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) + - `executeScript` (any `[U]Int*` and `Word*` return values will be decoded into a string instead of number) + - `deployContract`/`deployContractByName` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) + - `updateContract` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number) + - `getBlockOffset` (return value will be string instead of number, and must be explicitly converted if JavaScript Number is required) + + [See more here](https://github.com/onflow/fcl-js/blob/%40onflow/fcl%401.0.3-alpha.1/packages/sdk/CHANGELOG.md#100-alpha0) + +* [#166](https://github.com/onflow/flow-js-testing/pull/166) [`69b25e0`](https://github.com/onflow/flow-js-testing/commit/69b25e089a28ccea40e1ba41ff2045aa71b92cb4) Thanks [@jribbink](https://github.com/jribbink)! - Add `signUserMessage` utility to sign a message with an arbitrary signer and `verifyUserMessage` to verify signatures. [See more here](/docs/api.md#signusermessagemessage-signer) + +- [#117](https://github.com/onflow/flow-js-testing/pull/117) [`033562b`](https://github.com/onflow/flow-js-testing/commit/033562b78e7d0b065578fd4bd1d63dae528c091a) Thanks [@jribbink](https://github.com/jribbink)! - Dynamically select ports for emulator instead of supplying admin port statically through emulator.start arguments, deprecate use of this argument + +* [#129](https://github.com/onflow/flow-js-testing/pull/129) [`78944c1`](https://github.com/onflow/flow-js-testing/commit/78944c155dd50bff9a350bfac5da0c2dd5493d69) Thanks [@jribbink](https://github.com/jribbink)! - Add optional error message match to shallRevert Jest assertion + +### Patch Changes + +- [#207](https://github.com/onflow/flow-js-testing/pull/207) [`a65ff32`](https://github.com/onflow/flow-js-testing/commit/a65ff328863aaac087a4f01c66a19a660f52519f) Thanks [@MaxStalker](https://github.com/MaxStalker)! - - Tests updated and double-checked. + - Fixed regexp for log extracting. + - Added ability to skip transaction signatures validation. + - Updated GitHub actions to show code coverage report + +* [#177](https://github.com/onflow/flow-js-testing/pull/177) [`8d75426`](https://github.com/onflow/flow-js-testing/commit/8d75426bd605c8488809f271537fd6dcdf43e81f) Thanks [@adbario](https://github.com/adbario)! - Fix the warning about deprecated default compute limit for transactions + +- [#190](https://github.com/onflow/flow-js-testing/pull/190) [`1ce23f0`](https://github.com/onflow/flow-js-testing/commit/1ce23f0c1e78afb2bec372aadb59212aa7666ab9) Thanks [@adbario](https://github.com/adbario)! - Add explicit scoping to arguments for scripts in nested await functions to hint microbunde into doing the right thing + +* [#164](https://github.com/onflow/flow-js-testing/pull/164) [`962b535`](https://github.com/onflow/flow-js-testing/commit/962b53572848ba17f7b472e07171f0e775448406) Thanks [@jribbink](https://github.com/jribbink)! - Bump @onflow/flow-cadut to 0.2.0-alpha.7 (fixes bug where optional array, dictionary, path arguments did not work) + +- [#138](https://github.com/onflow/flow-js-testing/pull/138) [`e807e83`](https://github.com/onflow/flow-js-testing/commit/e807e831de37f92dc429f872ac62f1ab4d575d0e) Thanks [@jribbink](https://github.com/jribbink)! - Version bump @onflow/flow-cadut (fixes "transaction" keyword not allowed in templates & adds PublicPath/PrivatePath/StoragePath/CapabilityPath argument compatibility) + +* [#149](https://github.com/onflow/flow-js-testing/pull/149) [`fcabb81`](https://github.com/onflow/flow-js-testing/commit/fcabb81ebf78bc271ca39c01e4c901cae94cf8b0) Thanks [@jribbink](https://github.com/jribbink)! - Fix flow-cadut imports that prevented CLI from working + +- [#192](https://github.com/onflow/flow-js-testing/pull/192) [`31c5da0`](https://github.com/onflow/flow-js-testing/commit/31c5da087108b22ce3dba9cd31ca6282f0ec81ff) Thanks [@justinbarry](https://github.com/justinbarry)! - Fix imports for flow-cadut generator + +* [#116](https://github.com/onflow/flow-js-testing/pull/116) [`5791e66`](https://github.com/onflow/flow-js-testing/commit/5791e669e9304dc82f8dbefd0aa923d10e4aac25) Thanks [@jribbink](https://github.com/jribbink)! - Introduce changesets + +- [#186](https://github.com/onflow/flow-js-testing/pull/186) [`de917f0`](https://github.com/onflow/flow-js-testing/commit/de917f004c5171e8e26aaf9919e1511d949bafce) Thanks [@justinbarry](https://github.com/justinbarry)! - No longer compress the packaged version of the library + +* [#165](https://github.com/onflow/flow-js-testing/pull/165) [`4ac3741`](https://github.com/onflow/flow-js-testing/commit/4ac37411199245528fb149b0f7bff7125311ac44) Thanks [@jribbink](https://github.com/jribbink)! - Block & timestamp offsets (e.g. `setBlockOffset`/`setTimestampOffset` now work in contracts. As well, `deployContract` & `deployContractByName` have the option of [accepting code transformers](/docs/api.md#deploycontractprops) like scripts/transactions. + + Additionally, passing the `builtInMethods` code transformer is now deprecated for scripts & transactions which require usage of block/timestamp offsets as transformer is applied by default internally by Flow JS Testing. + + [See more here](/TRANSITIONS.md#0002-depreaction-of-builtinmethods-code-transformer) + +- [#186](https://github.com/onflow/flow-js-testing/pull/186) [`ff208e2`](https://github.com/onflow/flow-js-testing/commit/ff208e2fd397e685900ed29baaa2846b0bbe5bab) Thanks [@justinbarry](https://github.com/justinbarry)! - Add explicit scoping to arguments in nested await functions to hint microbunde into doing the right thing + +* [#144](https://github.com/onflow/flow-js-testing/pull/144) [`d1eb29b`](https://github.com/onflow/flow-js-testing/commit/d1eb29bd5d115d4e13725de96bb9b53d3f9655ad) Thanks [@jribbink](https://github.com/jribbink)! - Convert examples to run in Jest environment instead of ESM loader + +- [#188](https://github.com/onflow/flow-js-testing/pull/188) [`f905016`](https://github.com/onflow/flow-js-testing/commit/f905016c57c4d438c5be56eded188a0169d6eb59) Thanks [@adbario](https://github.com/adbario)! - Fix numbers as values deprecation warnings for tests + +* [#156](https://github.com/onflow/flow-js-testing/pull/156) [`2206eda`](https://github.com/onflow/flow-js-testing/commit/2206eda493e7c51cfe53c1cbf9365e81064dbcef) Thanks [@jribbink](https://github.com/jribbink)! - Bumped @onflow/fcl to ^1.2.1-alpha.0 + ## 0.3.2-alpha.0 ### Patch Changes diff --git a/package.json b/package.json index 21246ae3..ac1283cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onflow/flow-js-testing", - "version": "0.3.2-alpha.0", + "version": "0.4.0", "description": "This package will expose a set of utility methods, to allow Cadence code testing with libraries like Jest", "repository": { "type": "git",