mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
Add PoolL2Tx verify signature needed methods
Implements the hash to be signed from PoolL2Tx, compatible with javascript version. Implements the signature verification for a given PoolL2Tx.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
ethCommon "github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
// SwapEndianness swaps the order of the bytes in the slice.
|
||||
func SwapEndianness(b []byte) []byte {
|
||||
o := make([]byte, len(b))
|
||||
@@ -8,3 +14,8 @@ func SwapEndianness(b []byte) []byte {
|
||||
}
|
||||
return o
|
||||
}
|
||||
|
||||
// EthAddrToBigInt returns a *big.Int from a given ethereum common.Address.
|
||||
func EthAddrToBigInt(a ethCommon.Address) *big.Int {
|
||||
return new(big.Int).SetBytes(a.Bytes())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user