Skip to content

Commit

Permalink
chore: set astria dependencies to development branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperFluffy committed Oct 16, 2024
1 parent 31fca38 commit 42e30d4
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 25 deletions.
29 changes: 26 additions & 3 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ ibc-proto = { version = "0.41.0", features = ["serde"] }
ibc-telemetry = { version = "0.26.4", path = "../telemetry", optional = true }
ibc-relayer-types = { version = "0.26.4", path = "../relayer-types", features = ["mocks"] }

astria-core = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0" }
astria-sequencer-client = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0", features = [ "http" ] }
astria-core = { git = "https://github.com/astriaorg/astria", branch = "ENG-912/rename-signed-transaction" }
astria-sequencer-client = { git = "https://github.com/astriaorg/astria", branch = "ENG-912/rename-signed-transaction", features = [ "http" ] }
ed25519-consensus = "2.1.0"
ibc-types = "0.12.0"
jmt = "0.6"
Expand Down
26 changes: 12 additions & 14 deletions crates/relayer/src/chain/astria/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,12 @@ impl AstriaEndpoint {
SigningKey,
VerificationKey,
},
generated::protocol::transactions::v1alpha1::Ics20Withdrawal as RawIcs20Withdrawal,
generated::protocol::transaction::v1alpha1::Ics20Withdrawal as RawIcs20Withdrawal,
primitive::v1::Address,
protocol::transaction::v1alpha1::{
action::Ics20Withdrawal,
Action,
TransactionParams,
UnsignedTransaction,
TransactionBody,
},
Protobuf as _,
};
Expand Down Expand Up @@ -287,20 +286,19 @@ impl AstriaEndpoint {
.await
.map_err(|e| Error::other(Box::new(e)))?;

let unsigned_tx = UnsignedTransaction {
params: TransactionParams::builder()
.nonce(nonce.nonce)
.chain_id(self.id().to_string())
.build(),
actions,
};

let signed_tx = unsigned_tx.into_signed(&SigningKey::from(signing_key.to_bytes()));
let tx_bytes = signed_tx.into_raw().encode_to_vec();
let tx = TransactionBody::builder()
.nonce(nonce.nonce)
.chain_id(self.id().to_string())
.actions(actions)
.try_build()
.map_err(|e| Error::other_with_string(format!("{e:?}")))?
.sign(&SigningKey::from(signing_key.to_bytes()))
.into_raw()
.encode_to_vec();

let resp = self
.sequencer_client
.broadcast_tx_sync(tx_bytes)
.broadcast_tx_sync(tx)
.await
.map_err(|e| Error::other(e.into()))?;
Ok(resp)
Expand Down
4 changes: 2 additions & 2 deletions crates/relayer/src/keyring/ed25519_key_pair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ impl SigningKeyPair for Ed25519KeyPair {
let verification_key =
VerificationKey::try_from(self.signing_key.verifying_key().to_bytes())
.expect("can convert ed25519 public key bytes to astria verification key");
let address = Address::builder()
.array(verification_key.address_bytes())
let address: Address = Address::builder()
.array(*verification_key.address_bytes())
.prefix("astria")
.try_build()
.expect("can build astria address from ed25519 public key");
Expand Down
9 changes: 5 additions & 4 deletions crates/relayer/src/transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,22 +208,22 @@ fn build_transfer_message_astria(
let timeout_height = match timeout_height {
// TODO: update astria IbcHeight to support optional?
TimeoutHeight::At(height) => {
astria_core::generated::protocol::transactions::v1alpha1::IbcHeight {
astria_core::generated::protocol::transaction::v1alpha1::IbcHeight {
revision_number: height.revision_number(),
revision_height: height.revision_height(),
}
}
TimeoutHeight::Never => {
astria_core::generated::protocol::transactions::v1alpha1::IbcHeight {
astria_core::generated::protocol::transaction::v1alpha1::IbcHeight {
revision_number: 0,
revision_height: u64::MAX,
}
}
};

let msg = astria_core::generated::protocol::transactions::v1alpha1::Ics20Withdrawal {
let msg = astria_core::generated::protocol::transaction::v1alpha1::Ics20Withdrawal {
source_channel: src_channel_id.to_string(),
denom: denom,
denom,
amount: Some(
u128::try_from(amount.0)
.expect("amount can fit into u128")
Expand All @@ -240,6 +240,7 @@ fn build_transfer_message_astria(
.to_string(),
memo: String::new(),
bridge_address: None,
use_compat_address: false,
};

Any {
Expand Down

0 comments on commit 42e30d4

Please sign in to comment.