MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestTxTransfer

Function TestTxTransfer

types/transfer_test.go:29–47  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27)
28
29func TestTxTransfer(t *testing.T) {
30 Convey("test transfer", t, func() {
31 h, err := hash.NewHashFromStr("000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade")
32 So(err, ShouldBeNil)
33 addr := proto.AccountAddress(*h)
34
35 t := NewTransfer(&TransferHeader{
36 Sender: addr,
37 Nonce: 1,
38 })
39 So(t.GetAccountAddress(), ShouldEqual, addr)
40 So(t.GetAccountNonce(), ShouldEqual, 1)
41
42 priv, _, err := asymmetric.GenSecp256k1KeyPair()
43 So(err, ShouldBeNil)
44 So(t.Sign(priv), ShouldBeNil)
45 So(t.Verify(), ShouldBeNil)
46 })
47}

Callers

nothing calls this directly

Calls 8

GetAccountAddressMethod · 0.95
GetAccountNonceMethod · 0.95
SignMethod · 0.95
VerifyMethod · 0.95
NewHashFromStrFunction · 0.92
AccountAddressTypeAlias · 0.92
GenSecp256k1KeyPairFunction · 0.92
NewTransferFunction · 0.85

Tested by

no test coverage detected