Skip to content

Commit

Permalink
Merge branch 'main' into feature/stable-cadence
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthpun committed Feb 3, 2024
2 parents 8a8e94c + 12bdcfc commit 9034844
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 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: 1 addition & 2 deletions state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,14 @@ import (
"sort"
"testing"

"github.com/onflow/flowkit/v2/accounts"

"github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/crypto"
"github.com/spf13/afero"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thoas/go-funk"

"github.com/onflow/flowkit/v2/accounts"
"github.com/onflow/flowkit/v2/config"
"github.com/onflow/flowkit/v2/config/json"
"github.com/onflow/flowkit/v2/project"
Expand Down
7 changes: 5 additions & 2 deletions tests/testnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,15 @@ 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 9034844

Please sign in to comment.