mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-06 19:06:42 +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:
@@ -31,12 +31,12 @@ func newAccount(t *testing.T, i int) *common.Account {
|
||||
address := ethCrypto.PubkeyToAddress(key.PublicKey)
|
||||
|
||||
return &common.Account{
|
||||
Idx: common.Idx(256 + i),
|
||||
TokenID: common.TokenID(i),
|
||||
Nonce: common.Nonce(i),
|
||||
Balance: big.NewInt(1000),
|
||||
PublicKey: pk.Compress(),
|
||||
EthAddr: address,
|
||||
Idx: common.Idx(256 + i),
|
||||
TokenID: common.TokenID(i),
|
||||
Nonce: common.Nonce(i),
|
||||
Balance: big.NewInt(1000),
|
||||
BJJ: pk.Compress(),
|
||||
EthAddr: address,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,12 +126,12 @@ func GenAccounts(totalAccounts, userAccounts int, tokens []common.Token, userAdd
|
||||
pubK = privK.Public()
|
||||
}
|
||||
accs = append(accs, common.Account{
|
||||
Idx: common.Idx(i),
|
||||
TokenID: tokens[i%len(tokens)].TokenID,
|
||||
EthAddr: addr,
|
||||
BatchNum: batches[i%len(batches)].BatchNum,
|
||||
PublicKey: pubK.Compress(),
|
||||
Balance: big.NewInt(int64(i * 10000000)), //nolint:gomnd
|
||||
Idx: common.Idx(i),
|
||||
TokenID: tokens[i%len(tokens)].TokenID,
|
||||
EthAddr: addr,
|
||||
BatchNum: batches[i%len(batches)].BatchNum,
|
||||
BJJ: pubK.Compress(),
|
||||
Balance: big.NewInt(int64(i * 10000000)), //nolint:gomnd
|
||||
})
|
||||
}
|
||||
return accs
|
||||
@@ -243,7 +243,7 @@ func setFromToAndAppend(
|
||||
}
|
||||
tx.FromIdx = from.Idx
|
||||
tx.FromEthAddr = from.EthAddr
|
||||
tx.FromBJJ = from.PublicKey
|
||||
tx.FromBJJ = from.BJJ
|
||||
tx.ToIdx = to.Idx
|
||||
*userTxs = append(*userTxs, tx)
|
||||
} else {
|
||||
@@ -257,7 +257,7 @@ func setFromToAndAppend(
|
||||
}
|
||||
tx.FromIdx = from.Idx
|
||||
tx.FromEthAddr = from.EthAddr
|
||||
tx.FromBJJ = from.PublicKey
|
||||
tx.FromBJJ = from.BJJ
|
||||
tx.ToIdx = to.Idx
|
||||
*othersTxs = append(*othersTxs, tx)
|
||||
}
|
||||
|
||||
@@ -854,13 +854,13 @@ func (tc *Context) FillBlocksExtra(blocks []common.BlockData, cfg *ConfigExtra)
|
||||
}
|
||||
batch.CreatedAccounts = append(batch.CreatedAccounts,
|
||||
common.Account{
|
||||
Idx: common.Idx(tc.extra.idx),
|
||||
TokenID: tx.TokenID,
|
||||
BatchNum: batch.Batch.BatchNum,
|
||||
PublicKey: user.BJJ.Public().Compress(),
|
||||
EthAddr: user.Addr,
|
||||
Nonce: 0,
|
||||
Balance: big.NewInt(0),
|
||||
Idx: common.Idx(tc.extra.idx),
|
||||
TokenID: tx.TokenID,
|
||||
BatchNum: batch.Batch.BatchNum,
|
||||
BJJ: user.BJJ.Public().Compress(),
|
||||
EthAddr: user.Addr,
|
||||
Nonce: 0,
|
||||
Balance: big.NewInt(0),
|
||||
})
|
||||
tc.extra.idx++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user