// (c) 2019-2020, Ava Labs, Inc. All rights reserved. // See the file LICENSE for licensing terms. package platformvm import ( "encoding/json" "testing" ) func TestAddDefaultSubnetValidator(t *testing.T) { expectedJSONString := `{"startTime":"0","endtime":"0","id":null,"destination":null,"delegationFeeRate":"0","payerNonce":"0"}` args := AddDefaultSubnetValidatorArgs{} bytes, err := json.Marshal(&args) if err != nil { t.Fatal(err) } jsonString := string(bytes) if jsonString != expectedJSONString { t.Fatalf("Expected: %s\nResult: %s", expectedJSONString, jsonString) } } func TestCreateBlockchainArgsParsing(t *testing.T) { jsonString := `{"vmID":"lol","fxIDs":["secp256k1"], "name":"awesome", "payerNonce":5, "genesisData":"SkB92YpWm4Q2iPnLGCuDPZPgUQMxajqQQuz91oi3xD984f8r"}` args := CreateBlockchainArgs{} err := json.Unmarshal([]byte(jsonString), &args) if err != nil { t.Fatal(err) } if _, err = json.Marshal(args.GenesisData); err != nil { t.Fatal(err) } }