mirror of
https://github.com/arnaucube/hermez-node.git
synced 2026-02-07 11:26:44 +01:00
@@ -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)
|
||||
|
||||
@@ -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"`
|
||||
|
||||
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user