forked from TrueCloudLab/neoneo-go
9bc731b3b1
Close #867.
18 lines
319 B
Go
18 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)
|
|
}
|