mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-27 03:58:06 +00:00
19 lines
319 B
Go
19 lines
319 B
Go
|
package native
|
||
|
|
||
|
import (
|
||
|
"math/big"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/require"
|
||
|
)
|
||
|
|
||
|
func TestCandidate_Bytes(t *testing.T) {
|
||
|
expected := &candidate{
|
||
|
Registered: true,
|
||
|
Votes: *big.NewInt(0x0F),
|
||
|
}
|
||
|
data := expected.Bytes()
|
||
|
actual := new(candidate).FromBytes(data)
|
||
|
require.Equal(t, expected, actual)
|
||
|
}
|