Commit 93f700d9 authored by David's avatar David Committed by Marek Kotewicz

Return Ok(None) when the registrar contract returns empty slice (#11257)

parent eb565a7e
Pipeline #62714 passed with stages
......@@ -44,12 +44,12 @@ impl ServiceTransactionChecker {
client: &C,
tx: &SignedTransaction
) -> Result<bool, String> {
let sender = tx.sender();
// Skip checking the contract if the transaction does not have zero gas price
if !tx.gas_price.is_zero() {
return Ok(false)
}
let sender = tx.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 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())?;
if address.is_zero() {
Ok(None)
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment