Skip to content

Commit

Permalink
Merge branch 'dev' into version-bump-v1.10.10
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Sep 19, 2023
2 parents 2cadf70 + 856df85 commit 2f93bd1
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 96 deletions.
166 changes: 84 additions & 82 deletions proto/pb/sync/sync.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions proto/sync/sync.proto
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ message ChangeProof {
}

message RangeProof {
repeated ProofNode start = 1;
repeated ProofNode end = 2;
repeated ProofNode start_proof = 1;
repeated ProofNode end_proof = 2;
repeated KeyValue key_values = 3;
}

Expand Down
14 changes: 7 additions & 7 deletions x/merkledb/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,9 @@ func (proof *RangeProof) ToProto() *pb.RangeProof {
}

return &pb.RangeProof{
Start: startProof,
End: endProof,
KeyValues: keyValues,
StartProof: startProof,
EndProof: endProof,
KeyValues: keyValues,
}
}

Expand All @@ -430,15 +430,15 @@ func (proof *RangeProof) UnmarshalProto(pbProof *pb.RangeProof) error {
return ErrNilRangeProof
}

proof.StartProof = make([]ProofNode, len(pbProof.Start))
for i, protoNode := range pbProof.Start {
proof.StartProof = make([]ProofNode, len(pbProof.StartProof))
for i, protoNode := range pbProof.StartProof {
if err := proof.StartProof[i].UnmarshalProto(protoNode); err != nil {
return err
}
}

proof.EndProof = make([]ProofNode, len(pbProof.End))
for i, protoNode := range pbProof.End {
proof.EndProof = make([]ProofNode, len(pbProof.EndProof))
for i, protoNode := range pbProof.EndProof {
if err := proof.EndProof[i].UnmarshalProto(protoNode); err != nil {
return err
}
Expand Down
10 changes: 5 additions & 5 deletions x/sync/g_db/db_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,16 @@ func (s *DBServer) GetRangeProof(

protoProof := &pb.GetRangeProofResponse{
Proof: &pb.RangeProof{
Start: make([]*pb.ProofNode, len(proof.StartProof)),
End: make([]*pb.ProofNode, len(proof.EndProof)),
KeyValues: make([]*pb.KeyValue, len(proof.KeyValues)),
StartProof: make([]*pb.ProofNode, len(proof.StartProof)),
EndProof: make([]*pb.ProofNode, len(proof.EndProof)),
KeyValues: make([]*pb.KeyValue, len(proof.KeyValues)),
},
}
for i, node := range proof.StartProof {
protoProof.Proof.Start[i] = node.ToProto()
protoProof.Proof.StartProof[i] = node.ToProto()
}
for i, node := range proof.EndProof {
protoProof.Proof.End[i] = node.ToProto()
protoProof.Proof.EndProof[i] = node.ToProto()
}
for i, kv := range proof.KeyValues {
protoProof.Proof.KeyValues[i] = &pb.KeyValue{
Expand Down

0 comments on commit 2f93bd1

Please sign in to comment.