(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestDporSignatureJsonEncoding(t *testing.T) { |
| 160 | sig := HexToDporSig("0xc9efd3956760d72613081c50294ad582d0e36bea45878f3570cc9e8525b997472120d0ef25f88c3b64122b967bd5063633b744bc4e3ae3afc316bb4e5c7edc1d00") |
| 161 | jsonBytes, err := json.Marshal(sig) |
| 162 | |
| 163 | if err != nil { |
| 164 | t.Error("error:", err) |
| 165 | } |
| 166 | fmt.Println("jsonBytes:", string(jsonBytes)) |
| 167 | |
| 168 | var ds DporSignature |
| 169 | err = json.Unmarshal(jsonBytes, &ds) |
| 170 | if err != nil { |
| 171 | t.Error("error:", err) |
| 172 | } |
| 173 | fmt.Printf("\nunmarshal:%+v\n", ds) |
| 174 | assert.Equal(t, sig, ds) |
| 175 | } |
| 176 | |
| 177 | func TestDporSnapJsonEncoding(t *testing.T) { |
| 178 | dpor := DporSnap{ |
nothing calls this directly
no test coverage detected