diff --git a/contracts/go/clients/meshwantsclient/wants.go b/contracts/go/clients/meshwantsclient/wants.go index 2e54a9f6..1b79073e 100644 --- a/contracts/go/clients/meshwantsclient/wants.go +++ b/contracts/go/clients/meshwantsclient/wants.go @@ -7,6 +7,7 @@ package meshwantsclient import ( "encoding/json" "fmt" + "reflect" "regexp" "strings" @@ -258,7 +259,7 @@ func DecodeWant(data []byte) (Want, error) { } // SameWant says whether two wants are the same value, so the assigner writes only when they differ. -func SameWant(a, b Want) bool { return a == b } +func SameWant(a, b Want) bool { return reflect.DeepEqual(a, b) } func checkNodeWant(w NodeWant) error { switch { diff --git a/contracts/go/clients/meshwantsclient/wants_test.go b/contracts/go/clients/meshwantsclient/wants_test.go index 5e2ecadb..c4cf388e 100644 --- a/contracts/go/clients/meshwantsclient/wants_test.go +++ b/contracts/go/clients/meshwantsclient/wants_test.go @@ -39,6 +39,7 @@ func TestWantsAreWhatTheEarlierCodecWrote(t *testing.T) { "held back": {Want{Fp: a, Self: true, Newest: b, Rule: RuleGrant, Backup: BackupAgain, Words: "held"}, `{"v":1,"fp":"` + a + `","newest":"` + b + `","rule":6,"backup":"again","words":"held","self":true}`}, "put": {Want{Fp: a, Self: true, Put: true, Hold: true, Yes: d, Release: "r1"}, `{"v":1,"fp":"` + a + `","put":true,"hold":true,"yes":"` + d + `","release":"r1","self":true}`}, "removed": {Want{Removed: true, Words: "gone"}, `{"v":1,"removed":true,"words":"gone"}`}, + "released": {Want{Fp: a, Composed: c, Version: "0.1.15", Parts: map[string]string{"mesh-sdk:go": d}}, `{"v":1,"fp":"` + a + `","composed":"` + c + `","version":"0.1.15","parts":{"mesh-sdk:go":"` + d + `"}}`}, } { t.Run(name, func(t *testing.T) { raw, err := EncodeWant(row.w)