Skip to content

Commit

Permalink
chore(ucs01-relay): diferred -> deferred
Browse files Browse the repository at this point in the history
  • Loading branch information
PoisonPhang committed Jun 3, 2024
1 parent 17e74ae commit 1a3df60
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 130 deletions.
11 changes: 0 additions & 11 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ resolver = "2"
# NOTE: All paths must be listed out (i.e. no globs) since ifd is still broken in nix (still can't import the output of `cargo metadata` :( ). See crane.nix for where this is used.
members = [
"cosmwasm/token-factory-api",
"cosmwasm/diferred-ack-api",
"cosmwasm/ucs00-pingpong",
"cosmwasm/ucs01-relay",
"cosmwasm/ucs01-relay-api",
Expand Down Expand Up @@ -92,7 +91,6 @@ block-message = { path = "lib/block-message", default-features = fal
chain-utils = { path = "lib/chain-utils", default-features = false }
cometbls-groth16-verifier = { path = "lib/cometbls-groth16-verifier", default-features = false }
contracts = { path = "generated/rust/contracts", default-features = false }
diferred-ack-api = { path = "cosmwasm/diferred-ack-api", default-features = false }
ethereum-light-client = { path = "light-clients/ethereum-light-client", default-features = false }
ethereum-verifier = { path = "lib/ethereum-verifier", default-features = false }
gnark-key-parser = { path = "lib/gnark-key-parser", default-features = false }
Expand Down
12 changes: 0 additions & 12 deletions cosmwasm/diferred-ack-api/Cargo.toml

This file was deleted.

85 changes: 0 additions & 85 deletions cosmwasm/diferred-ack-api/src/lib.rs

This file was deleted.

1 change: 0 additions & 1 deletion cosmwasm/ucs01-relay-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ workspace = true
[dependencies]
cosmwasm-schema = { version = "2.0.0" }
cosmwasm-std = { version = "2.0.0", features = ["stargate"] }
diferred-ack-api = { workspace = true }
ethabi = { workspace = true }
go-parse-duration = { workspace = true }
prost = { workspace = true }
Expand Down
1 change: 0 additions & 1 deletion cosmwasm/ucs01-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ cosmwasm-std = { version = "2.0.0", features = ["stargate", "cosmwasm_2_0",
cw-controllers = { version = "2.0.0" }
cw-storage-plus = { version = "2.0.0" }
cw2 = { version = "2.0.0" }
diferred-ack-api = { workspace = true }
dlmalloc = { workspace = true, features = ["global"] }
ethabi = { workspace = true }
go-parse-duration = { workspace = true }
Expand Down
36 changes: 18 additions & 18 deletions cosmwasm/ucs01-relay/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use cosmwasm_std::{
};
use prost::Message;
use protos::{
diferredack::v1beta1::MsgWriteDiferredAck,
deferredack::v1beta1::MsgWriteDeferredAck,
ibc::core::channel::v1::{acknowledgement::Response, Acknowledgement},
};
use sha2::{Digest, Sha256};
Expand Down Expand Up @@ -646,7 +646,7 @@ impl<'a> TransferProtocol for Ics20Protocol<'a> {
Err(_) => return Ok(None),
};

let (mut ack_msgs, mut ack_attr, ack_dif) = match ack {
let (mut ack_msgs, mut ack_attr, ack_def) = match ack {
Ok(value) => {
let value_string = value.to_string();
(
Expand Down Expand Up @@ -678,7 +678,7 @@ impl<'a> TransferProtocol for Ics20Protocol<'a> {
None => "0-0".to_string(),
};

let diferred_packet_into = protos::diferredack::v1beta1::DiferredPacketInfo {
let deferred_packet_into = protos::deferredack::v1beta1::DeferredPacketInfo {
refund_channel_id: refund_info.refund_channel_id,
refund_port_id: refund_info.refund_port_id,
packet_src_channel_id: refund_info.packet_src_channel_id,
Expand All @@ -689,19 +689,19 @@ impl<'a> TransferProtocol for Ics20Protocol<'a> {
sequence: refund_info.packet_sequence,
};

let value = MsgWriteDiferredAck {
let value = MsgWriteDeferredAck {
sender: self.self_addr().to_string(),
diferred_packet_info: Some(diferred_packet_into),
ack: Some(ack_dif),
deferred_packet_info: Some(deferred_packet_into),
ack: Some(ack_def),
}
.encode_to_vec();

let diferred_ack_msg = CosmosMsg::<Self::CustomMsg>::Any(AnyMsg {
type_url: "/diferredack.v1beta1.MsgWriteDiferredAck".to_owned(),
let deferred_ack_msg = CosmosMsg::<Self::CustomMsg>::Any(AnyMsg {
type_url: "/deferredack.v1beta1.MsgWriteDeferredAck".to_owned(),
value: value.into(),
});

ack_msgs.append(vec![diferred_ack_msg].as_mut());
ack_msgs.append(vec![deferred_ack_msg].as_mut());
ack_attr.append(vec![("pfm", "pfm_ack_confirm".to_string())].as_mut());

IN_FLIGHT_PFM_PACKETS.remove(self.common.deps.storage, refund_key);
Expand Down Expand Up @@ -1009,7 +1009,7 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
Err(_) => return Ok(None),
};

let (mut ack_msgs, mut ack_attr, ack_dif) = match ack {
let (mut ack_msgs, mut ack_attr, ack_def) = match ack {
Ok(value) => {
let value_string = value.to_string();
(
Expand Down Expand Up @@ -1041,7 +1041,7 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
None => "0-0".to_string(),
};

let diferred_packet_into = protos::diferredack::v1beta1::DiferredPacketInfo {
let deferred_packet_into = protos::deferredack::v1beta1::DeferredPacketInfo {
refund_channel_id: refund_info.refund_channel_id,
refund_port_id: refund_info.refund_port_id,
packet_src_channel_id: refund_info.packet_src_channel_id,
Expand All @@ -1052,19 +1052,19 @@ impl<'a> TransferProtocol for Ucs01Protocol<'a> {
sequence,
};

let value = MsgWriteDiferredAck {
let value = MsgWriteDeferredAck {
sender: self.self_addr().to_string(),
diferred_packet_info: Some(diferred_packet_into),
ack: Some(ack_dif),
deferred_packet_info: Some(deferred_packet_into),
ack: Some(ack_def),
}
.encode_to_vec();

let diferred_ack_msg = CosmosMsg::<Self::CustomMsg>::Any(AnyMsg {
type_url: "/diferredack.v1beta1.MsgWriteDiferredAck".to_owned(),
let deferred_ack_msg = CosmosMsg::<Self::CustomMsg>::Any(AnyMsg {
type_url: "/deferredack.v1beta1.MsgWriteDeferredAck".to_owned(),
value: value.into(),
});

ack_msgs.append(vec![diferred_ack_msg].as_mut());
ack_msgs.append(vec![deferred_ack_msg].as_mut());
ack_attr.append(vec![("pfm", "pfm_ack".to_string())].as_mut());

IN_FLIGHT_PFM_PACKETS.remove(self.common.deps.storage, refund_key);
Expand Down Expand Up @@ -1171,7 +1171,7 @@ mod tests {
}

#[test]
fn receive_transfer_destination_collision_yields_different_hashes() {
fn receive_transfer_destination_collision_yields_defferent_hashes() {
let source_endpoint_1 = IbcEndpoint {
port_id: "wasm.0xDEADC0DE".into(),
channel_id: "channel-1".into(),
Expand Down

0 comments on commit 1a3df60

Please sign in to comment.