diff --git a/sequencer/database/migrations/0001.sql b/sequencer/database/migrations/0001.sql index 9bfcb5b..e4f834a 100644 --- a/sequencer/database/migrations/0001.sql +++ b/sequencer/database/migrations/0001.sql @@ -177,7 +177,7 @@ CREATE TABLE tx ( amount DECIMAL(78,0) NOT NULL, amount_success BOOLEAN NOT NULL DEFAULT true, amount_f NUMERIC NOT NULL, - token_id INT NOT NULL REFERENCES token (token_id), + token_id INT, amount_usd NUMERIC, -- Value of the amount in USD at the moment the tx was inserted in the DB batch_num BIGINT REFERENCES batch (batch_num) ON DELETE SET NULL, -- Can be NULL in the case of L1 txs that are on the queue but not forged yet. eth_block_num BIGINT NOT NULL REFERENCES block (eth_block_num) ON DELETE CASCADE, diff --git a/sequencer/test/til/lang.go b/sequencer/test/til/lang.go index a37aecd..e2b69c3 100644 --- a/sequencer/test/til/lang.go +++ b/sequencer/test/til/lang.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "math/big" - "sort" "strconv" "tokamak-sybil-resistance/common" "tokamak-sybil-resistance/log" @@ -486,6 +485,6 @@ func (p *parser) parse() (*parsedSet, error) { for u := range users { ps.users = append(ps.users, u) } - sort.Strings(ps.users) + // sort.Strings(ps.users) return ps, nil } diff --git a/sequencer/test/til/txs.go b/sequencer/test/til/txs.go index 3381f0c..b12a1e0 100644 --- a/sequencer/test/til/txs.go +++ b/sequencer/test/til/txs.go @@ -233,7 +233,7 @@ func (tc *Context) generateBlocks() ([]common.BlockData, error) { } case common.TxTypeCreateVouch: tx := common.L2Tx{ - // Amount: inst.Amount, + Amount: big.NewInt(0), // Fee: common.FeeSelector(inst.Fee), Type: common.TxTypeCreateVouch, EthBlockNum: tc.blockNum, @@ -249,7 +249,7 @@ func (tc *Context) generateBlocks() ([]common.BlockData, error) { tc.currBatchTest.l2Txs = append(tc.currBatchTest.l2Txs, testTx) case common.TxTypeDeleteVouch: tx := common.L2Tx{ - // Amount: inst.Amount, + Amount: big.NewInt(0), // Fee: common.FeeSelector(inst.Fee), Type: common.TxTypeDeleteVouch, EthBlockNum: tc.blockNum, @@ -802,7 +802,7 @@ func (tc *Context) FillBlocksExtra(blocks []common.BlockData, cfg *ConfigExtra) BJJ: user.BJJ.Public().Compress(), EthAddr: user.Addr, Nonce: 0, - Balance: big.NewInt(100), + Balance: big.NewInt(0), }) if !tx.UserOrigin { tx.EffectiveFromIdx = common.AccountIdx(tc.extra.idx) @@ -879,7 +879,7 @@ func (tc *Context) FillBlocksExtra(blocks []common.BlockData, cfg *ConfigExtra) batch.ExitTree = append(batch.ExitTree, common.ExitInfo{ BatchNum: batch.Batch.BatchNum, AccountIdx: tx.FromIdx, - // Balance: tx.Amount, + Balance: tx.Amount, }) } // fee, err := common.CalcFeeAmount(tx.Amount, tx.Fee) diff --git a/sequencer/txprocessor/txprocessor.go b/sequencer/txprocessor/txprocessor.go index be4e7a2..ee6f221 100644 --- a/sequencer/txprocessor/txprocessor.go +++ b/sequencer/txprocessor/txprocessor.go @@ -1046,7 +1046,7 @@ func (txProcessor *TxProcessor) applyTransfer(coordIdxsMap map[common.TokenID]co } // add amount-feeAmount to the receiver - accReceiver.Balance = new(big.Int).Add(accReceiver.Balance, tx.Amount) + // accReceiver.Balance = new(big.Int).Add(accReceiver.Balance, tx.Amount) // update receiver account in localStateDB pReceiver, err := txProcessor.updateAccount(auxToIdx, accReceiver)