diff --git a/api/swagger.yml b/api/swagger.yml index 4592dd0..56878c6 100644 --- a/api/swagger.yml +++ b/api/swagger.yml @@ -2346,35 +2346,35 @@ components: type: object description: Existence proof of a leaf in a given Merkle Root. Encoded as hexadecimal string. properties: - Root: + root: $ref: '#/components/schemas/BigInt' - Siblings: + siblings: type: array items: $ref: '#/components/schemas/BigInt' - OldKey: + oldKey: $ref: '#/components/schemas/BigInt' - OldValue: + oldValue: $ref: '#/components/schemas/BigInt' - IsOld0: + isOld0: type: boolean - Key: + key: $ref: '#/components/schemas/BigInt' - Value: + value: $ref: '#/components/schemas/BigInt' - Fnc: + fnc: type: integer maximum: 3 minimum: 0 required: - - Root - - Siblings - - OldKey - - OldValue - - IsOld0 - - Key - - Value - - Fnc + - root + - siblings + - oldKey + - oldValue + - isOld0 + - key + - value + - fnc additionalProperties: false balance: $ref: '#/components/schemas/BigInt' diff --git a/db/historydb/views.go b/db/historydb/views.go index d1784bd..4cdc4f3 100644 --- a/db/historydb/views.go +++ b/db/historydb/views.go @@ -190,24 +190,11 @@ type ExitAPI struct { // MarshalJSON is used to neast some of the fields of ExitAPI // without the need of auxiliar structs 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{}{ - "itemId": e.ItemID, - "batchNum": e.BatchNum, - "accountIndex": e.AccountIdx, - "merkleProof": map[string]interface{}{ - "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, - }, + "itemId": e.ItemID, + "batchNum": e.BatchNum, + "accountIndex": e.AccountIdx, + "merkleProof": e.MerkleProof, "balance": e.Balance, "instantWithdrawn": e.InstantWithdrawn, "delayedWithdrawRequest": e.DelayedWithdrawRequest,