MCPcopy Create free account
hub / github.com/CPChain/chain / TestTransactionNegativeValue

Function TestTransactionNegativeValue

core/tx_pool_test.go:318–330  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

316}
317
318func TestTransactionNegativeValue(t *testing.T) {
319 t.Parallel()
320
321 pool, key := setupTxPool()
322 defer pool.Stop()
323
324 tx, _ := types.SignTx(types.NewTransaction(0, common.Address{}, big.NewInt(-1), 100, big.NewInt(1), nil), types.HomesteadSigner{}, key)
325 from, _ := deriveSender(tx)
326 pool.currentState.AddBalance(from, big.NewInt(1))
327 if err := pool.AddRemote(tx); err != ErrNegativeValue {
328 t.Error("expected", ErrNegativeValue, "got", err)
329 }
330}
331
332func TestTransactionChainFork(t *testing.T) {
333 t.Parallel()

Callers

nothing calls this directly

Calls 7

setupTxPoolFunction · 0.85
deriveSenderFunction · 0.85
AddRemoteMethod · 0.80
StopMethod · 0.65
SignTxMethod · 0.65
AddBalanceMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected