Return Ok(None) when the registrar contract returns empty slice (#11257)
This commit is contained in:
parent
eb565a7e2b
commit
93f700d961
@ -44,12 +44,12 @@ impl ServiceTransactionChecker {
|
|||||||
client: &C,
|
client: &C,
|
||||||
tx: &SignedTransaction
|
tx: &SignedTransaction
|
||||||
) -> Result<bool, String> {
|
) -> Result<bool, String> {
|
||||||
let sender = tx.sender();
|
|
||||||
// Skip checking the contract if the transaction does not have zero gas price
|
// Skip checking the contract if the transaction does not have zero gas price
|
||||||
if !tx.gas_price.is_zero() {
|
if !tx.gas_price.is_zero() {
|
||||||
return Ok(false)
|
return Ok(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let sender = tx.sender();
|
||||||
self.check_address(client, sender)
|
self.check_address(client, sender)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,9 +42,10 @@ pub trait RegistrarClient: CallContract + Send + Sync {
|
|||||||
let id = encode_input(hashed_key, DNS_A_RECORD);
|
let id = encode_input(hashed_key, DNS_A_RECORD);
|
||||||
|
|
||||||
let address_bytes = self.call_contract(block, registrar_address, id)?;
|
let address_bytes = self.call_contract(block, registrar_address, id)?;
|
||||||
|
if address_bytes.is_empty() {
|
||||||
|
return Ok(None)
|
||||||
|
}
|
||||||
let address = decode_output(&address_bytes).map_err(|e| e.to_string())?;
|
let address = decode_output(&address_bytes).map_err(|e| e.to_string())?;
|
||||||
|
|
||||||
if address.is_zero() {
|
if address.is_zero() {
|
||||||
Ok(None)
|
Ok(None)
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user