aboutsummaryrefslogtreecommitdiffstats
path: root/core/transaction_pool_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/transaction_pool_test.go')
-rw-r--r--core/transaction_pool_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/transaction_pool_test.go b/core/transaction_pool_test.go
index 49224be5b..d6ea4a2a9 100644
--- a/core/transaction_pool_test.go
+++ b/core/transaction_pool_test.go
@@ -138,3 +138,17 @@ func TestRemoveTx(t *testing.T) {
t.Error("expected txs to be 0, got", len(pool.txs))
}
}
+
+func TestNegativeValue(t *testing.T) {
+ pool, key := setupTxPool()
+
+ tx := transaction()
+ tx.Value().Set(big.NewInt(-1))
+ tx.SignECDSA(key)
+ from, _ := tx.From()
+ pool.currentState().AddBalance(from, big.NewInt(1))
+ err := pool.Add(tx)
+ if err != ErrNegativeValue {
+ t.Error("expected", ErrNegativeValue, "got", err)
+ }
+}