Update missing LoadAmount to DepositAmount

Related to 445f26ec9f
This commit is contained in:
arnaucube
2020-12-09 18:26:54 +01:00
parent d5c753030a
commit 9d0b278d50
6 changed files with 9 additions and 9 deletions

View File

@@ -516,7 +516,7 @@ func TestTxs(t *testing.T) {
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)

View File

@@ -120,7 +120,7 @@ func (tx TxAPI) MarshalJSON() ([]byte, error) {
// 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"`

View File

@@ -137,7 +137,7 @@ CREATE SEQUENCE tx_item_id;
-- 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).