Skip to content

Commit 7dee1a9

Browse files
committed
Minumum native amount is the error threshold
1 parent 66af915 commit 7dee1a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/code/currency/validation.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ func validateCoreMintClientExchangeData(ctx context.Context, data code_data.Prov
4646

4747
rateErrorThreshold := big.NewFloat(0.001).SetPrec(defaultPrecision)
4848
quarkErrorThreshold := big.NewFloat(1000).SetPrec(defaultPrecision)
49+
nativeAmountErrorThreshold := new(big.Float).Quo(minTransferValue, big.NewFloat(2.0))
4950

50-
if clientNativeAmount.Cmp(minTransferValue) < 0 {
51+
if clientNativeAmount.Cmp(nativeAmountErrorThreshold) < 0 {
5152
return false, "native amount is less than minimum transfer value", nil
5253
}
5354

@@ -123,7 +124,7 @@ func validateCurrencyLaunchpadClientExchangeData(ctx context.Context, data code_
123124
"min_transfer_value": minTransferValue,
124125
})
125126

126-
if clientNativeAmount.Cmp(minTransferValue) < 0 {
127+
if clientNativeAmount.Cmp(nativeAmountErrorThreshold) < 0 {
127128
log.Info("native amount is less than minimum transfer value")
128129
return false, "native amount is less than minimum transfer value", nil
129130
}

0 commit comments

Comments
 (0)