-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Failed Ack Handling #582
Changes from 8 commits
80d03ec
48bf343
0406071
ab5ae69
1b20245
fd1d68d
9a08456
2ef1dcd
e368152
9884292
094c340
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ andromeda-std = { workspace = true } | |
|
||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] | ||
cw-multi-test = { workspace = true, optional = true } | ||
cw-orch = "=0.23.0" | ||
cw-orch = "=0.24.1" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistent Only 2 out of 49
🔗 Analysis chainDependency update looks good, but let's verify consistency. The update of To ensure this update is intentional and consistent across the project, please run the following script: This script will help us confirm that the version update has been applied consistently across all relevant Cargo.toml files in the project. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify cw-orch version consistency across all Cargo.toml files
# Test: Check for any Cargo.toml files that don't use cw-orch version 0.24.1
# Expect: No output if all files are consistent
rg -U 'cw-orch.*=.*(?!0\.24\.1)' $(fd Cargo.toml)
# Test: Count occurrences of cw-orch version 0.24.1
# Expect: A number equal to the total number of Cargo.toml files that use cw-orch
echo "Number of Cargo.toml files using cw-orch 0.24.1:"
rg -c 'cw-orch.*=.*0\.24\.1' $(fd Cargo.toml) | awk -F: '{sum += $2} END {print sum}'
Length of output: 5169 Script: #!/bin/bash
# Description: Verify cw-orch version consistency across all Cargo.toml files
# Test: Check for any Cargo.toml files that don't use cw-orch version 0.24.1
# Using --pcre2 to enable look-around in regex
rg --pcre2 -U 'cw-orch\s*=\s*"(?!0\.24\.1)' $(fd Cargo.toml)
# Test: Count occurrences of cw-orch version 0.24.1
echo "Number of Cargo.toml files using cw-orch 0.24.1:"
rg -c 'cw-orch\s*=\s*"0\.24\.1"' $(fd Cargo.toml) | awk -F: '{sum += $2} END {print sum}'
# Test: Count total number of Cargo.toml files
echo "Total number of Cargo.toml files:"
fd Cargo.toml | wc -l
Length of output: 5552
joemonem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[dev-dependencies] | ||
# andromeda-testing = { workspace = true, optional = true } |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -11,7 +11,10 @@ use cosmwasm_std::{ | |||||||||||||||||||||
}; | ||||||||||||||||||||||
|
||||||||||||||||||||||
use crate::ibc::{IBCLifecycleComplete, SudoMsg}; | ||||||||||||||||||||||
use crate::reply::{on_reply_create_ado, on_reply_ibc_hooks_packet_send, on_reply_ibc_transfer}; | ||||||||||||||||||||||
use crate::reply::{ | ||||||||||||||||||||||
on_reply_create_ado, on_reply_ibc_hooks_packet_send, on_reply_ibc_transfer, | ||||||||||||||||||||||
on_reply_refund_ibc_transfer_with_msg, | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
use crate::state::CURR_CHAIN; | ||||||||||||||||||||||
use crate::{execute, query, sudo}; | ||||||||||||||||||||||
|
||||||||||||||||||||||
|
@@ -44,13 +47,24 @@ pub fn instantiate( | |||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
#[cfg_attr(not(feature = "library"), entry_point)] | ||||||||||||||||||||||
pub fn reply(deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractError> { | ||||||||||||||||||||||
pub fn reply(mut deps: DepsMut, env: Env, msg: Reply) -> Result<Response, ContractError> { | ||||||||||||||||||||||
if msg.result.is_err() { | ||||||||||||||||||||||
return Err(ContractError::Std(StdError::generic_err(format!( | ||||||||||||||||||||||
"{}:{}", | ||||||||||||||||||||||
msg.id, | ||||||||||||||||||||||
msg.result.unwrap_err() | ||||||||||||||||||||||
)))); | ||||||||||||||||||||||
match ReplyId::from_repr(msg.id) { | ||||||||||||||||||||||
Some(ReplyId::IBCTransferWithMsg) => { | ||||||||||||||||||||||
return on_reply_refund_ibc_transfer_with_msg( | ||||||||||||||||||||||
deps.branch(), | ||||||||||||||||||||||
env.clone(), | ||||||||||||||||||||||
msg.clone(), | ||||||||||||||||||||||
); | ||||||||||||||||||||||
Comment on lines
+54
to
+58
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid Unnecessary Cloning of In the call to Apply this diff to avoid cloning: return on_reply_refund_ibc_transfer_with_msg(
deps.branch(),
- env.clone(),
- msg.clone(),
+ &env,
+ &msg,
); Ensure that the function 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||
} | ||||||||||||||||||||||
_ => { | ||||||||||||||||||||||
return Err(ContractError::Std(StdError::generic_err(format!( | ||||||||||||||||||||||
"{}:{}", | ||||||||||||||||||||||
msg.id, | ||||||||||||||||||||||
msg.result.unwrap_err() | ||||||||||||||||||||||
)))) | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
match ReplyId::from_repr(msg.id) { | ||||||||||||||||||||||
|
@@ -83,9 +97,10 @@ pub fn execute( | |||||||||||||||||||||
packet, | ||||||||||||||||||||||
), | ||||||||||||||||||||||
ExecuteMsg::Send { message } => execute::send(execute_env, message), | ||||||||||||||||||||||
ExecuteMsg::TriggerRelay { packet_sequence } => { | ||||||||||||||||||||||
execute::trigger_relay(execute_env, packet_sequence) | ||||||||||||||||||||||
} | ||||||||||||||||||||||
ExecuteMsg::TriggerRelay { | ||||||||||||||||||||||
packet_sequence, | ||||||||||||||||||||||
packet_ack_msg, | ||||||||||||||||||||||
} => execute::trigger_relay(execute_env, packet_sequence, packet_ack_msg), | ||||||||||||||||||||||
ExecuteMsg::UpsertKeyAddress { key, value } => { | ||||||||||||||||||||||
execute::upsert_key_address(execute_env, key, value) | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Inconsistent
cw-orch
Dependency Versions DetectedThe
cw-orch
dependency is not updated to version=0.24.1
in the followingCargo.toml
files:🔗 Analysis chain
Dependency version update looks good.
The
cw-orch
dependency has been updated from version 0.23.0 to 0.24.1. This change is consistent with updates made across multiple packages in the project, as mentioned in the AI-generated summary.To ensure consistency across the project, let's verify this update in other packages:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 100
Script:
Length of output: 11382
Script:
Length of output: 9643