Skip to content

Commit

Permalink
fix empty parameters error
Browse files Browse the repository at this point in the history
  • Loading branch information
BoogVAr committed Jan 4, 2024
1 parent 40769c4 commit 20ecd9d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions evm_loader/lib/src/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ async fn load_config() -> Result<Config, NeonError> {
async fn dispatch(method_str: &str, params_str: &str) -> Result<String, NeonError> {
let method: LibMethods = method_str.parse()?;
let config = load_config().await?;
let RequestWithSlot {
slot,
tx_index_in_block,
} = serde_json::from_str(params_str).map_err(|_| params_to_neon_error(params_str))?;
let mut slot: Option<u64> = None;
let mut tx_index_in_block: Option<u64> = None;
if params_str != "" {
let RequestWithSlot {
slot,
tx_index_in_block,
} = serde_json::from_str(params_str).map_err(|_| params_to_neon_error(params_str))?;
}
let rpc = build_rpc(&config, slot, tx_index_in_block).await?;
let singer = build_signer(&config)?;

Expand Down

0 comments on commit 20ecd9d

Please sign in to comment.