fix: remove subdomain when releasing a username

This commit is contained in:
Richard Ramos 2022-08-04 10:32:38 -04:00
parent 148c677b66
commit e0cd28d5f4
1 changed files with 10 additions and 2 deletions

View File

@ -277,7 +277,11 @@ QtObject:
chainId = self.networkService.getNetworkForEns().chainId chainId = self.networkService.getNetworkForEns().chainId
txData = ens_utils.buildTransaction(parseAddress(address), 0.u256) txData = ens_utils.buildTransaction(parseAddress(address), 0.u256)
let resp = status_ens.releaseEstimate(chainId, %txData, ensUsername) var userNameNoDomain = ensUsername
if ensUsername.endsWith(ens_utils.STATUS_DOMAIN):
userNameNoDomain = ensUsername.replace(ens_utils.STATUS_DOMAIN, "")
let resp = status_ens.releaseEstimate(chainId, %txData, userNameNoDomain)
result = resp.result.getInt result = resp.result.getInt
except Exception as e: except Exception as e:
error "error occurred", procName="releaseEnsEstimate", msg = e.msg error "error occurred", procName="releaseEnsEstimate", msg = e.msg
@ -305,7 +309,11 @@ QtObject:
txData = ens_utils.buildTransaction(parseAddress(address), 0.u256, gas, gasPrice, txData = ens_utils.buildTransaction(parseAddress(address), 0.u256, gas, gasPrice,
eip1559Enabled, maxPriorityFeePerGas, maxFeePerGas) eip1559Enabled, maxPriorityFeePerGas, maxFeePerGas)
let resp = status_ens.release(chainId, %txData, password, ensUsername) var userNameNoDomain = ensUsername
if ensUsername.endsWith(ens_utils.STATUS_DOMAIN):
userNameNoDomain = ensUsername.replace(ens_utils.STATUS_DOMAIN, "")
let resp = status_ens.release(chainId, %txData, password, userNameNoDomain)
let hash = resp.result.getStr let hash = resp.result.getStr
let ensUsernamesAddress = self.getEnsRegisteredAddress() let ensUsernamesAddress = self.getEnsRegisteredAddress()