vm/encoding: move bigint from vm to encoding package
This commit is contained in:
parent
783f5ecb01
commit
7ca2807875
16 changed files with 55 additions and 47 deletions
|
@ -3,8 +3,8 @@ package native
|
|||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
|
||||
"github.com/nspcc-dev/neo-go/pkg/io"
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/emit"
|
||||
)
|
||||
|
||||
// MaxValidatorsVoted limits the number of validators that one can vote for.
|
||||
|
@ -42,7 +42,7 @@ func (vc *ValidatorsCount) Bytes() []byte {
|
|||
// EncodeBinary implements io.Serializable interface.
|
||||
func (vc *ValidatorsCount) EncodeBinary(w *io.BinWriter) {
|
||||
for i := range vc {
|
||||
w.WriteVarBytes(emit.IntToBytes(&vc[i]))
|
||||
w.WriteVarBytes(bigint.ToBytes(&vc[i]))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ func (vc *ValidatorsCount) DecodeBinary(r *io.BinReader) {
|
|||
if r.Err != nil {
|
||||
return
|
||||
}
|
||||
vc[i] = *emit.BytesToInt(buf)
|
||||
vc[i] = *bigint.FromBytes(buf)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue