Skip to content

Commit

Permalink
Merge fixes from release 1.17.0 (#1097)
Browse files Browse the repository at this point in the history
* Fix transaction view balance check (#1095)

* fix ui checks

* fix computed

* Fix bridge external decimals (#1096)

* fix ui checks

* fix computed

* fix check
  • Loading branch information
Nikita-Polyakov authored Jul 10, 2023
1 parent b340cab commit fa6d7f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/store/assets/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async function getEthRegisteredAssets(context: ActionContext<any, any>): Promise
for (const asset of networkAssets) {
const soraAddress = asset.address;
const address = asset.externalAddress || (await rootDispatch.web3.getEvmTokenAddressByAssetId(soraAddress));
const decimals = +asset.externalDecimals ?? (await ethersUtil.getAssetDecimals(address));
// [TODO] fix js-lib: externalDecimals = 0 by default, what could be with nft
const decimals = +asset.externalDecimals || (await ethersUtil.getAssetDecimals(address));

registeredAssets.push({
[soraAddress]: {
Expand Down
9 changes: 6 additions & 3 deletions src/views/BridgeTransaction.vue
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,18 @@ export default class BridgeTransaction extends Mixins(
if (!this.asset || !this.amount || !fee) return false;
return hasInsufficientBalance(this.asset, this.amount, fee, !this.isSoraToEvm);
return this.txIsUnsigned && hasInsufficientBalance(this.asset, this.amount, fee, !this.isSoraToEvm);
}
get isInsufficientXorForFee(): boolean {
return hasInsufficientXorForFee(this.xor, this.txSoraNetworkFee);
return this.txIsUnsigned && hasInsufficientXorForFee(this.xor, this.txSoraNetworkFee);
}
get isInsufficientEvmNativeTokenForFee(): boolean {
return hasInsufficientEvmNativeTokenForFee(this.externalBalance, this.txEvmNetworkFee);
return (
((this.txIsUnsigned && !this.isSoraToEvm) || (!this.txIsUnsigned && this.isSoraToEvm)) &&
hasInsufficientEvmNativeTokenForFee(this.externalBalance, this.txEvmNetworkFee)
);
}
get isAnotherEvmAddress(): boolean {
Expand Down

0 comments on commit fa6d7f7

Please sign in to comment.