diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-26 17:19:40 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-26 17:19:40 +0800 |
commit | 145e02fc5444eb878f67c58e310e7c5e324bb27a (patch) | |
tree | 8e0ffc8003c8f3b58cb8cb6edcc2fce2865e59ad /core/transaction_pool_test.go | |
parent | 8d09f95bc7a73aaf567b05028ebdb4f2ac5129e4 (diff) | |
download | dexon-145e02fc5444eb878f67c58e310e7c5e324bb27a.tar.gz dexon-145e02fc5444eb878f67c58e310e7c5e324bb27a.tar.zst dexon-145e02fc5444eb878f67c58e310e7c5e324bb27a.zip |
core, miner: added value check on tx validation
* Changed CalcGasLimit to no longer need current block
* Added a gas * price + value on tx validation
* Transactions in the pool are now re-validated once every X
Diffstat (limited to 'core/transaction_pool_test.go')
-rw-r--r-- | core/transaction_pool_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go index f96d2b651..4d66776f0 100644 --- a/core/transaction_pool_test.go +++ b/core/transaction_pool_test.go @@ -43,10 +43,11 @@ func TestInvalidTransactions(t *testing.T) { t.Error("expected", ErrInsufficientFunds) } - pool.currentState().AddBalance(from, big.NewInt(100*100)) + balance := new(big.Int).Add(tx.Value(), new(big.Int).Mul(tx.Gas(), tx.GasPrice())) + pool.currentState().AddBalance(from, balance) err = pool.Add(tx) if err != ErrIntrinsicGas { - t.Error("expected", ErrIntrinsicGas) + t.Error("expected", ErrIntrinsicGas, "got", err) } pool.currentState().SetNonce(from, 1) |