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

Function TestAccountAddress_DatabaseID

proto/nodeinfo_test.go:30–59  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28)
29
30func TestAccountAddress_DatabaseID(t *testing.T) {
31 target := []string{
32 "1224a1e9f72eb00d08afa4030dc642edefb6e3249aafe20cf1a5f9d46d0c0bbe",
33 "5b0b8fd3b0700bd0858f3d61ff0a1b621dbbeb2013a3aab5df2885dc10ccf6ce",
34 "b90f502d8aa95573cdc3c50ea1552aa1c163b567980e2555fe84cfd1d5e78765",
35 }
36
37 Convey("DatabaseID Convert", t, func() {
38 for i := range target {
39 dbID := DatabaseID(target[i])
40 a, err := dbID.AccountAddress()
41 So(err, ShouldBeNil)
42 d := a.DatabaseID()
43 So(d, ShouldEqual, dbID)
44 So(string(d), ShouldEqual, target[i])
45 }
46 })
47
48 Convey("AccountAddress JSON Convert", t, func() {
49 for i := range target {
50 var a AccountAddress
51 dbIDJson := []byte("\"" + target[i] + "\"")
52 err := a.UnmarshalJSON(dbIDJson)
53 So(err, ShouldBeNil)
54 d := a.DatabaseID()
55 So(string(d), ShouldEqual, target[i])
56 }
57 })
58
59}
60
61func TestNode_InitNodeCryptoInfo(t *testing.T) {
62 Convey("InitNodeCryptoInfo", t, func() {

Callers

nothing calls this directly

Calls 4

DatabaseIDMethod · 0.95
UnmarshalJSONMethod · 0.95
DatabaseIDTypeAlias · 0.85
AccountAddressMethod · 0.80

Tested by

no test coverage detected