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

Function TestTxSetType

types/transaction_test.go:250–256  ·  view source on GitHub ↗

TestTxSetType tests Transaction's SetType(), Type() function.

(t *testing.T)

Source from the content-addressed store, hash-verified

248
249// TestTxSetType tests Transaction's SetType(), Type() function.
250func TestTxSetType(t *testing.T) {
251 tx := NewTransaction(0, common.HexToAddress("0xb794f5ea0ba39494ce83a213fffba74279579268"), new(big.Int), 0, new(big.Int), nil)
252 tx.SetType(PrivateTx)
253 if tx.Type() != PrivateTx {
254 t.Fatal("The returned types of transaction is not correct.")
255 }
256}

Callers

nothing calls this directly

Calls 4

SetTypeMethod · 0.95
TypeMethod · 0.95
NewTransactionFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected