Skip to content

Commit

Permalink
improve argument construction
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent committed Sep 22, 2023
1 parent 9fe5672 commit d64aaf1
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions fvm/flex/flex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ func TestFlexAddressConstructionAndReturn(t *testing.T) {
cadence.UInt8(10), cadence.UInt8(10),
}

bytesType := cadence.NewConstantSizedArrayType(20, cadence.TheUInt8Type)

runtimeInterface := &testRuntimeInterface{
storage: led,
decodeArgument: func(b []byte, t cadence.Type) (cadence.Value, error) {
Expand All @@ -87,12 +89,7 @@ func TestFlexAddressConstructionAndReturn(t *testing.T) {
runtime.Script{
Source: script,
Arguments: encodeArgs([]cadence.Value{
cadence.Array{
ArrayType: &cadence.VariableSizedArrayType{
ElementType: cadence.UInt8Type{},
},
Values: input,
},
cadence.NewArray(input).WithType(bytesType),
}),
},
runtime.Context{
Expand All @@ -103,8 +100,6 @@ func TestFlexAddressConstructionAndReturn(t *testing.T) {
)
require.NoError(t, err)

bytesType := cadence.NewConstantSizedArrayType(20, cadence.TheUInt8Type)

assert.Equal(t,
cadence.Struct{
StructType: cadence.NewStructType(
Expand Down

0 comments on commit d64aaf1

Please sign in to comment.