Skip to content

Commit

Permalink
chore: updated sdk (#262)
Browse files Browse the repository at this point in the history
* chore: log error with context

* chore: bumped omni-relayer version

* chore: stringify events to make them readable
  • Loading branch information
frolvanya authored Feb 15, 2025
1 parent 763b7d4 commit cfae045
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
20 changes: 10 additions & 10 deletions omni-relayer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion omni-relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "omni-relayer"
version = "0.3.3"
version = "0.3.4"
edition = "2021"
resolver = "2"
repository = "https://github.com/Near-One/omni-bridge"
Expand Down
2 changes: 1 addition & 1 deletion omni-relayer/src/utils/near.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ pub async fn handle_streamer_message(
.collect::<Vec<_>>();

for log in nep_locker_event_logs {
info!("Received OmniBridgeEvent: {:?}", log);
info!("Received OmniBridgeEvent: {}", log.to_log_string());

match log {
OmniBridgeEvent::InitTransferEvent {
Expand Down
46 changes: 23 additions & 23 deletions omni-relayer/src/workers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ async fn process_near_transfer_event(
);
};

info!("Trying to process InitTransferEvent/FinTransferEvent/UpdateFeeEvent",);
info!("Trying to process InitTransferEvent/FinTransferEvent/UpdateFeeEvent");

#[cfg(not(feature = "disable_fee_check"))]
match utils::fee::is_fee_sufficient(
Expand Down Expand Up @@ -623,15 +623,15 @@ async fn process_near_transfer_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to sign transfer, retrying: {}", near_rpc_error);
warn!("Failed to sign transfer, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to sign transfer: {}", near_rpc_error);
anyhow::bail!("Failed to sign transfer: {near_rpc_error:?}");
}
};
}
anyhow::bail!("Failed to sign transfer: {}", err);
anyhow::bail!("Failed to sign transfer: {err:?}");
}
}
}
Expand Down Expand Up @@ -919,15 +919,15 @@ async fn process_evm_init_transfer_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to finalize transfer, retrying: {}", near_rpc_error);
warn!("Failed to finalize transfer, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to finalize transfer: {}", near_rpc_error);
anyhow::bail!("Failed to finalize transfer: {near_rpc_error:?}");
}
};
}
anyhow::bail!("Failed to finalize transfer: {}", err);
anyhow::bail!("Failed to finalize transfer: {err:?}");
}
}
}
Expand Down Expand Up @@ -1068,16 +1068,16 @@ async fn process_solana_init_transfer_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to finalize transfer, retrying: {}", near_rpc_error);
warn!("Failed to finalize transfer, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to finalize transfer: {}", near_rpc_error);
anyhow::bail!("Failed to finalize transfer: {near_rpc_error:?}");
}
};
}

anyhow::bail!("Failed to finalize transfer: {}", err);
anyhow::bail!("Failed to finalize transfer: {err:?}");
}
}
}
Expand Down Expand Up @@ -1194,15 +1194,15 @@ async fn process_evm_fin_transfer_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to claim fee, retrying: {}", near_rpc_error);
warn!("Failed to claim fee, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to claim fee: {}", near_rpc_error);
anyhow::bail!("Failed to claim fee: {near_rpc_error:?}");
}
};
}
anyhow::bail!("Failed to claim fee: {}", err);
anyhow::bail!("Failed to claim fee: {err:?}");
}
}
}
Expand Down Expand Up @@ -1260,18 +1260,18 @@ async fn process_solana_fin_transfer_event(
Ok(EventAction::Remove)
}
Err(err) => {
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
if let BridgeSdkError::NearRpcError(ref near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to claim fee, retrying: {}", near_rpc_error);
warn!("Failed to claim fee, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to claim fee: {}", near_rpc_error);
anyhow::bail!("Failed to claim fee: {err:?}");
}
};
}
anyhow::bail!("Failed to claim fee: {}", err);
anyhow::bail!("Failed to claim fee: {err:?}");
}
}
}
Expand Down Expand Up @@ -1383,16 +1383,16 @@ async fn process_evm_deploy_token_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to bind token, retrying: {}", near_rpc_error);
warn!("Failed to bind token, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to bind token: {}", near_rpc_error);
anyhow::bail!("Failed to bind token: {near_rpc_error:?}");
}
};
}

anyhow::bail!("Failed to bind token: {}", err);
anyhow::bail!("Failed to bind token: {err:?}");
}
}
}
Expand Down Expand Up @@ -1451,16 +1451,16 @@ async fn process_solana_deploy_token_event(
if let BridgeSdkError::NearRpcError(near_rpc_error) = err {
match near_rpc_error {
NearRpcError::NonceError | NearRpcError::FinalizationError => {
warn!("Failed to bind token, retrying: {}", near_rpc_error);
warn!("Failed to bind token, retrying: {near_rpc_error:?}");
return Ok(EventAction::Retry);
}
_ => {
anyhow::bail!("Failed to bind token: {}", near_rpc_error);
anyhow::bail!("Failed to bind token: {near_rpc_error:?}");
}
};
}

anyhow::bail!("Failed to bind token: {}", err);
anyhow::bail!("Failed to bind token: {err:?}");
}
}
}
Expand Down

0 comments on commit cfae045

Please sign in to comment.