Refactor ZKInputs & add struct initialization

Refactor ZKInputs & add struct initialization & add BJJCompressedTo256BigInts util
This commit is contained in:
arnaucube
2020-09-08 18:41:32 +02:00
parent 230adfeb73
commit a7fe80f150
5 changed files with 319 additions and 100 deletions

View File

@@ -2,6 +2,7 @@ package common
import (
"encoding/binary"
"math/big"
"time"
ethCommon "github.com/ethereum/go-ethereum/common"
@@ -34,3 +35,8 @@ func (t TokenID) Bytes() []byte {
binary.LittleEndian.PutUint32(tokenIDBytes[:], uint32(t))
return tokenIDBytes[:]
}
// BigInt returns the *big.Int representation of the TokenID
func (t TokenID) BigInt() *big.Int {
return big.NewInt(int64(t))
}