Skip to content

Commit

Permalink
Bump @onflow/fcl to 1.1.1-alpha.1 (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Jul 18, 2022
1 parent d1eb29b commit 9aecfdd
Show file tree
Hide file tree
Showing 21 changed files with 493 additions and 179 deletions.
17 changes: 17 additions & 0 deletions .changeset/olive-fishes-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@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)
2 changes: 1 addition & 1 deletion docs/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Resolves name alias to a Flow address (`0x` prefixed) under the following condit
#### Usage

```javascript
import {getAccountAddress} from "flow-js-testing"
import {getAccountAddress} from "@onflow/flow-js-testing"

const main = async () => {
const Alice = await getAccountAddress("Alice")
Expand Down
40 changes: 20 additions & 20 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Resolves name alias to a Flow address (`0x` prefixed) under the following condit

```javascript
import path from "path"
import {init, emulator, getAccountAddress} from "flow-js-testing"
import {init, emulator, getAccountAddress} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -70,7 +70,7 @@ Props object accepts following fields:

```javascript
import path from "path";
import { init, emulator, deployContractByName } from "flow-js-testing";
import { init, emulator, deployContractByName } from "@onflow/flow-js-testing";

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence");
Expand Down Expand Up @@ -134,7 +134,7 @@ import {
getAccountAddress,
deployContract,
executeScript,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

;(async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -286,7 +286,7 @@ This method does not expect any arguments.
#### Usage

```javascript
import {emulator, init} from "flow-js-testing"
import {emulator, init} from "@onflow/flow-js-testing"

