Skip to content

Commit 816ae53

Browse files
authored
Merge branch 'onflow:feature/stable-cadence' into feature/stable-cadence
2 parents 3f3d8d3 + a51729a commit 816ae53

File tree

7 files changed

+30
-10
lines changed

7 files changed

+30
-10
lines changed

.changeset/late-trees-ring.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@onflow/flow-js-testing": patch
3+
---
4+
5+
Use `view` functions in FlowManager

.changeset/pre.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
},
77
"changesets": [
88
"blue-pots-add",
9-
"brave-feet-greet"
9+
"brave-feet-greet",
10+
"late-trees-ring",
11+
"tidy-coats-tickle"
1012
]
1113
}

.changeset/tidy-coats-tickle.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@onflow/flow-js-testing": patch
3+
---
4+
5+
Fix shorthand imports

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# flow-js-testing
22

3+
## 0.6.0-stable-cadence.2
4+
5+
### Patch Changes
6+
7+
- [#228](https://github.com/onflow/flow-js-testing/pull/228) [`1d66db1`](https://github.com/onflow/flow-js-testing/commit/1d66db1fadaca17624f28429edb7d76c428c6984) Thanks [@jribbink](https://github.com/jribbink)! - Use `view` functions in FlowManager
8+
9+
* [#229](https://github.com/onflow/flow-js-testing/pull/229) [`6a11947`](https://github.com/onflow/flow-js-testing/commit/6a11947171e7ba213624b5155dd8bb9c4ae49092) Thanks [@github-actions](https://github.com/apps/github-actions)! - Fix shorthand imports
10+
311
## 0.6.0-stable-cadence.1
412

513
### Patch Changes

cadence/contracts/FlowManager.cdc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ access(all) contract FlowManager {
66
access(all) struct Mapper {
77
access(all) let accounts: {String: Address}
88

9-
access(all) fun getAddress(_ name: String): Address? {
9+
access(all) view fun getAddress(_ name: String): Address? {
1010
return self.accounts[name]
1111
}
1212

@@ -20,7 +20,7 @@ access(all) contract FlowManager {
2020
}
2121
}
2222

23-
access(all) fun getAccountAddress(_ name: String): Address?{
23+
access(all) view fun getAccountAddress(_ name: String): Address?{
2424
let accountManager = self.account
2525
.capabilities.borrow<&FlowManager.Mapper>(self.accountManagerPath)!
2626

@@ -67,12 +67,12 @@ access(all) contract FlowManager {
6767
emit FlowManager.TimestampOffsetChanged(offset: offset)
6868
}
6969

70-
access(all) fun getBlockHeight(): UInt64 {
70+
access(all) view fun getBlockHeight(): UInt64 {
7171
var block = getCurrentBlock()
7272
return block.height + self.blockOffset
7373
}
7474

75-
access(all) fun getBlockTimestamp(): UFix64 {
75+
access(all) view fun getBlockTimestamp(): UFix64 {
7676
var block = getCurrentBlock()
7777
return block.timestamp + self.timestampOffset
7878
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@onflow/flow-js-testing",
3-
"version": "0.6.0-stable-cadence.1",
3+
"version": "0.6.0-stable-cadence.2",
44
"description": "This package will expose a set of utility methods, to allow Cadence code testing with libraries like Jest",
55
"repository": {
66
"type": "git",

src/generated/contracts/FlowManager.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ access(all) contract FlowManager {
1717
access(all) struct Mapper {
1818
access(all) let accounts: {String: Address}
1919
20-
access(all) fun getAddress(_ name: String): Address? {
20+
access(all) view fun getAddress(_ name: String): Address? {
2121
return self.accounts[name]
2222
}
2323
@@ -31,7 +31,7 @@ access(all) contract FlowManager {
3131
}
3232
}
3333
34-
access(all) fun getAccountAddress(_ name: String): Address?{
34+
access(all) view fun getAccountAddress(_ name: String): Address?{
3535
let accountManager = self.account
3636
.capabilities.borrow<&FlowManager.Mapper>(self.accountManagerPath)!
3737
@@ -78,12 +78,12 @@ access(all) contract FlowManager {
7878
emit FlowManager.TimestampOffsetChanged(offset: offset)
7979
}
8080
81-
access(all) fun getBlockHeight(): UInt64 {
81+
access(all) view fun getBlockHeight(): UInt64 {
8282
var block = getCurrentBlock()
8383
return block.height + self.blockOffset
8484
}
8585
86-
access(all) fun getBlockTimestamp(): UFix64 {
86+
access(all) view fun getBlockTimestamp(): UFix64 {
8787
var block = getCurrentBlock()
8888
return block.timestamp + self.timestampOffset
8989
}

0 commit comments

Comments
 (0)