(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func TestDatabaseID_AccountAddress(t *testing.T) { |
| 57 | target := []string{ |
| 58 | "1224a1e9f72eb00d08afa4030dc642edefb6e3249aafe20cf1a5f9d46d0c0bbe", |
| 59 | "5b0b8fd3b0700bd0858f3d61ff0a1b621dbbeb2013a3aab5df2885dc10ccf6ce", |
| 60 | "b90f502d8aa95573cdc3c50ea1552aa1c163b567980e2555fe84cfd1d5e78765", |
| 61 | } |
| 62 | |
| 63 | Convey("AccountAddress convert", t, func() { |
| 64 | for i := range target { |
| 65 | dbID := DatabaseID(target[i]) |
| 66 | h, err := hash.NewHashFromStr(target[i]) |
| 67 | So(err, ShouldBeNil) |
| 68 | a, err := dbID.AccountAddress() |
| 69 | So(err, ShouldBeNil) |
| 70 | So(h[:], ShouldResemble, a[:]) |
| 71 | } |
| 72 | }) |
| 73 | |
| 74 | Convey("AccountAddress invalid convert", t, func() { |
| 75 | invalid := "invalid" |
| 76 | dbID := DatabaseID(invalid) |
| 77 | _, err := dbID.AccountAddress() |
| 78 | So(err, ShouldNotBeNil) |
| 79 | }) |
| 80 | } |
| 81 | |
| 82 | func TestFromAccountAndNonce(t *testing.T) { |
| 83 | target := []struct { |
nothing calls this directly
no test coverage detected