mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 03:16:45 +01:00
Fix format of the MTP for exit endpoint
This commit is contained in:
@@ -2346,35 +2346,35 @@ components:
|
|||||||
type: object
|
type: object
|
||||||
description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
|
description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string.
|
||||||
properties:
|
properties:
|
||||||
Root:
|
root:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
Siblings:
|
siblings:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
OldKey:
|
oldKey:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
OldValue:
|
oldValue:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
IsOld0:
|
isOld0:
|
||||||
type: boolean
|
type: boolean
|
||||||
Key:
|
key:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
Value:
|
value:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
Fnc:
|
fnc:
|
||||||
type: integer
|
type: integer
|
||||||
maximum: 3
|
maximum: 3
|
||||||
minimum: 0
|
minimum: 0
|
||||||
required:
|
required:
|
||||||
- Root
|
- root
|
||||||
- Siblings
|
- siblings
|
||||||
- OldKey
|
- oldKey
|
||||||
- OldValue
|
- oldValue
|
||||||
- IsOld0
|
- isOld0
|
||||||
- Key
|
- key
|
||||||
- Value
|
- value
|
||||||
- Fnc
|
- fnc
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
balance:
|
balance:
|
||||||
$ref: '#/components/schemas/BigInt'
|
$ref: '#/components/schemas/BigInt'
|
||||||
|
|||||||
@@ -190,24 +190,11 @@ type ExitAPI struct {
|
|||||||
// MarshalJSON is used to neast some of the fields of ExitAPI
|
// MarshalJSON is used to neast some of the fields of ExitAPI
|
||||||
// without the need of auxiliar structs
|
// without the need of auxiliar structs
|
||||||
func (e ExitAPI) MarshalJSON() ([]byte, error) {
|
func (e ExitAPI) MarshalJSON() ([]byte, error) {
|
||||||
siblings := []string{}
|
|
||||||
for i := 0; i < len(e.MerkleProof.Siblings); i++ {
|
|
||||||
siblings = append(siblings, e.MerkleProof.Siblings[i].String())
|
|
||||||
}
|
|
||||||
return json.Marshal(map[string]interface{}{
|
return json.Marshal(map[string]interface{}{
|
||||||
"itemId": e.ItemID,
|
"itemId": e.ItemID,
|
||||||
"batchNum": e.BatchNum,
|
"batchNum": e.BatchNum,
|
||||||
"accountIndex": e.AccountIdx,
|
"accountIndex": e.AccountIdx,
|
||||||
"merkleProof": map[string]interface{}{
|
"merkleProof": e.MerkleProof,
|
||||||
"Root": e.MerkleProof.Root.String(),
|
|
||||||
"Siblings": siblings,
|
|
||||||
"OldKey": e.MerkleProof.OldKey.String(),
|
|
||||||
"OldValue": e.MerkleProof.OldValue.String(),
|
|
||||||
"IsOld0": e.MerkleProof.IsOld0,
|
|
||||||
"Key": e.MerkleProof.Key.String(),
|
|
||||||
"Value": e.MerkleProof.Value.String(),
|
|
||||||
"Fnc": e.MerkleProof.Fnc,
|
|
||||||
},
|
|
||||||
"balance": e.Balance,
|
"balance": e.Balance,
|
||||||
"instantWithdrawn": e.InstantWithdrawn,
|
"instantWithdrawn": e.InstantWithdrawn,
|
||||||
"delayedWithdrawRequest": e.DelayedWithdrawRequest,
|
"delayedWithdrawRequest": e.DelayedWithdrawRequest,
|
||||||
|
|||||||
Reference in New Issue
Block a user