mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
StateDB ZKInputs generation compatible with circom
- Add SignatureConstant to L1Tx.TxCompressedData
- ZKInputs generation works initial version working and compatible with circom Hermez circuit
- Lots of small updates for circuits compatibility
- Update version (with new changes) of `go-iden3-crypto` & `go-merkletree`
This commit is contained in:
@@ -167,8 +167,9 @@ func (tx L1Tx) TxCompressedData() (*big.Int, error) {
|
||||
if err != nil {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
|
||||
var b [31]byte
|
||||
// b[0:7] empty: no fee neither nonce
|
||||
// b[0:7] empty: no ToBJJSign, no fee, no nonce
|
||||
copy(b[7:11], tx.TokenID.Bytes())
|
||||
copy(b[11:13], amountFloat16.Bytes())
|
||||
toIdxBytes, err := tx.ToIdx.Bytes()
|
||||
@@ -181,8 +182,8 @@ func (tx L1Tx) TxCompressedData() (*big.Int, error) {
|
||||
return nil, tracerr.Wrap(err)
|
||||
}
|
||||
copy(b[19:25], fromIdxBytes[:])
|
||||
copy(b[25:27], []byte{0, 1}) // TODO this will be generated by the ChainID config parameter
|
||||
// b[27:] empty: no signature
|
||||
copy(b[25:27], []byte{0, 0}) // TODO this will be generated by the ChainID config parameter
|
||||
copy(b[27:31], SignatureConstantBytes[:])
|
||||
|
||||
bi := new(big.Int).SetBytes(b[:])
|
||||
return bi, nil
|
||||
|
||||
Reference in New Issue
Block a user