mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 19:36:44 +01:00
Add HashGlobalInputs for ZKInputs
Add HashGlobalInputs for ZKInputs compatible with js & circom circuits version.
Compatible with hermeznetwork/commonjs at version: c6a1448db5bae4cda839ce36c1f35d8defccc9cd
(c6a1448db5)
This commit is contained in:
@@ -153,9 +153,11 @@ func (tx L1Tx) Tx() Tx {
|
||||
func (tx *L1Tx) BytesGeneric() ([]byte, error) {
|
||||
var b [L1UserTxBytesLen]byte
|
||||
copy(b[0:20], tx.FromEthAddr.Bytes())
|
||||
pkCompL := tx.FromBJJ.Compress()
|
||||
pkCompB := SwapEndianness(pkCompL[:])
|
||||
copy(b[20:52], pkCompB[:])
|
||||
if tx.FromBJJ != nil {
|
||||
pkCompL := tx.FromBJJ.Compress()
|
||||
pkCompB := SwapEndianness(pkCompL[:])
|
||||
copy(b[20:52], pkCompB[:])
|
||||
}
|
||||
fromIdxBytes, err := tx.FromIdx.Bytes()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user