Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit 9aecfdd

Browse files
authored
Bump @onflow/fcl to 1.1.1-alpha.1 (#142)
1 parent d1eb29b commit 9aecfdd

21 files changed

+493
-179
lines changed

.changeset/olive-fishes-tap.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
"@onflow/flow-js-testing": minor
3+
---
4+
5+
**BREAKING** Bumped @onflow/fcl to 1.1.1-alpha.1
6+
7+
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.
8+
9+
This potentially affects the return values or event data for the following flow-js-testing features.
10+
11+
- `sendTransaction` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number)
12+
- `executeScript` (any `[U]Int*` and `Word*` return values will be decoded into a string instead of number)
13+
- `deployContract`/`deployContractByName` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number)
14+
- `updateContract` (any `[U]Int*` and `Word*` event data will be decoded into a string instead of number)
15+
- `getBlockOffset` (return value will be string instead of number, and must be explicitly converted if JavaScript Number is required)
16+
17+
[See more here](https://github.com/onflow/fcl-js/blob/%40onflow/fcl%401.0.3-alpha.1/packages/sdk/CHANGELOG.md#100-alpha0)

docs/accounts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Resolves name alias to a Flow address (`0x` prefixed) under the following condit
3131
#### Usage
3232

3333
```javascript
34-
import {getAccountAddress} from "flow-js-testing"
34+
import {getAccountAddress} from "@onflow/flow-js-testing"
3535

3636
const main = async () => {
3737
const Alice = await getAccountAddress("Alice")

docs/api.md

+20-20
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Resolves name alias to a Flow address (`0x` prefixed) under the following condit
2727

2828
```javascript
2929
import path from "path"
30-
import {init, emulator, getAccountAddress} from "flow-js-testing"
30+
import {init, emulator, getAccountAddress} from "@onflow/flow-js-testing"
3131

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

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

7575
const main = async () => {
7676
const basePath = path.resolve(__dirname, "../cadence");
@@ -134,7 +134,7 @@ import {
134134
getAccountAddress,
135135
deployContract,
136136
executeScript,
137-
} from "flow-js-testing"
137+
} from "@onflow/flow-js-testing"
138138

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

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

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

323323
```javascript
324324
import path from "path"
325-
import {emulator, init} from "flow-js-testing"
325+
import {emulator, init} from "@onflow/flow-js-testing"
326326

327327
describe("test setup", () => {
328328
// Instantiate emulator and path to Cadence files
@@ -382,7 +382,7 @@ import {
382382
emulator,
383383
getAccountAddress,
384384
getFlowBalance,
385-
} from "flow-js-testing"
385+
} from "@onflow/flow-js-testing"
386386

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

489489
```javascript
490490
import path from "path"
491-
import {init} from "flow-js-testing"
491+
import {init} from "@onflow/flow-js-testing"
492492

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

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

516516
#### Usage
517517

518518
```javascript
519519
import path from "path"
520-
import {init, emulator, getBlockOffset} from "flow-js-testing"
520+
import {init, emulator, getBlockOffset} from "@onflow/flow-js-testing"
521521

522522
const main = async () => {
523523
const basePath = path.resolve(__dirname, "../cadence")
@@ -564,7 +564,7 @@ import {
564564
setBlockOffset,
565565
builtInMethods,
566566
sendTransaction,
567-
} from "flow-js-testing"
567+
} from "@onflow/flow-js-testing"
568568

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

612612
```javascript
613613
import path from "path"
614-
import {init, emulator, getTimestampOffset} from "flow-js-testing"
614+
import {init, emulator, getTimestampOffset} from "@onflow/flow-js-testing"
615615

616616
const main = async () => {
617617
const basePath = path.resolve(__dirname, "../cadence")
@@ -658,7 +658,7 @@ import {
658658
setTimestampOffset,
659659
builtInMethods,
660660
sendTransaction,
661-
} from "flow-js-testing"
661+
} from "@onflow/flow-js-testing"
662662

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

933933
```javascript
934934
import path from "path"
935-
import {init, emulator, executeScript} from "flow-js-testing"
935+
import {init, emulator, executeScript} from "@onflow/flow-js-testing"
936936

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

985985
```javascript
986986
import path from "path"
987-
import {init, emulator, executeScript} from "flow-js-testing"
987+
import {init, emulator, executeScript} from "@onflow/flow-js-testing"
988988

989989
const main = async () => {
990990
const basePath = path.resolve(__dirname, "../cadence")
@@ -1055,7 +1055,7 @@ import {
10551055
emulator,
10561056
sendTransaction,
10571057
getAccountAddress,
1058-
} from "flow-js-testing"
1058+
} from "@onflow/flow-js-testing"
10591059

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

11091109
```javascript
11101110
import path from "path"
1111-
import {init, emulator, sendTransaction} from "flow-js-testing"
1111+
import {init, emulator, sendTransaction} from "@onflow/flow-js-testing"
11121112

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

11591159
```javascript
11601160
import path from "path"
1161-
import {init, getTemplate} from "flow-js-testing"
1161+
import {init, getTemplate} from "@onflow/flow-js-testing"
11621162

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

11931193
```javascript
11941194
import path from "path"
1195-
import {init, emulator, getContractCode} from "flow-js-testing"
1195+
import {init, emulator, getContractCode} from "@onflow/flow-js-testing"
11961196

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

12381238
```javascript
12391239
import path from "path"
1240-
import {init, emulator, getTransactionCode} from "flow-js-testing"
1240+
import {init, emulator, getTransactionCode} from "@onflow/flow-js-testing"
12411241

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

12841284
```javascript
12851285
import path from "path"
1286-
import {init, emulator, getScriptCode} from "flow-js-testing"
1286+
import {init, emulator, getScriptCode} from "@onflow/flow-js-testing"
12871287

12881288
const main = async () => {
12891289
const basePath = path.resolve(__dirname, "../cadence")

docs/contracts.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Usage:
3232

3333
```javascript
3434
import path from "path"
35-
import {init, emulator, deployContractByName} from "flow-js-testing"
35+
import {init, emulator, deployContractByName} from "@onflow/flow-js-testing"
3636

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

8484
```javascript
8585
import path from "path"
86-
import {init, emulator, deployContract} from "flow-js-testing"
86+
import {init, emulator, deployContract} from "@onflow/flow-js-testing"
8787

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

133133
```javascript
134-
import {getContractAddress} from "flow-js-testing"
134+
import {getContractAddress} from "@onflow/flow-js-testing"
135135

136136
const main = async () => {
137137
const basePath = path.resolve(__dirname, "../cadence")

docs/emulator.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Starts emulator on random available port, unless overriden in options. Returns P
3636
#### Usage
3737

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

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

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

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

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

9898
describe("test setup", () => {
9999
// Instantiate emulator and path to Cadence files

docs/examples/metadata.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You may want to pass dictionaries as arguments to your Cadence code. The most
1010
common is metadata with `{String:String}` type
1111

1212
```javascript
13-
import {executeScript} from "flow-js-testing"
13+
import {executeScript} from "@onflow/flow-js-testing"
1414

1515
const main = async () => {
1616
const basePath = path.resolve(__dirname, "../cadence")

docs/execute-scripts.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Provides explicit control over how you pass values.
3131

3232
```javascript
3333
import path from "path"
34-
import {init, emulator, executeScript} from "flow-js-testing"
34+
import {init, emulator, executeScript} from "@onflow/flow-js-testing"
3535

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

7878
```javascript
7979
import path from "path"
80-
import {init, emulator, executeScript} from "flow-js-testing"
80+
import {init, emulator, executeScript} from "@onflow/flow-js-testing"
8181

8282
const main = async () => {
8383
const basePath = path.resolve(__dirname, "../cadence")

docs/flow-token.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import {
3131
emulator,
3232
getAccountAddress,
3333
getFlowBalance,
34-
} from "flow-js-testing"
34+
} from "@onflow/flow-js-testing"
3535

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

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

7171
const main = async () => {
7272
const basePath = path.resolve(__dirname, "../cadence")

docs/init.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Initializes framework variables.
2828

2929
```javascript
3030
import path from "path"
31-
import {init} from "flow-js-testing"
31+
import {init} from "@onflow/flow-js-testing"
3232

3333
describe("test setup", () => {
3434
beforeEach(async () => {

docs/jest-helpers.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
shallPass,
3434
sendTransaction,
3535
getAccountAddress,
36-
} from "flow-js-testing"
36+
} from "@onflow/flow-js-testing"
3737

3838
// We need to set timeout for a higher number, because some transactions might take up some time
3939
jest.setTimeout(10000)

docs/send-transactions.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
emulator,
4343
sendTransaction,
4444
getAccountAddress,
45-
} from "flow-js-testing"
45+
} from "@onflow/flow-js-testing"
4646

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

9090
```javascript
9191
import path from "path"
92-
import {init, emulator, sendTransaction} from "flow-js-testing"
92+
import {init, emulator, sendTransaction} from "@onflow/flow-js-testing"
9393

9494
const main = async () => {
9595
const basePath = path.resolve(__dirname, "../cadence")

docs/templates.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Returns Cadence template as string with addresses replaced using addressMap
2929

3030
```javascript
3131
import path from "path"
32-
import {init, getTemplate} from "flow-js-testing"
32+
import {init, getTemplate} from "@onflow/flow-js-testing"
3333

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

6464
```javascript
6565
import path from "path"
66-
import {init, emulator, getContractCode} from "flow-js-testing"
66+
import {init, emulator, getContractCode} from "@onflow/flow-js-testing"
6767

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

109109
```javascript
110110
import path from "path"
111-
import {init, emulator, getTransactionCode} from "flow-js-testing"
111+
import {init, emulator, getTransactionCode} from "@onflow/flow-js-testing"
112112

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

155155
```javascript
156156
import path from "path"
157-
import {init, emulator, getScriptCode} from "flow-js-testing"
157+
import {init, emulator, getScriptCode} from "@onflow/flow-js-testing"
158158

159159
const main = async () => {
160160
const basePath = path.resolve(__dirname, "../cadence")
@@ -190,7 +190,7 @@ import {
190190
getContractCode,
191191
getTransactionCode,
192192
getScriptCode,
193-
} from "flow-js-testing"
193+
} from "@onflow/flow-js-testing"
194194

195195
const main = async () => {
196196
const basePath = path.resolve(__dirname, "../cadence")

examples/03-deploy-contract.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ test("deploy contract", async () => {
3939
}
4040
`,
4141
})
42-
expect(balance).toBe(1337)
42+
expect(balance).toBe("1337")
4343
})
4444

4545
afterEach(async () => {

0 commit comments

Comments
 (0)