mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-03 01:41:48 +00:00
vm: implement BigInteger item serialization
This commit is contained in:
parent
25f77257ce
commit
cd690803cf
4 changed files with 28 additions and 4 deletions
|
@ -245,6 +245,17 @@ func TestSerializeByteArray(t *testing.T) {
|
|||
require.Equal(t, value, vm.estack.Top().Bytes())
|
||||
}
|
||||
|
||||
func TestSerializeInteger(t *testing.T) {
|
||||
vm := load(getSerializeProg())
|
||||
value := int64(123)
|
||||
vm.estack.PushVal(value)
|
||||
|
||||
testSerialize(t, vm)
|
||||
|
||||
require.IsType(t, (*BigIntegerItem)(nil), vm.estack.Top().value)
|
||||
require.Equal(t, value, vm.estack.Top().BigInt().Int64())
|
||||
}
|
||||
|
||||
func callNTimes(n uint16) []byte {
|
||||
return makeProgram(
|
||||
PUSHBYTES2, Instruction(n), Instruction(n>>8), // little-endian
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue