mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Merge pull request #435 from hermeznetwork/feature/addrs-in-exit-endpoints
Include addrs in exit responses
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/hermeznetwork/hermez-node/apitypes"
|
||||
"github.com/hermeznetwork/hermez-node/common"
|
||||
"github.com/hermeznetwork/hermez-node/db/historydb"
|
||||
"github.com/mitchellh/copystructure"
|
||||
@@ -26,6 +27,8 @@ type testExit struct {
|
||||
ItemID uint64 `json:"itemId"`
|
||||
BatchNum common.BatchNum `json:"batchNum"`
|
||||
AccountIdx string `json:"accountIndex"`
|
||||
BJJ apitypes.HezBJJ `json:"bjj"`
|
||||
EthAddr apitypes.HezEthAddr `json:"hezEthereumAddress"`
|
||||
MerkleProof testCVP `json:"merkleProof"`
|
||||
Balance string `json:"balance"`
|
||||
InstantWithdrawn *int64 `json:"instantWithdrawn"`
|
||||
@@ -63,9 +66,12 @@ func genTestExits(
|
||||
for i := 0; i < len(exit.MerkleProof.Siblings); i++ {
|
||||
siblings = append(siblings, exit.MerkleProof.Siblings[i].String())
|
||||
}
|
||||
acc := getAccountByIdx(exit.AccountIdx, accs)
|
||||
allExits = append(allExits, testExit{
|
||||
BatchNum: exit.BatchNum,
|
||||
AccountIdx: idxToHez(exit.AccountIdx, token.Symbol),
|
||||
BJJ: apitypes.NewHezBJJ(acc.PublicKey),
|
||||
EthAddr: apitypes.NewHezEthAddr(acc.EthAddr),
|
||||
MerkleProof: testCVP{
|
||||
Root: exit.MerkleProof.Root.String(),
|
||||
Siblings: siblings,
|
||||
|
||||
@@ -2318,6 +2318,10 @@ components:
|
||||
- example: 7394
|
||||
accountIndex:
|
||||
$ref: '#/components/schemas/AccountIndex'
|
||||
bjj:
|
||||
$ref: '#/components/schemas/BJJ'
|
||||
hezEthereumAddress:
|
||||
$ref: '#/components/schemas/HezEthereumAddress'
|
||||
itemId:
|
||||
$ref: '#/components/schemas/ItemId'
|
||||
merkleProof:
|
||||
@@ -2382,6 +2386,8 @@ components:
|
||||
required:
|
||||
- batchNum
|
||||
- accountIndex
|
||||
- bjj
|
||||
- hezEthereumAddress
|
||||
- itemId
|
||||
- merkleProof
|
||||
- balance
|
||||
|
||||
Reference in New Issue
Block a user