diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-09 13:28:45 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:23:39 +0800 |
commit | 64d06d63bc37257a01956b637b7e5df7fc2d838d (patch) | |
tree | a426f40feba80a8b9691395ab751e8acfe71af61 /dex/app.go | |
parent | d98d417075933857ce77699f57d24fbee2a63334 (diff) | |
download | go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar.gz go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar.bz2 go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar.lz go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar.xz go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.tar.zst go-tangerine-64d06d63bc37257a01956b637b7e5df7fc2d838d.zip |
app: fix log message
Diffstat (limited to 'dex/app.go')
-rw-r--r-- | dex/app.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dex/app.go b/dex/app.go index 78e8a0260..35a771460 100644 --- a/dex/app.go +++ b/dex/app.go @@ -142,7 +142,7 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, gp := new(core.GasPool).AddGas(math.MaxUint64) _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &gasUsed, d.vmConfig) if err != nil { - log.Error("apply confirmed transaction error: %v", err) + log.Error("apply confirmed transaction", "error", err) return nil, err } } @@ -151,7 +151,7 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, // apply transaction to calculate total gas used, validate nonce and check available balance _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &totalGasUsed, d.vmConfig) if err != nil || totalGasUsed > gasLimit { - log.Debug("apply transaction fail error: %v, totalGasUsed: %d, gasLimit: %d", err, totalGasUsed, gasLimit) + log.Debug("apply transaction fail", "error", err, "totalGasUsed", totalGasUsed, "gasLimit", gasLimit) break } allTxs = append(allTxs, tx) @@ -224,7 +224,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { } if !d.checkChain(msg.From(), chainSize, chainID) { - log.Error("%s can not be delivered on chain %d", msg.From().String(), chainID) + log.Error("check chain fail", "from", msg.From().String(), "chainSize", chainSize, "chainID", chainID) return false } @@ -232,7 +232,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { if !exist { txs, err := d.blockchain.GetConfirmedTxsByAddress(block.Position.ChainID, msg.From()) if err != nil { - log.Error("get confirmed txs by address error: %v", err) + log.Error("get confirmed txs by address", "error", err) return false } @@ -242,7 +242,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { // confirmed txs must apply successfully _, _, err := core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &gasUsed, d.vmConfig) if err != nil { - log.Error("apply confirmed transaction error: %v", err) + log.Error("apply confirmed transaction", "error", err) return false } } @@ -251,7 +251,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), transaction, &totalGasUsed, d.vmConfig) if err != nil { - log.Error("apply block transaction error: %v", err) + log.Error("apply block transaction", "error", err) return false } } @@ -302,7 +302,7 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F var transactions types.Transactions err := rlp.Decode(bytes.NewReader(block.Payload), &transactions) if err != nil { - log.Error("payload rlp decode error: %v", err) + log.Error("payload rlp decode", "error", err) return } @@ -315,7 +315,7 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F Coinbase: common.BytesToAddress(block.ProposerID.Hash[:]), }, transactions, nil, nil)}) if err != nil { - log.Error("insert chain error: %v", err) + log.Error("insert chain", "error", err) return } |