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

Function TestDatabaseID_AccountAddress

proto/proto_test.go:56–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func 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
82func TestFromAccountAndNonce(t *testing.T) {
83 target := []struct {

Callers

nothing calls this directly

Calls 3

NewHashFromStrFunction · 0.92
DatabaseIDTypeAlias · 0.85
AccountAddressMethod · 0.80

Tested by

no test coverage detected