Skip to content

Commit

Permalink
Merge pull request #23 from onflow/chasefleming/wait-server
Browse files Browse the repository at this point in the history
Add WaitServer
  • Loading branch information
chasefleming authored Mar 5, 2024
2 parents 3cee43b + fbde0f8 commit c2271d7
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1 deletion.
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
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.

19 changes: 18 additions & 1 deletion 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 c2271d7

Please sign in to comment.