forked from TrueCloudLab/frostfs-node
Initial commit
Initial public review release v0.10.0
This commit is contained in:
commit
dadfd90dcd
276 changed files with 46331 additions and 0 deletions
33
lib/blockchain/goclient/client_test.go
Normal file
33
lib/blockchain/goclient/client_test.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package goclient
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
sc "github.com/nspcc-dev/neo-go/pkg/smartcontract"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestToStackParameter(t *testing.T) {
|
||||
items := []struct {
|
||||
value interface{}
|
||||
expType sc.ParamType
|
||||
}{
|
||||
{
|
||||
value: []byte{1, 2, 3},
|
||||
expType: sc.ByteArrayType,
|
||||
},
|
||||
{
|
||||
value: int64(100),
|
||||
expType: sc.IntegerType,
|
||||
},
|
||||
}
|
||||
|
||||
for _, item := range items {
|
||||
t.Run(item.expType.String()+" to stack parameter", func(t *testing.T) {
|
||||
res, err := toStackParameter(item.value)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, item.expType, res.Type)
|
||||
require.Equal(t, item.value, res.Value)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue