mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Update Account.PublicKey to Account.BJJ
Update account.PublicKey to account.BJJ for naming consistency with the rest of the code
This commit is contained in:
@@ -45,7 +45,7 @@ func genTestAccounts(accounts []common.Account, tokens []historydb.TokenWithUSD)
|
||||
tAccount := testAccount{
|
||||
ItemID: uint64(x + 1),
|
||||
Idx: apitypes.HezIdx(idxToHez(account.Idx, token.Symbol)),
|
||||
PublicKey: apitypes.NewHezBJJ(account.PublicKey),
|
||||
PublicKey: apitypes.NewHezBJJ(account.BJJ),
|
||||
EthAddr: apitypes.NewHezEthAddr(account.EthAddr),
|
||||
Nonce: account.Nonce,
|
||||
Balance: apitypes.NewBigIntStr(account.Balance),
|
||||
|
||||
@@ -73,7 +73,7 @@ func genTestExits(
|
||||
allExits = append(allExits, testExit{
|
||||
BatchNum: exit.BatchNum,
|
||||
AccountIdx: idxToHez(exit.AccountIdx, token.Symbol),
|
||||
BJJ: apitypes.NewHezBJJ(acc.PublicKey),
|
||||
BJJ: apitypes.NewHezBJJ(acc.BJJ),
|
||||
EthAddr: apitypes.NewHezEthAddr(acc.EthAddr),
|
||||
MerkleProof: testCVP{
|
||||
Root: exit.MerkleProof.Root.String(),
|
||||
|
||||
@@ -153,7 +153,7 @@ func genTestTxs(
|
||||
if l1.ToIdx == acc.Idx {
|
||||
toEthAddr := string(apitypes.NewHezEthAddr(acc.EthAddr))
|
||||
tx.ToEthAddr = &toEthAddr
|
||||
toBJJ := string(apitypes.NewHezBJJ(acc.PublicKey))
|
||||
toBJJ := string(apitypes.NewHezBJJ(acc.BJJ))
|
||||
tx.ToBJJ = &toBJJ
|
||||
break
|
||||
}
|
||||
@@ -208,7 +208,7 @@ func genTestTxs(
|
||||
if l2s[i].FromIdx == acc.Idx {
|
||||
fromEthAddr := string(apitypes.NewHezEthAddr(acc.EthAddr))
|
||||
tx.FromEthAddr = &fromEthAddr
|
||||
fromBJJ := string(apitypes.NewHezBJJ(acc.PublicKey))
|
||||
fromBJJ := string(apitypes.NewHezBJJ(acc.BJJ))
|
||||
tx.FromBJJ = &fromBJJ
|
||||
break
|
||||
}
|
||||
@@ -220,7 +220,7 @@ func genTestTxs(
|
||||
if l2s[i].ToIdx == acc.Idx {
|
||||
toEthAddr := string(apitypes.NewHezEthAddr(acc.EthAddr))
|
||||
tx.ToEthAddr = &toEthAddr
|
||||
toBJJ := string(apitypes.NewHezBJJ(acc.PublicKey))
|
||||
toBJJ := string(apitypes.NewHezBJJ(acc.BJJ))
|
||||
tx.ToBJJ = &toBJJ
|
||||
break
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ func (a *API) verifyPoolL2TxWrite(txw *l2db.PoolL2TxWrite) error {
|
||||
return tracerr.Wrap(err)
|
||||
}
|
||||
// Check signature
|
||||
if !poolTx.VerifySignature(a.chainID, account.PublicKey) {
|
||||
if !poolTx.VerifySignature(a.chainID, account.BJJ) {
|
||||
return tracerr.Wrap(errors.New("wrong signature"))
|
||||
}
|
||||
return nil
|
||||
|
||||
@@ -106,7 +106,7 @@ func genTestPoolTxs(
|
||||
fromAcc := getAccountByIdx(poolTx.FromIdx, accs)
|
||||
fromAddr := ethAddrToHez(fromAcc.EthAddr)
|
||||
genReceiveTx.FromEthAddr = &fromAddr
|
||||
fromBjj := bjjToString(fromAcc.PublicKey)
|
||||
fromBjj := bjjToString(fromAcc.BJJ)
|
||||
genReceiveTx.FromBJJ = &fromBjj
|
||||
if poolTx.ToIdx != 0 {
|
||||
toIdx := idxToHez(poolTx.ToIdx, token.Symbol)
|
||||
@@ -128,7 +128,7 @@ func genTestPoolTxs(
|
||||
genReceiveTx.ToBJJ = &toBJJ
|
||||
} else if poolTx.ToIdx > 255 {
|
||||
acc := getAccountByIdx(poolTx.ToIdx, accs)
|
||||
bjj := bjjToString(acc.PublicKey)
|
||||
bjj := bjjToString(acc.BJJ)
|
||||
genReceiveTx.ToBJJ = &bjj
|
||||
}
|
||||
if poolTx.RqFromIdx != 0 {
|
||||
|
||||
Reference in New Issue
Block a user