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:
Jonathan Rainville 2024-07-12 13:28:25 -04:00 committed by GitHub
parent 20f1bfa0ea
commit 4a097cfef7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 0 deletions

View File

@ -159,5 +159,6 @@ type
Success,
Infura,
Balance,
Revert,
Other

View File

@ -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) =

View File

@ -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: {

View File

@ -1057,6 +1057,7 @@ QtObject {
Success,
Infura,
Balance,
Revert,
Other
}