Skip to content

Commit

Permalink
Merge pull request #26 from onflow/jribbink/merge-master
Browse files Browse the repository at this point in the history
Merge `main` into `feature/stable-cadence`
  • Loading branch information
jribbink authored Mar 8, 2024
2 parents 5993bf1 + 6361223 commit 9dc859e
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 26 deletions.
4 changes: 4 additions & 0 deletions flowkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ func (f *Flowkit) Ping() error {
return f.gateway.Ping()
}

func (f *Flowkit) WaitServer(ctx context.Context) error {
return f.gateway.WaitServer(ctx)
}

// GetAccount fetches account on the Flow network.
func (f *Flowkit) GetAccount(ctx context.Context, address flow.Address) (*flow.Account, error) {
return f.gateway.GetAccount(ctx, address)
Expand Down
8 changes: 4 additions & 4 deletions flowkit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,22 +353,22 @@ func TestAccountsCreate_Integration(t *testing.T) {
}}

accOut := []accountsOut{{
address: "01cf0e2f2f715450",
address: "179b6b1cb6755e31",
balance: uint64(100000),
pubKeys: []crypto.PublicKey{
tests.PubKeys()[0],
},
weights: []int{flow.AccountKeyWeightThreshold},
}, {
address: "179b6b1cb6755e31",
address: "f3fcd2c1a78f5eee",
balance: uint64(100000),
pubKeys: []crypto.PublicKey{
tests.PubKeys()[0],
tests.PubKeys()[1],
},
weights: []int{500, 500},
}, {
address: "f3fcd2c1a78f5eee",
address: "e03daebed8ca0615",
balance: uint64(100000),
pubKeys: []crypto.PublicKey{
tests.PubKeys()[0],
Expand Down Expand Up @@ -1917,7 +1917,7 @@ func TestTransactions_Integration(t *testing.T) {
a,
[]byte(fmt.Sprintf("%x", tx.FlowTransaction().Encode())),
)
assert.EqualError(t, err, "not a valid signer 179b6b1cb6755e31, proposer: 01cf0e2f2f715450, payer: 01cf0e2f2f715450, authorizers: [01cf0e2f2f715450]")
assert.EqualError(t, err, "not a valid signer f3fcd2c1a78f5eee, proposer: 179b6b1cb6755e31, payer: 179b6b1cb6755e31, authorizers: [179b6b1cb6755e31]")
assert.Nil(t, txSigned)
})

Expand Down
4 changes: 4 additions & 0 deletions gateway/emulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ func (g *EmulatorGateway) Ping() error {
return nil
}

func (g *EmulatorGateway) WaitServer(ctx context.Context) error {
return nil
}

type scriptQuery struct {
id flow.Identifier
height uint64
Expand Down
1 change: 1 addition & 0 deletions gateway/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ type Gateway interface {
GetCollection(context.Context, flow.Identifier) (*flow.Collection, error)
GetLatestProtocolStateSnapshot(context.Context) ([]byte, error)
Ping() error
WaitServer(context.Context) error
SecureConnection() bool
}
4 changes: 4 additions & 0 deletions gateway/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,10 @@ func (g *GrpcGateway) Ping() error {
return g.client.Ping(ctx)
}

func (g *GrpcGateway) WaitServer(ctx context.Context) error {
return g.client.WaitServer(ctx)
}

// SecureConnection is used to log warning if a service should be using a secure client but is not
func (g *GrpcGateway) SecureConnection() bool {
return g.secureClient
Expand Down
18 changes: 18 additions & 0 deletions gateway/mocks/Gateway.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 10 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ require (
github.com/gosuri/uilive v0.0.4
github.com/invopop/jsonschema v0.7.0
github.com/lmars/go-slip10 v0.0.0-20190606092855-400ba44fee12
github.com/onflow/cadence v1.0.0-M8
github.com/onflow/cadence v1.0.0-M9
github.com/onflow/crypto v0.25.0
github.com/onflow/flow-emulator v1.0.0-M7
github.com/onflow/flow-go v0.34.0-crescendo-preview.1.0.20240222213538-3677206d445c
github.com/onflow/flow-go-sdk v1.0.0-M5
github.com/onflow/flow-emulator v1.0.0-M9
github.com/onflow/flow-go v0.34.0-crescendo-preview.5.0.20240306205059-e1f7a7962a39
github.com/onflow/flow-go-sdk v1.0.0-M8
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.29.0
github.com/spf13/afero v1.10.0
Expand Down Expand Up @@ -136,10 +136,12 @@ require (
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 // indirect
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240305214031-d81e0c3b42f3 // indirect
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240305214031-d81e0c3b42f3 // indirect
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240305212555-29d91e18f0c1 // indirect
github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240305212555-29d91e18f0c1 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240305213046-9026973838d7 // indirect
github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240305213046-9026973838d7 // indirect
github.com/onflow/flow/protobuf/go/flow v0.3.7 // indirect
github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
Expand Down
36 changes: 22 additions & 14 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1842,25 +1842,33 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6
github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f h1:Z8/PgTqOgOg02MTRpTBYO2k16FE6z4wEOtaC2WBR9Xo=
github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM=
github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
github.com/onflow/cadence v1.0.0-M8 h1:ioQ7TyhpsIaImAC7Xn2r8kIgIBdimvyuWeKlGfRxWB8=
github.com/onflow/cadence v1.0.0-M8/go.mod h1:a4mccDU90hmuxCLUFzs9J/ANG/rYbFa36h4Z0bBAqNU=
github.com/onflow/cadence v1.0.0-M9 h1:hYqh6iok2X+QEyAlvoEY1k57EV7Yt8+Iz5+lGvjey3o=
github.com/onflow/cadence v1.0.0-M9/go.mod h1:a4mccDU90hmuxCLUFzs9J/ANG/rYbFa36h4Z0bBAqNU=
github.com/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 h1:OI/4F2NK/X/4x3dTUFFDGtuOsSa9pX+jjBeSEcBrY/M=
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:GK+Ik1K3L3v8xmHmRQv5yxJz81lYhdYSNm0PQ63Xrws=
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 h1:WAx8ftVz1BeXiKvQ9gLKEf1J3NBWK26Pbczd0iH4C6I=
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg=
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240305214031-d81e0c3b42f3 h1:UNLms46HthnzKTR3DVQmEoDerf4EtNUMfkombIeT3U8=
github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240305214031-d81e0c3b42f3/go.mod h1:ROB3X1QhobsVj3ZqSn8fy8gX2pXL8tHNUC+jZUCWpnA=
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240305214031-d81e0c3b42f3 h1:svq9+OKnCdIm6ePR6i/laXtg5kP7XHGsHUpsYevPIJ4=
github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240305214031-d81e0c3b42f3/go.mod h1:Ka6dexQbB/5R64cpfA9KZQ7V0pqqHNS5T3G3wftaQVw=
github.com/onflow/flow-emulator v1.0.0-M7 h1:8moFcl+KNAU1YOnEJim+x1pUGA5IRdfcBPgDbZkAels=
github.com/onflow/flow-emulator v1.0.0-M7/go.mod h1:S611ccJDDFLC99+VIAL8slsJx5Y9rxljFCY1aS67okU=
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 h1:u6/YcUvO8jU0f3Evb/6agzXqeOo+VbL2a3mmj/5ifRs=
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
github.com/onflow/flow-go v0.34.0-crescendo-preview.1.0.20240222213538-3677206d445c h1:G3xZCm3FnckxGVTcgxUUTzrreYy3LxjsQl3PApbO1bc=
github.com/onflow/flow-go v0.34.0-crescendo-preview.1.0.20240222213538-3677206d445c/go.mod h1:bvwbHFWiPGkASyJ+ZdSp7mZAOCqpSlCtza9JeKSmfEE=
github.com/onflow/flow-emulator v1.0.0-M8.0.20240307180807-a925945f105a h1:PQEGEhNk8Ljd5MvbwkQZx2iBC07oGGt7g0WjVIR50HM=
github.com/onflow/flow-emulator v1.0.0-M8.0.20240307180807-a925945f105a/go.mod h1:v5EgKPYjt28xJSVX9aDtcF+4Y0JQoJea6xJXICHfSFQ=
github.com/onflow/flow-emulator v1.0.0-M9 h1:FGg3KhTIPa7ih2oCtKMyfNcU5+cWqyyy0TtSusciAQE=
github.com/onflow/flow-emulator v1.0.0-M9/go.mod h1:v5EgKPYjt28xJSVX9aDtcF+4Y0JQoJea6xJXICHfSFQ=
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240305212555-29d91e18f0c1 h1:1hTH+Y8EB8BZ0hXsrxZqSTDWoY0euFT/IzXxlgVQok4=
github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240305212555-29d91e18f0c1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240305212555-29d91e18f0c1 h1:7BkqJ21EQAbYCZqLj2xCIqJvhrHNCXe9BfLTEiQqIx0=
github.com/onflow/flow-ft/lib/go/templates v0.7.1-0.20240305212555-29d91e18f0c1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go v0.34.0-crescendo-preview.5.0.20240306205059-e1f7a7962a39 h1:Bi62e7j8zy7zolWlV3fePIwfJea02YS/kZWSBA2W4g4=
github.com/onflow/flow-go v0.34.0-crescendo-preview.5.0.20240306205059-e1f7a7962a39/go.mod h1:H4tb2h7sSocTTi8wgwLiWBWkGl61JJYKH4k9PMP3f0E=
github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo=
github.com/onflow/flow-go-sdk v1.0.0-M5 h1:R86DQQfXS3z8O6AShAaUNbkPOM7lOwcTk06cofdVEsk=
github.com/onflow/flow-go-sdk v1.0.0-M5/go.mod h1:aXSavLzoRlz5FiMjcI7p5QhihWScGctxydzf4dv/avo=
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 h1:/2vvjKkWG/3cKP3IpgiGNqXi0yskn4GmNTjmeCwMoz8=
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE=
github.com/onflow/flow-go-sdk v1.0.0-M8 h1:jnWA6X29sZlMsrIjdxoEkBAJsZBazXTcQJ/wPw1ZbfU=
github.com/onflow/flow-go-sdk v1.0.0-M8/go.mod h1:qFy2LF0DKfYsEnyEaIxD0frA/zAMc5hURbnqTrSZBjA=
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240305213046-9026973838d7 h1:0/s3DzQp3JHWuuz3DpGwniFShtgEy3wq1uBB+4uOG1I=
github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240305213046-9026973838d7/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE=
github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240305213046-9026973838d7 h1:VU294Tk/Ra/UuuJbArLILA+x+4qX5qGPTY/kokNKyA4=
github.com/onflow/flow-nft/lib/go/templates v0.0.0-20240305213046-9026973838d7/go.mod h1:p+2hRvtjLUR3MW1NsoJe5Gqgr2eeH49QB6+s6ze00w0=
github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
github.com/onflow/flow/protobuf/go/flow v0.3.7 h1:+6sBdlE/u4ZMTVB9U1lA6Xn2Bd48lOOX96Bv9dNubsk=
github.com/onflow/flow/protobuf/go/flow v0.3.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
Expand Down
19 changes: 19 additions & 0 deletions mocks/Services.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions services.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
type Services interface {
Network() config.Network
Ping() error
WaitServer(context.Context) error
Gateway() gateway.Gateway
SetLogger(output.Logger)

Expand Down

0 comments on commit 9dc859e

Please sign in to comment.