arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Update missing LoadAmount to DepositAmount

Related to https://github.com/hermeznetwork/hermez-node/commit/445f26ec9f908f0ced10565121c3556ff1862515
arnaucube root@arnaucube.com
Wed, 09 Dec 2020 18:26:54 +0100
commit

9d0b278d50680142e9d93f3a81ad4027850198af

parent

d5c753030a1731c3a98989c093f7919b2f944f7d

M api/swagger.yml → api/swagger.yml

@@ -1768,7 +1768,7 @@ In this case transaction won't be effective making the deposit amount have a real value of 0.

example: true historicDepositAmountUSD: type: number - description: Load amount in USD, at the moment the transaction was made. + description: Deposit amount in USD, at the moment the transaction was made. example: 3.897 nullable: true ethereumBlockNum:

@@ -2974,7 +2974,7 @@ description: Account index used to indicate that a transaction is an `exit` or `force exit`.

example: 1 limitDepositAmount: type: integer - description: Maximum load amount (L1 to L2) allowed. + description: Maximum deposit amount (L1 to L2) allowed. example: 321 limitL2TransferAmount: type: integer

@@ -3116,4 +3116,4 @@ Error500:

allOf: - $ref: '#/components/schemas/Error' - example: - message: Database error.+ message: Database error.
M api/txshistory_test.go → api/txshistory_test.go

@@ -166,9 +166,9 @@ tx.HistoricUSD = &usd

} laf := new(big.Float).SetInt(l1.DepositAmount) depositAmountFloat, _ := laf.Float64() - loadUSD := *token.USD * depositAmountFloat / math.Pow(10, float64(token.Decimals)) + depositUSD := *token.USD * depositAmountFloat / math.Pow(10, float64(token.Decimals)) if depositAmountFloat != 0 { - tx.L1Info.HistoricDepositAmountUSD = &loadUSD + tx.L1Info.HistoricDepositAmountUSD = &depositUSD } } txs = append(txs, tx)
M common/ethrollup.go → common/ethrollup.go

@@ -87,7 +87,7 @@ LenVerifiers = 1

) var ( - // RollupConstLimitDepositAmount Max load amount allowed (depositAmount: L1 --> L2) + // RollupConstLimitDepositAmount Max deposit amount allowed (depositAmount: L1 --> L2) RollupConstLimitDepositAmount, _ = new(big.Int).SetString("340282366920938463463374607431768211456", 10) // RollupConstLimitL2TransferAmount Max amount allowed (amount L2 --> L2) RollupConstLimitL2TransferAmount, _ = new(big.Int).SetString("6277101735386680763835789423207666416102355444464034512896", 10)
M db/historydb/historydb_test.go → db/historydb/historydb_test.go

@@ -516,7 +516,7 @@ assert.Equal(t, true, dbL1Txs[7].UserOrigin)

assert.Equal(t, true, dbL1Txs[8].UserOrigin) assert.Equal(t, true, dbL1Txs[9].UserOrigin) - // Load Amount + // Deposit Amount assert.Equal(t, big.NewInt(10), dbL1Txs[0].DepositAmount) assert.Equal(t, big.NewInt(10), dbL1Txs[1].DepositAmount) assert.Equal(t, big.NewInt(20), dbL1Txs[2].DepositAmount)
M db/historydb/views.go → db/historydb/views.go

@@ -120,7 +120,7 @@ }

// txWrite is an representatiion that merges common.L1Tx and common.L2Tx // in order to perform inserts into tx table -// EffectiveAmount and LoadEffectiveAmount are not set since they have default values in the DB +// EffectiveAmount and EffectiveDepositAmount are not set since they have default values in the DB type txWrite struct { // Generic IsL1 bool `meddler:"is_l1"`
M db/migrations/0001.sql → db/migrations/0001.sql

@@ -137,7 +137,7 @@ -- The behaviour should be:

-- When tx is not forged: amount_success = false, deposit_amount_success = false -- When tx is forged: -- amount_success = false if the "effective amount" is 0, else true --- deposit_amount_success = false if the "effective load amount" is 0, else true +-- deposit_amount_success = false if the "effective deposit amount" is 0, else true -- -- However, in order to reduce the amount of updates, by default amount_success and deposit_amount_success will be set to true (when tx is unforged) -- whne they should be false. This can be worked around at a query level by checking if "batch_num IS NULL" (which indicates that the tx is unforged).