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

Function TestMarshalHashAccountStable

types/marshalhash_test.go:27–45  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25)
26
27func TestMarshalHashAccountStable(t *testing.T) {
28 v := Account{
29 Address: proto.AccountAddress{0x10},
30 TokenBalance: [SupportTokenNumber]uint64{10, 10},
31 Rating: 1110,
32 NextNonce: 1,
33 }
34 bts1, err := v.MarshalHash()
35 if err != nil {
36 t.Fatal(err)
37 }
38 bts2, err := v.MarshalHash()
39 if err != nil {
40 t.Fatal(err)
41 }
42 if !bytes.Equal(bts1, bts2) {
43 t.Fatal("hash not stable")
44 }
45}
46
47func TestMarshalHashAccountStable2(t *testing.T) {
48 v1 := Account{

Callers

nothing calls this directly

Calls 2

MarshalHashMethod · 0.95
FatalMethod · 0.80

Tested by

no test coverage detected