Check and show an error message if we know user does not have enough ETH to send

pull/509/head
Hwee-Boon Yar 6 years ago
parent 40171fc889
commit 5af064b91a
  1. 1
      AlphaWallet/Localization/en.lproj/Localizable.strings
  2. 1
      AlphaWallet/Localization/es.lproj/Localizable.strings
  3. 1
      AlphaWallet/Localization/zh-Hans.lproj/Localizable.strings
  4. 4
      AlphaWallet/Transfer/ViewControllers/SendViewController.swift

@ -244,6 +244,7 @@
"a.claim.ticket.dollarCostLabel.title" = "EQUIVALENT IN USD";
"a.send.receive.button.title" = "Send/Receive";
"a.send.recipient.address.title" = "ADDRESS";
"a.send.balance.insufficient" = "Insufficient balance";
"accounts.confirm.delete.title" = "Are you sure you would like to delete this wallet?";
"accounts.confirm.delete.message" = "Make sure you have backup of your wallet.";
"accounts.confirm.delete.okTitle" = "Delete";

@ -244,6 +244,7 @@
"a.claim.ticket.dollarCostLabel.title" = "EQUIVALENT IN USD";
"a.send.receive.button.title" = "Send/Receive";
"a.send.recipient.address.title" = "ADDRESS";
"a.send.balance.insufficient" = "Insufficient balance";
"accounts.confirm.delete.title" = "Are you sure you would like to delete this wallet?";
"accounts.confirm.delete.message" = "Make sure you have backup of your wallet.";
"accounts.confirm.delete.okTitle" = "Delete";

@ -244,6 +244,7 @@
"a.claim.ticket.dollarCostLabel.title" = "等价于美金";
"a.send.receive.button.title" = "发送/接收";
"a.send.recipient.address.title" = "地址";
"a.send.balance.insufficient" = "Insufficient balance";
"accounts.confirm.delete.title" = "你确认要删除这个钱包么?";
"accounts.confirm.delete.message" = "请确认你已经做好钱包备份.";
"accounts.confirm.delete.okTitle" = "删除";

@ -315,6 +315,10 @@ class SendViewController: UIViewController {
return displayError(error: SendInputErrors.wrongInput)
}
if case .ether = transferType, let balance = session.balance, balance.value < value {
return displayError(title: R.string.localizable.aSendBalanceInsufficient(), error: Errors.invalidAmount)
}
let transaction = UnconfirmedTransaction(
transferType: transferType,
value: value,

Loading…
Cancel
Save