vm: implement BigInteger item serialization
This commit is contained in:
parent
25f77257ce
commit
cd690803cf
4 changed files with 28 additions and 4 deletions
|
@ -6,6 +6,8 @@ import (
|
|||
"fmt"
|
||||
"math/big"
|
||||
"reflect"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/util"
|
||||
)
|
||||
|
||||
// A StackItem represents the "real" value that is pushed on the stack.
|
||||
|
@ -131,6 +133,11 @@ func NewBigIntegerItem(value int) *BigIntegerItem {
|
|||
}
|
||||
}
|
||||
|
||||
// Bytes converts i to a slice of bytes.
|
||||
func (i *BigIntegerItem) Bytes() []byte {
|
||||
return util.ArrayReverse(i.value.Bytes())
|
||||
}
|
||||
|
||||
// Value implements StackItem interface.
|
||||
func (i *BigIntegerItem) Value() interface{} {
|
||||
return i.value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue