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

Function TestTxCheckType

types/transaction_test.go:237–247  ·  view source on GitHub ↗

TestTxCheckType tests Transaction's CheckType() function.

(t *testing.T)

Source from the content-addressed store, hash-verified

235
236// TestTxCheckType tests Transaction's CheckType() function.
237func TestTxCheckType(t *testing.T) {
238 tx := NewTransaction(0, common.HexToAddress("0xb794f5ea0ba39494ce83a213fffba74279579268"), new(big.Int), 0, new(big.Int), nil)
239 tx.SetType(PrivateTx)
240 if !tx.CheckType(PrivateTx) {
241 t.Fatal("The types of transaction should include Private")
242 }
243 tx.SetType(BasicTx)
244 if tx.CheckType(PrivateTx) {
245 t.Fatal("The types of transaction should NOT include Private")
246 }
247}
248
249// TestTxSetType tests Transaction's SetType(), Type() function.
250func TestTxSetType(t *testing.T) {

Callers

nothing calls this directly

Calls 4

SetTypeMethod · 0.95
CheckTypeMethod · 0.95
NewTransactionFunction · 0.85
FatalMethod · 0.65

Tested by

no test coverage detected