Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthpun committed Feb 3, 2024
1 parent eeab9e7 commit 12bdcfc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
6 changes: 5 additions & 1 deletion cmd/flow-schema/flow-schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ func main() {
os.Exit(1)
}
} else {
os.WriteFile(path, json, 0644)

if err := os.WriteFile(path, json, 0644); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
}

Expand Down
16 changes: 0 additions & 16 deletions gateway/emulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (

"github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/crypto"
flowGo "github.com/onflow/flow-go/model/flow"
"github.com/rs/zerolog"
"google.golang.org/grpc/status"
)
Expand Down Expand Up @@ -255,21 +254,6 @@ func messageToCadenceValue(m []byte) (cadence.Value, error) {
return v, nil
}

func convertBlock(block *flowGo.Block) *flow.Block {
return &flow.Block{
BlockHeader: flow.BlockHeader{
ID: flow.Identifier(block.Header.ID()),
ParentID: flow.Identifier(block.Header.ParentID),
Height: block.Header.Height,
Timestamp: block.Header.Timestamp,
},
BlockPayload: flow.BlockPayload{
CollectionGuarantees: nil,
Seals: nil,
},
}
}

func (g *EmulatorGateway) GetEvents(
eventType string,
startHeight uint64,
Expand Down
3 changes: 2 additions & 1 deletion state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ func generateAliasesComplexProject() State {
func Test_GetContractsByNameSimple(t *testing.T) {
p := generateSimpleProject()
path := filepath.FromSlash("../hungry-kitties/cadence/contracts/NonFungibleToken.cdc")
af.WriteFile(path, []byte("pub contract{}"), os.ModePerm)
err := af.WriteFile(path, []byte("pub contract{}"), os.ModePerm)
require.NoError(t, err)

contracts, err := p.DeploymentContractsByNetwork(config.EmulatorNetwork)
require.NoError(t, err)
Expand Down
7 changes: 5 additions & 2 deletions tests/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,15 @@ var testnet = config.TestnetNetwork.Name
func Test_Foo(t *testing.T) {
_, st, _, rw, _ := initTestnet(t)

rw.WriteFile("test", []byte("foo"), 0644)
err := rw.WriteFile("test", []byte("foo"), 0644)
require.NoError(t, err)

out, _ := rw.ReadFile("test")
assert.Equal(t, out, []byte("foo"))

rw.WriteFile("test", []byte("bar"), 0644)
err = rw.WriteFile("test", []byte("bar"), 0644)
require.NoError(t, err)

out, _ = st.ReadFile("test")
assert.Equal(t, out, []byte("bar"))
}
Expand Down

0 comments on commit 12bdcfc

Please sign in to comment.