describe("test setup", () => {
// Instantiate emulator and path to Cadence files
Expand Down Expand Up @@ -322,7 +322,7 @@ Method does not return anything.

```javascript
import path from "path"
import {emulator, init} from "flow-js-testing"
import {emulator, init} from "@onflow/flow-js-testing"

describe("test setup", () => {
// Instantiate emulator and path to Cadence files
Expand Down Expand Up @@ -382,7 +382,7 @@ import {
emulator,
getAccountAddress,
getFlowBalance,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -488,7 +488,7 @@ Initializes framework variables.

```javascript
import path from "path"
import {init} from "flow-js-testing"
import {init} from "@onflow/flow-js-testing"

describe("test setup", () => {
beforeEach(async () => {
Expand All @@ -511,13 +511,13 @@ Returns current block offset - amount of blocks added on top of real current blo

| Type | Description |
| ------ | ----------------------------------------------------------------------- |
| number | number representing amount of blocks added on top of real current block |
| string | number representing amount of blocks added on top of real current block (encoded as string) |

#### Usage

```javascript
import path from "path"
import {init, emulator, getBlockOffset} from "flow-js-testing"
import {init, emulator, getBlockOffset} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -564,7 +564,7 @@ import {
setBlockOffset,
builtInMethods,
sendTransaction,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -611,7 +611,7 @@ Returns current timestamp offset - amount of seconds added on top of real curren

```javascript
import path from "path"
import {init, emulator, getTimestampOffset} from "flow-js-testing"
import {init, emulator, getTimestampOffset} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -658,7 +658,7 @@ import {
setTimestampOffset,
builtInMethods,
sendTransaction,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -932,7 +932,7 @@ Provides explicit control over how you pass values.

```javascript
import path from "path"
import {init, emulator, executeScript} from "flow-js-testing"
import {init, emulator, executeScript} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -984,7 +984,7 @@ Cadence files.

```javascript
import path from "path"
import {init, emulator, executeScript} from "flow-js-testing"
import {init, emulator, executeScript} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1055,7 +1055,7 @@ import {
emulator,
sendTransaction,
getAccountAddress,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1108,7 +1108,7 @@ Cadence files.

```javascript
import path from "path"
import {init, emulator, sendTransaction} from "flow-js-testing"
import {init, emulator, sendTransaction} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1158,7 +1158,7 @@ Returns Cadence template as string with addresses replaced using addressMap

```javascript
import path from "path"
import {init, getTemplate} from "flow-js-testing"
import {init, getTemplate} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1192,7 +1192,7 @@ Returns Cadence template from file with `name` in `_basepath_/contracts` folder

```javascript
import path from "path"
import {init, emulator, getContractCode} from "flow-js-testing"
import {init, emulator, getContractCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1237,7 +1237,7 @@ Returns Cadence template from file with `name` in `_basepath_/transactions` fold

```javascript
import path from "path"
import {init, emulator, getTransactionCode} from "flow-js-testing"
import {init, emulator, getTransactionCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -1283,7 +1283,7 @@ Returns Cadence template from file with `name` in `_basepath_/scripts` folder

```javascript
import path from "path"
import {init, emulator, getScriptCode} from "flow-js-testing"
import {init, emulator, getScriptCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
6 changes: 3 additions & 3 deletions docs/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Usage:

```javascript
import path from "path"
import {init, emulator, deployContractByName} from "flow-js-testing"
import {init, emulator, deployContractByName} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -83,7 +83,7 @@ Usage:

```javascript
import path from "path"
import {init, emulator, deployContract} from "flow-js-testing"
import {init, emulator, deployContract} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -131,7 +131,7 @@ Returns the address of the account where the contract is currently deployed.
| `name` | string | name of the contract |

```javascript
import {getContractAddress} from "flow-js-testing"
import {getContractAddress} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
6 changes: 3 additions & 3 deletions docs/emulator.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Starts emulator on random available port, unless overriden in options. Returns P
#### Usage

```javascript
import {emulator, init} from "flow-js-testing"
import {emulator, init} from "@onflow/flow-js-testing"

describe("test setup", () => {
// Instantiate emulator and path to Cadence files
Expand All @@ -62,7 +62,7 @@ This method does not expect any arguments.
#### Usage

```javascript
import {emulator, init} from "flow-js-testing"
import {emulator, init} from "@onflow/flow-js-testing"

describe("test setup", () => {
// Instantiate emulator and path to Cadence files
Expand Down Expand Up @@ -93,7 +93,7 @@ Set logging flag on emulator, allowing to temporally enable/disable logging.
#### Usage

```javascript
import {emulator, init} from "flow-js-testing"
import {emulator, init} from "@onflow/flow-js-testing"

describe("test setup", () => {
// Instantiate emulator and path to Cadence files
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ You may want to pass dictionaries as arguments to your Cadence code. The most
common is metadata with `{String:String}` type

```javascript
import {executeScript} from "flow-js-testing"
import {executeScript} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
4 changes: 2 additions & 2 deletions docs/execute-scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Provides explicit control over how you pass values.

```javascript
import path from "path"
import {init, emulator, executeScript} from "flow-js-testing"
import {init, emulator, executeScript} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -77,7 +77,7 @@ Cadence files.

```javascript
import path from "path"
import {init, emulator, executeScript} from "flow-js-testing"
import {init, emulator, executeScript} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
4 changes: 2 additions & 2 deletions docs/flow-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
emulator,
getAccountAddress,
getFlowBalance,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -66,7 +66,7 @@ Sends transaction to mint the specified amount of FLOW and send it to recipient.
#### Usage

```javascript
import {init, emulator, mintFlow} from "flow-js-testing"
import {init, emulator, mintFlow} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
2 changes: 1 addition & 1 deletion docs/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Initializes framework variables.

```javascript
import path from "path"
import {init} from "flow-js-testing"
import {init} from "@onflow/flow-js-testing"

describe("test setup", () => {
beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion docs/jest-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
shallPass,
sendTransaction,
getAccountAddress,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

// We need to set timeout for a higher number, because some transactions might take up some time
jest.setTimeout(10000)
Expand Down
4 changes: 2 additions & 2 deletions docs/send-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import {
emulator,
sendTransaction,
getAccountAddress,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -89,7 +89,7 @@ Cadence files.

```javascript
import path from "path"
import {init, emulator, sendTransaction} from "flow-js-testing"
import {init, emulator, sendTransaction} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
10 changes: 5 additions & 5 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Returns Cadence template as string with addresses replaced using addressMap

```javascript
import path from "path"
import {init, getTemplate} from "flow-js-testing"
import {init, getTemplate} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -63,7 +63,7 @@ Returns Cadence template from file with `name` in `_basepath_/contracts` folder

```javascript
import path from "path"
import {init, emulator, getContractCode} from "flow-js-testing"
import {init, emulator, getContractCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -108,7 +108,7 @@ Returns Cadence template from file with `name` in `_basepath_/transactions` fold

```javascript
import path from "path"
import {init, emulator, getTransactionCode} from "flow-js-testing"
import {init, emulator, getTransactionCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -154,7 +154,7 @@ Returns Cadence template from file with `name` in `_basepath_/scripts` folder

```javascript
import path from "path"
import {init, emulator, getScriptCode} from "flow-js-testing"
import {init, emulator, getScriptCode} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down Expand Up @@ -190,7 +190,7 @@ import {
getContractCode,
getTransactionCode,
getScriptCode,
} from "flow-js-testing"
} from "@onflow/flow-js-testing"

const main = async () => {
const basePath = path.resolve(__dirname, "../cadence")
Expand Down
2 changes: 1 addition & 1 deletion examples/03-deploy-contract.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ test("deploy contract", async () => {
}
`,
})
expect(balance).toBe(1337)
expect(balance).toBe("1337")
})

afterEach(async () => {
Expand Down
Loading

0 comments on commit 9aecfdd

Please sign in to comment.