Skip to content

Commit

Permalink
Merge pull request #1460 from novasamatech/hotfix/7.10.1
Browse files Browse the repository at this point in the history
rc/7.10.1
  • Loading branch information
antonijzelinskij authored Apr 4, 2024
2 parents 9216c59 + 9349768 commit b259fe8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pr_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Check if "rc" is present in github.ref
- name: Check if "rc" or "hotfix" is present in github.ref
id: check_ref
run: |
echo ${{ github.head_ref || github.ref_name }}
if [[ "${{ github.head_ref || github.ref_name }}" == *"rc"* ]]; then
if [[ "${{ github.head_ref || github.ref_name }}" == "rc/"* || "${{ github.head_ref || github.ref_name }}" == "hotfix/"* ]]; then
echo "ref_contains_rc=1" >> $GITHUB_OUTPUT
else
echo "ref_contains_rc=0" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
id: extract_version
run: |
VERSION=${{ github.head_ref }}
VERSION=${VERSION/hotfix/rc} # Replace "hotfix" with "rc"
echo "::set-output name=version::${VERSION#*rc/}"
- uses: tibdex/github-app-token@v1
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
// App version
versionName = '7.10.0'
versionCode = 127
versionName = '7.10.1'
versionCode = 128

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import io.novafoundation.nova.feature_wallet_api.domain.model.deliveryFeePart
import io.novafoundation.nova.feature_wallet_api.domain.model.networkFeePart
import io.novasama.substrate_sdk_android.hash.isPositive

class CannotDropBelowEdBeforePayingDeliveryFeeValidation(
class CannotDropBelowEdWhenPayingDeliveryFeeValidation(
private val assetSourceRegistry: AssetSourceRegistry
) : AssetTransfersValidation {

Expand All @@ -35,17 +35,17 @@ class CannotDropBelowEdBeforePayingDeliveryFeeValidation(
val crossChainFeePlanks = value.crossChainFee?.networkFee?.amountByRequestedAccount.orZero()

val sendingAmount = value.transfer.amountInPlanks + crossChainFeePlanks
val requiredAmountBeforePayingDeliveryFee = sendingAmount + networkFeePlanks + existentialDeposit
val requiredAmountWhenPayingDeliveryFee = sendingAmount + networkFeePlanks + deliveryFeePart + existentialDeposit

val balanceCountedTowardsEd = value.originUsedAsset.balanceCountedTowardsEDInPlanks

return when {
!paysDeliveryFee -> valid()

requiredAmountBeforePayingDeliveryFee <= balanceCountedTowardsEd -> valid()
requiredAmountWhenPayingDeliveryFee <= balanceCountedTowardsEd -> valid()

else -> {
val availableBalance = (balanceCountedTowardsEd - networkFeePlanks - crossChainFeePlanks - existentialDeposit).atLeastZero()
val availableBalance = (balanceCountedTowardsEd - networkFeePlanks - deliveryFeePart - crossChainFeePlanks - existentialDeposit).atLeastZero()

validationError(
ToStayAboveEdBeforePayingDeliveryFees(
Expand All @@ -60,4 +60,4 @@ class CannotDropBelowEdBeforePayingDeliveryFeeValidation(

fun AssetTransfersValidationSystemBuilder.cannotDropBelowEdBeforePayingDeliveryFee(
assetSourceRegistry: AssetSourceRegistry
) = validate(CannotDropBelowEdBeforePayingDeliveryFeeValidation(assetSourceRegistry))
) = validate(CannotDropBelowEdWhenPayingDeliveryFeeValidation(assetSourceRegistry))

0 comments on commit b259fe8

Please sign in to comment.