From 1fcc11a22843c732fad8bc72f5d63088a36e1e28 Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Wed, 9 Mar 2022 14:33:21 -0500 Subject: [PATCH] fix(schema): Rollback v15 ProveCommitAggregate param schema --- lens/util/repo.go | 11 ++++++++--- tasks/messages/message_test.go | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lens/util/repo.go b/lens/util/repo.go index 86e22797f..5b8aa1061 100644 --- a/lens/util/repo.go +++ b/lens/util/repo.go @@ -460,10 +460,15 @@ var bitfieldCountMarshaller = func(v interface{}) ([]byte, error) { return nil, err } + // this struct matches the param schema used in network v14 + // see https://github.com/filecoin-project/lily/pull/821/files#r821851219 var ret = struct { - Count uint64 - RLE []uint64 - }{} + Count uint64 `json:"elemcount"` + RLE []uint64 `json:"rle"` + Type string `json:"_type"` + }{ + Type: "bitfield", + } if r.HasNext() { first, err := r.NextRun() if err != nil { diff --git a/tasks/messages/message_test.go b/tasks/messages/message_test.go index 053efc900..c8c0624f8 100644 --- a/tasks/messages/message_test.go +++ b/tasks/messages/message_test.go @@ -203,7 +203,7 @@ func TestParseMessageParams(t *testing.T) { ChainCommitEpoch: 1287345, }), wantMethod: "SubmitWindowedPoSt", - wantEncoded: "{\"Partitions\":[{\"Index\":0,\"Skipped\":{\"Count\":0,\"RLE\":[0]}}],\"Proofs\":[{\"PoStProof\":9,\"ProofBytes\":\"j67Zt7FnIDTt+WZ+JicmOvZJWNShtEUKQp2djqEamrWFJlJ5WWGfhpTmYSimapHhjnSJoQYddySoqKHw6klIY6INz0A4aHmF2xveYKLYcqKxaB6Izis7zWyw4CMLTc3GE93wBuajQ32V1qH5qBsTw3ELzUdlFNgClUhHWushxg7kvmqvtmh9lipXzGnPnrG9p68KnBp40dvhiMBVedNch/pP7cxMH5piwGIQxsn99sQVrZxfVy1+y0SN30t03yjc\"}],\"ChainCommitEpoch\":1287345,\"ChainCommitRand\":\"VyY9gIC10V8w8C1ltrpjqNN6mkk3xgW3Stpnp2ThNW4=\",\"Deadline\":38}", + wantEncoded: "{\"Partitions\":[{\"Index\":0,\"Skipped\":{\"elemcount\":0,\"rle\":[0],\"_type\":\"bitfield\"}}],\"Proofs\":[{\"PoStProof\":9,\"ProofBytes\":\"j67Zt7FnIDTt+WZ+JicmOvZJWNShtEUKQp2djqEamrWFJlJ5WWGfhpTmYSimapHhjnSJoQYddySoqKHw6klIY6INz0A4aHmF2xveYKLYcqKxaB6Izis7zWyw4CMLTc3GE93wBuajQ32V1qH5qBsTw3ELzUdlFNgClUhHWushxg7kvmqvtmh9lipXzGnPnrG9p68KnBp40dvhiMBVedNch/pP7cxMH5piwGIQxsn99sQVrZxfVy1+y0SN30t03yjc\"}],\"ChainCommitEpoch\":1287345,\"ChainCommitRand\":\"VyY9gIC10V8w8C1ltrpjqNN6mkk3xgW3Stpnp2ThNW4=\",\"Deadline\":38}", wantErr: false, deepEqual: true, }, @@ -235,7 +235,7 @@ func TestParseMessageParams(t *testing.T) { }, }), wantMethod: "DeclareFaultsRecovered", - wantEncoded: "{\"Recoveries\":[{\"Deadline\":1,\"Partition\":1,\"Sectors\":{\"Count\":10,\"RLE\":[1,10]}}]}", + wantEncoded: "{\"Recoveries\":[{\"Deadline\":1,\"Partition\":1,\"Sectors\":{\"elemcount\":10,\"rle\":[1,10],\"_type\":\"bitfield\"}}]}", wantErr: false, }, // from https://github.com/filecoin-project/lily/issues/892