fix(airdrop): sending an airdrop using a secondary account (better UX) (#15448)
Fixes #15382 So there is no easy way from the models and data we currently have in the client to know which account minted the owner token. So the easiest way to help the user is just to catch the error and show a better message.
This commit is contained in:
parent
20f1bfa0ea
commit
4a097cfef7
|
@ -159,5 +159,6 @@ type
|
|||
Success,
|
||||
Infura,
|
||||
Balance,
|
||||
Revert,
|
||||
Other
|
||||
|
||||
|
|
|
@ -1018,6 +1018,8 @@ QtObject:
|
|||
var errorCode = ComputeFeeErrorCode.Other
|
||||
if errorMessage.contains("403 Forbidden") or errorMessage.contains("exceed"):
|
||||
errorCode = ComputeFeeErrorCode.Infura
|
||||
if errorMessage.contains("execution reverted"):
|
||||
errorCode = ComputeFeeErrorCode.Revert
|
||||
return errorCode
|
||||
|
||||
proc burnTokens*(self: Service, communityId: string, password: string, contractUniqueKey: string, amount: Uint256, addressFrom: string) =
|
||||
|
|
|
@ -46,6 +46,9 @@ QtObject {
|
|||
if (airdropFeesResponse.errorCode === Constants.ComputeFeeErrorCode.Infura)
|
||||
return qsTr("Infura error")
|
||||
|
||||
if (airdropFeesResponse.errorCode === Constants.ComputeFeeErrorCode.Revert)
|
||||
return qsTr("Estimation reverted. Make sure you are using the account that owns the TokenMaster or Owner Token.")
|
||||
|
||||
return qsTr("Unknown error")
|
||||
}
|
||||
readonly property string totalFee: {
|
||||
|
|
|
@ -1057,6 +1057,7 @@ QtObject {
|
|||
Success,
|
||||
Infura,
|
||||
Balance,
|
||||
Revert,
|
||||
Other
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue