neoneo-go/pkg/core/native/native_neo_test.go
Roman Khimov aab18c3083 stackitem: introduce Convertible interface
We have a lot of native contract types that are converted to stack items
before serialization, then deserialized as stack items and converted back to
regular structures. stackitem.Convertible allows to remove a lot of repetitive
io.Serializable code.

This also introduces to/from converter in testserdes which unfortunately
required to change util tests to avoid circular references.
2021-07-19 15:42:42 +03:00

17 lines
302 B
Go

package native
import (
"math/big"
"testing"
"github.com/nspcc-dev/neo-go/internal/testserdes"
)
func TestCandidate_Bytes(t *testing.T) {
expected := &candidate{
Registered: true,
Votes: *big.NewInt(0x0F),
}
actual := new(candidate)
testserdes.ToFromStackItem(t, expected, actual)
}