Skip to content

Commit 4a9b777

Browse files
authored
update to stable cadence flowkit and fix tests (#137)
* update to stable cadence flowkit and fix tests * tidy * removed restricted types and fixed tests * started updating overflow to new stable cadence * fixed remaining errors * added AuthorizerTypes to OverflowResult * update to stable-cadence.3 * add error message if you are creating account with a configured address and another one is created * fixed tests with some TODOs regarding computation (#147) * fixed tests with some TODOs regarding computation * bump to latest version of stable-cadence * fix: fix filtering out so we do not filter out NFT events * filter out temp events * added propper Authorizers to bot transactions parsed and send in * try to give better error message when a transaction fails, include the filename * added require versions of assert failure and success * feat: implemented custom options to a tx to assert events and failure/success using builder methods * fix: added helper to change an EventAssertion with replacing a field * feat: update to new cli version * fix: update to new flowkit * fix: fixed tests * add raw event to OverflowEvent * merge main and fix tests * use underflow (#155) * use underflow * allow setting underflow option and use that. breaks a bit of bc * use new version of underflow * tidy * migrate to v2, fix warnigns
1 parent 6e86330 commit 4a9b777

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+5692
-4865
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.PHONY: coveralls cover install-gotestsum test-report
22

33
coveralls:
4-
go test --timeout 120s -coverprofile=profile.cov -covermode=atomic -coverpkg=github.com/bjartek/overflow -v ./...
4+
go test --timeout 120s -coverprofile=profile.cov -covermode=atomic -coverpkg=github.com/bjartek/overflow/v2 -v ./...
55

66
cover: coveralls
77
go tool cover -html=profile.cov

README.md

+8-12
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Overflow
44

5+
This is the v2 version of overflow to be used with cadence 1.0, for the v1 version that targets 0.x look in the v1 branch.
6+
57
A DSL written in golang to be used in tests or to run a `story` of interactions against either an local emulator, testnet, mainnet or an in memory instance of the flow-emulator.
68

79
Use case scenarios include:
@@ -46,7 +48,7 @@ First create a project directory, initialize the go module and install `overflow
4648
mkdir test-overflow && cd test-overflow
4749
flow init
4850
go mod init example.com/test-overflow
49-
go get github.com/bjartek/overflow
51+
go get github.com/bjartek/overflow/v2
5052
```
5153

5254
Then create a task file:
@@ -64,7 +66,7 @@ import (
6466
"fmt"
6567

6668
//if you imports this with . you do not have to repeat overflow everywhere
67-
. "github.com/bjartek/overflow"
69+
. "github.com/bjartek/overflow/v2"
6870
)
6971

7072
func main() {
@@ -95,18 +97,12 @@ The following env vars are supported
9597
- OVERFLOW_LOGGING: Set this to 0-4 to get increasing log
9698

9799

98-
## Migrating from v0 api
100+
## Migrating from v1 api
101+
102+
You need to change your imports to be v2 and not v1
99103

100-
Please note the following if you migrate from an earlier version of overflow that was not tagged
101-
- "github.com/bjartek/overflow/overflow" -> "github.com/bjartek/overflow"
102-
- overflow.Overflow -> overflow.OverflowState
103-
- on OverflowState Script -> InlineScript
104-
- FlowTransationBuilder -> OverflowInteractionBuilder
105-
- FlowArgumentsBuilder -> OverflowArgumentsBuilder
106-
- Discord dependency is gone, if you need the code ask
107-
- almost all of the v0 is deprecated in favor of the functional builders `Overflow` to set up the client and , `Tx`, `Script`, `FetchEvents` to interact with it
108-
109104
## Credits
110105

111106
This project is the successor of https://github.com/bjartek/go-with-the-flow
112107
The v0 version of the code with a set of apis that is now deprecated is in https://github.com/bjartek/overflow/tree/v0
108+
The v1 version of the code with a set of apis that is now deprecated is in https://github.com/bjartek/overflow/tree/v1

account_test.go

-73
Original file line numberDiff line numberDiff line change
@@ -62,76 +62,3 @@ func TestGetAccount(t *testing.T) {
6262

6363
})
6464
}
65-
66-
/*
67-
func TestCheckContractUpdate(t *testing.T) {
68-
69-
t.Run("Should return the updatable contracts", func(t *testing.T) {
70-
71-
g, err := OverflowTesting()
72-
require.NoError(t, err)
73-
res, err := g.CheckContractUpdates()
74-
75-
assert.Nil(t, err)
76-
autogold.Equal(t, res)
77-
})
78-
79-
t.Run("Should return the updatable contracts (updatable)", func(t *testing.T) {
80-
g, err := OverflowTesting()
81-
require.NoError(t, err)
82-
83-
code := []byte(`pub contract Debug{
84-
85-
pub struct FooListBar {
86-
pub let foo:[Foo2]
87-
pub let bar:String
88-
89-
init(foo:[Foo2], bar:String) {
90-
self.foo=foo
91-
self.bar=bar
92-
}
93-
}
94-
95-
pub struct Foo2{
96-
pub let bar: Address
97-
98-
init(bar: Address) {
99-
self.bar=bar
100-
}
101-
}
102-
pub struct FooBar {
103-
pub let foo:Foo
104-
pub let bar:String
105-
106-
init(foo:Foo, bar:String) {
107-
self.foo=foo
108-
self.bar=bar
109-
}
110-
}
111-
112-
pub struct Foo{
113-
pub let bar: String
114-
115-
init(bar: String) {
116-
self.bar=bar
117-
}
118-
}
119-
120-
pub event Log(msg: String)
121-
pub event LogNum(id: UInt64)
122-
123-
pub fun haha(){}
124-
}`)
125-
126-
contract := flowkit.NewScript(code, []cadence.Value{}, "Debug")
127-
128-
err = g.AddContract("account", contract, true)
129-
assert.Nil(t, err)
130-
res, err := g.CheckContractUpdates()
131-
132-
assert.Nil(t, err)
133-
autogold.Equal(t, res)
134-
})
135-
136-
}
137-
*/

0 commit comments

Comments
 (0)