Skip to content

Commit

Permalink
check finalization stage in resume
Browse files Browse the repository at this point in the history
  • Loading branch information
ridev6 committed Apr 18, 2024
1 parent 638bfd7 commit ed45bab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ride/voting_emission.ride
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ func deletePool(amountAssetId: String, priceAssetId: String) = {
# statuses are returned within 3 days
@Callable(i)
func resume(amountAssetId: String, priceAssetId: String, slippageToleranceOrMinOutAmount: Int) = {
let finalizationStageOrUnit = this.getInteger(keyFinalizationStage)

let (poolAddress, lpAssetId) = getPoolInfo(
amountAssetId,
priceAssetId
Expand All @@ -898,6 +900,7 @@ func resume(amountAssetId: String, priceAssetId: String, slippageToleranceOrMinO
).valueOrErrorMessage("invalid resumption fee")

strict checks = [
finalizationStageOrUnit == unit || "finalization is in progress".throwErr(),
feePayment.assetId == wxAssetId || throwErr("invalid fee payment asset id"),
feePayment.amount == resumptionFee || throwErr("invalid fee payment amount"),
amountAssetVerified && priceAssetVerified || throwErr("both assets should be verified")
Expand Down

0 comments on commit ed45bab

Please sign in to comment.