Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc committed Jul 12, 2023
1 parent 9973dcb commit 9052982
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/common/src/precompile/liquid_crowdloan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ where
Action::GetRedeemCurrency => {
let currency_id = <module_liquid_crowdloan::Pallet<Runtime>>::redeem_currency();
let address = <Runtime as module_prices::Config>::Erc20InfoMapping::encode_evm_address(currency_id)
.unwrap_or_default();
.ok_or_else(|| PrecompileFailure::Revert {
exit_status: ExitRevert::Reverted,
output: "LiquidCrowdloan redeem currency not found".into(),
cost: target_gas_limit(target_gas).unwrap_or_default(),
})?;

log::debug!(target: "evm", "liuqid_crowdloan: GetRedeemCurrency output: {:?}", currency_id);
Ok(PrecompileOutput {
Expand Down

0 comments on commit 9052982

Please sign in to comment.