Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit e07c2cc

Browse files
authored
Merge pull request #2093 from OpenBazaar/brian.fixDisputeBug
Fix input values for legacy dispute resolutions
2 parents 54560b6 + 4b94562 commit e07c2cc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

repo/dispute_resolution.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
package repo
22

33
import (
4+
"math/big"
5+
"strconv"
6+
47
"github.com/OpenBazaar/openbazaar-go/pb"
58
"github.com/golang/protobuf/proto"
6-
"math/big"
79
)
810

911
// ToV5DisputeResolution scans through the dispute resolution looking for any deprecated fields and
@@ -14,6 +16,13 @@ func ToV5DisputeResolution(disputeResolution *pb.DisputeResolution) *pb.DisputeR
1416
return newDisputeResolution
1517
}
1618

19+
for i, input := range disputeResolution.Payout.Inputs {
20+
if input.Value != 0 && input.BigValue == "" {
21+
input.BigValue = strconv.FormatUint(input.Value, 10)
22+
newDisputeResolution.Payout.Inputs[i] = input
23+
}
24+
}
25+
1726
if disputeResolution.Payout.BuyerOutput != nil &&
1827
disputeResolution.Payout.BuyerOutput.Amount != 0 &&
1928
disputeResolution.Payout.BuyerOutput.BigAmount == "" {

0 commit comments

Comments
 (0)