Skip to content

Commit

Permalink
omitempty + test
Browse files Browse the repository at this point in the history
  • Loading branch information
CreatureDev committed Aug 10, 2023
1 parent 0f32b57 commit 3cf2ca1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion model/client/admin/status/feature_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type FeatureResponse struct {

type Feature struct {
Enabled bool `json:"enabled"`
Name string `json:"name"`
Name string `json:"name,omitempty"`
Supported bool `json:"supported"`
Vetoed bool `json:"vetoed"`
}
30 changes: 30 additions & 0 deletions model/client/admin/status/validator_info_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package status

import (
"testing"

"github.com/xyield/xrpl-go/test"
)

func TestValidatorInfoResponse(t *testing.T) {
s := ValidatorInfoResponse{
Domain: "mduo13.com",
EphemeralKey: "n9KnrcCmL5psyKtk2KWP6jy14Hj4EXuZDg7XMdQJ9cSDoFSp53hu",
Manifest: "JAAAAAFxIe002KClGBUlRA7h5J2Y5B7Xdlxn1Z5OxY7ZC2UmqUIikHMhAkVIeB7McBf4NFsBceQQlScTVUWMdpYzwmvs115SUGDKdkcwRQIhAJnKfYWnPsBsATIIRfgkAAK+HE4zp8G8AmOPrHmLZpZAAiANiNECVQTKktoD7BEoEmS8jaFBNMgRdcG0dttPurCAGXcKbWR1bzEzLmNvbXASQPjO6wxOfhtWsJ6oMWBg8Rs5STAGvQV2ArI5MG3KbpFrNSMxbx630Ars9d9j1ORsUS5v1biZRShZfg9180JuZAo=",
MasterKey: "nHBk5DPexBjinXV8qHn7SEKzoxh2W92FxSbNTPgGtQYBzEF4msn9",
Seq: 1,
}

j := `{
"domain": "mduo13.com",
"ephemeral_key": "n9KnrcCmL5psyKtk2KWP6jy14Hj4EXuZDg7XMdQJ9cSDoFSp53hu",
"manifest": "JAAAAAFxIe002KClGBUlRA7h5J2Y5B7Xdlxn1Z5OxY7ZC2UmqUIikHMhAkVIeB7McBf4NFsBceQQlScTVUWMdpYzwmvs115SUGDKdkcwRQIhAJnKfYWnPsBsATIIRfgkAAK+HE4zp8G8AmOPrHmLZpZAAiANiNECVQTKktoD7BEoEmS8jaFBNMgRdcG0dttPurCAGXcKbWR1bzEzLmNvbXASQPjO6wxOfhtWsJ6oMWBg8Rs5STAGvQV2ArI5MG3KbpFrNSMxbx630Ars9d9j1ORsUS5v1biZRShZfg9180JuZAo=",
"master_key": "nHBk5DPexBjinXV8qHn7SEKzoxh2W92FxSbNTPgGtQYBzEF4msn9",
"seq": 1
}`

if err := test.SerializeAndDeserialize(t, s, j); err != nil {
t.Error(err)
}

}

0 comments on commit 3cf2ca1

Please sign in to comment.