Skip to content

Commit 25dcab0

Browse files
author
j pimmel
authored
Merge pull request #447 from nozim/update-examples
update SDK usage examples
2 parents 32654fd + c99e3dd commit 25dcab0

26 files changed

Lines changed: 609 additions & 280 deletions

File tree

access/client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import (
2727
"context"
2828

2929
"github.com/onflow/cadence"
30+
3031
"github.com/onflow/flow-go-sdk"
3132
)
3233

access/grpc/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ import (
3131
"google.golang.org/grpc"
3232

3333
"github.com/onflow/cadence"
34-
"github.com/onflow/flow-go-sdk"
3534
"google.golang.org/grpc/credentials/insecure"
35+
36+
"github.com/onflow/flow-go-sdk"
3637
)
3738

3839
const EmulatorHost = "127.0.0.1:3569"

access/grpc/grpc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@
1818

1919
package grpc
2020

21-
//go:generate go run github.com/vektra/mockery/cmd/mockery --name RPCClient --filename mock_client_test.go --inpkg
21+
//go:generate go run github.com/vektra/mockery/cmd/mockery --name RPCClient --structname MockRPCClient --output mocks
2222

2323
import (
2424
"context"
2525

26+
"google.golang.org/grpc"
27+
2628
"github.com/onflow/cadence"
2729
"github.com/onflow/cadence/encoding/json"
2830
"github.com/onflow/flow/protobuf/go/flow/access"
29-
"google.golang.org/grpc"
3031

3132
"github.com/onflow/flow-go-sdk"
3233
)

access/grpc/grpc_test.go

Lines changed: 62 additions & 59 deletions
Large diffs are not rendered by default.
Lines changed: 64 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

access/http/http.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
package http
2020

21-
//go:generate go run github.com/vektra/mockery/cmd/mockery --name handler --filename handler_mock_test.go --inpkg
21+
//go:generate go run github.com/vektra/mockery/cmd/mockery --name handler --structname mockHandler --filename=mock_handler.go --inpkg
2222

2323
import (
2424
"context"
@@ -31,8 +31,9 @@ import (
3131
"github.com/onflow/flow-go-sdk"
3232
"github.com/onflow/flow-go-sdk/access/http/models"
3333

34-
"github.com/onflow/cadence"
3534
"github.com/pkg/errors"
35+
36+
"github.com/onflow/cadence"
3637
)
3738

3839
// handler interface defines methods needed to be offered by a specific http network implementation.

account_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323
"fmt"
2424
"testing"
2525

26-
"github.com/onflow/flow-go-sdk/crypto"
2726
"github.com/stretchr/testify/assert"
27+
28+
"github.com/onflow/flow-go-sdk/crypto"
2829
)
2930

3031
func generateKey() crypto.PrivateKey {

client/client.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
package client
2323

2424
import (
25+
"github.com/onflow/flow/protobuf/go/flow/access"
26+
2527
"github.com/onflow/flow-go-sdk"
2628
"github.com/onflow/flow-go-sdk/access/grpc"
27-
"github.com/onflow/flow/protobuf/go/flow/access"
2829
)
2930

3031
// New creates an gRPC client exposing all the common access APIs.

crypto/awskms/awskms.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/aws/aws-sdk-go-v2/aws"
3232
kms "github.com/aws/aws-sdk-go-v2/service/kms"
3333
"github.com/aws/aws-sdk-go-v2/service/kms/types"
34+
3435
"github.com/onflow/flow-go-sdk/crypto"
3536
)
3637

0 commit comments

Comments
 (0)