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

Function TestRecipientNormal

types/transaction_test.go:106–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

104}
105
106func TestRecipientNormal(t *testing.T) {
107 _, addr := defaultTestKey()
108
109 tx, err := decodeTx(common.Hex2Bytes("f85e8080808094000000000000000000000000000000000000000080011ca0527c0d8f5c63f7b9f41324a7c8a563ee1190bcbf0dac8ab446291bdbf32f5c79a0552c4ef0a09a04395074dab9ed34d3fbfb843c2f2546cc30fe89ec143ca94ca6"))
110 if err != nil {
111 t.Error(err)
112 t.FailNow()
113 }
114
115 from, err := Sender(HomesteadSigner{}, tx)
116 if err != nil {
117 t.Error(err)
118 t.FailNow()
119 }
120
121 if addr != from {
122 t.Error("derived address doesn't match")
123 }
124}
125
126// Tests that transactions can be correctly sorted according to their price in
127// decreasing order, but at the same time with increasing nonces when issued by

Callers

nothing calls this directly

Calls 4

defaultTestKeyFunction · 0.85
decodeTxFunction · 0.85
SenderFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected