(t *testing.T)
| 246 | } |
| 247 | |
| 248 | func TestMarshalNode(t *testing.T) { |
| 249 | Convey("marshal unmarshal node", t, func() { |
| 250 | nodeInfo := &proto.Node{ |
| 251 | ID: "0000000000000000000000000000000000000000000000000000000000001111", |
| 252 | Addr: "addr", |
| 253 | PublicKey: nil, |
| 254 | Nonce: cpuminer.Uint256{ |
| 255 | A: 1, |
| 256 | B: 2, |
| 257 | C: 3, |
| 258 | D: 4, |
| 259 | }, |
| 260 | } |
| 261 | nodeBuf, err := utils.EncodeMsgPack(nodeInfo) |
| 262 | if err != nil { |
| 263 | log.Errorf("encode error: %s", err) |
| 264 | } |
| 265 | |
| 266 | nodeDec := proto.NewNode() |
| 267 | err = utils.DecodeMsgPack(nodeBuf.Bytes(), nodeDec) |
| 268 | |
| 269 | So(reflect.DeepEqual(nodeDec, nodeInfo), ShouldBeTrue) |
| 270 | }) |
| 271 | } |
| 272 | |
| 273 | func TestMarshalBPInfo(t *testing.T) { |
| 274 | log.SetLevel(log.DebugLevel) |
nothing calls this directly
no test coverage detected