(t *testing.T)
| 28 | ) |
| 29 | |
| 30 | func TestBaseAccount(t *testing.T) { |
| 31 | Convey("base account", t, func() { |
| 32 | h, err := hash.NewHashFromStr("000005aa62048f85da4ae9698ed59c14ec0d48a88a07c15a32265634e7e64ade") |
| 33 | So(err, ShouldBeNil) |
| 34 | addr := proto.AccountAddress(*h) |
| 35 | ba := NewBaseAccount(&Account{ |
| 36 | Address: addr, |
| 37 | }) |
| 38 | So(ba.GetAccountAddress(), ShouldEqual, addr) |
| 39 | So(ba.GetAccountNonce(), ShouldEqual, 0) |
| 40 | So(ba.Hash(), ShouldEqual, hash.Hash{}) |
| 41 | priv, _, err := asymmetric.GenSecp256k1KeyPair() |
| 42 | So(err, ShouldBeNil) |
| 43 | So(ba.Sign(priv), ShouldBeNil) |
| 44 | So(ba.Verify(), ShouldBeNil) |
| 45 | }) |
| 46 | } |
| 47 | |
| 48 | func TestDeepcopier(t *testing.T) { |
| 49 | Convey("base account", t, func() { |
nothing calls this directly
no test coverage detected