Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn event_to_bridge_unlock(
.ok_or(eyre::eyre!(
"failed to divide amount by asset withdrawal multiplier"
))?,
memo: serde_json::to_vec(&memo).wrap_err("failed to serialize memo to json")?,
memo: serde_json::to_string(&memo).wrap_err("failed to serialize memo to json")?,
fee_asset,
bridge_address: None,
};
Expand Down Expand Up @@ -228,7 +228,7 @@ mod tests {
let expected_action = BridgeUnlockAction {
to: crate::astria_address([1u8; 20]),
amount: 99,
memo: serde_json::to_vec(&bridge::UnlockMemo {
memo: serde_json::to_string(&bridge::UnlockMemo {
block_number: 1,
transaction_hash: [2u8; 32],
})
Expand Down Expand Up @@ -269,7 +269,7 @@ mod tests {
let expected_action = BridgeUnlockAction {
to: crate::astria_address([1u8; 20]),
amount: 99,
memo: serde_json::to_vec(&bridge::UnlockMemo {
memo: serde_json::to_string(&bridge::UnlockMemo {
block_number: 1,
transaction_hash: [2u8; 32],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ fn rollup_height_from_signed_transaction(

let last_batch_rollup_height = match withdrawal_action {
Action::BridgeUnlock(action) => {
let memo: bridge::UnlockMemo = serde_json::from_slice(&action.memo)
let memo: bridge::UnlockMemo = serde_json::from_str(&action.memo)
.wrap_err("failed to parse memo from last transaction by the bridge account")?;
Some(memo.block_number)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn make_bridge_unlock_action() -> Action {
let inner = BridgeUnlockAction {
to: crate::astria_address([0u8; 20]),
amount: 99,
memo: serde_json::to_vec(&bridge::UnlockMemo {
memo: serde_json::to_string(&bridge::UnlockMemo {
block_number: DEFAULT_LAST_ROLLUP_HEIGHT,
transaction_hash: [1u8; 32],
})
Expand Down

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
Expand Up @@ -1337,7 +1337,7 @@ pub struct BridgeUnlockAction {
// asset to use for fee payment.
pub fee_asset: asset::Denom,
// memo for double spend protection.
pub memo: Vec<u8>,
pub memo: String,
// the address of the bridge account to transfer from,
// if the bridge account's withdrawer address is not the same as the bridge address.
// if unset, the signer of the transaction is used.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ async fn app_execute_transaction_with_every_action_snapshot() {
to: bob_address,
amount: 10,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: None,
}
.into(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ async fn app_execute_transaction_bridge_lock_unlock_action_ok() {
to: alice_address,
amount,
fee_asset: asset.clone(),
memo: b"lilywashere".to_vec(),
memo: "{ \"msg\": \"lilywashere\" }".into(),
bridge_address: None,
};

Expand Down
14 changes: 7 additions & 7 deletions crates/astria-sequencer/src/bridge/bridge_unlock_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset,
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: None,
};

Expand Down Expand Up @@ -174,7 +174,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: Some(bridge_address),
};

Expand Down Expand Up @@ -212,7 +212,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset,
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: Some(bridge_address),
};

Expand Down Expand Up @@ -253,7 +253,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: None,
};

Expand Down Expand Up @@ -308,7 +308,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: Some(bridge_address),
};

Expand Down Expand Up @@ -360,7 +360,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: None,
};

Expand Down Expand Up @@ -412,7 +412,7 @@ mod test {
to: to_address,
amount: transfer_amount,
fee_asset: asset.clone(),
memo: vec![0u8; 32],
memo: "{}".into(),
bridge_address: Some(bridge_address),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ message BridgeUnlockAction {
// the asset used to pay the transaction fee
string fee_asset = 3;
// memo for double spend prevention
bytes memo = 4;
string memo = 4;
// the address of the bridge account to transfer from,
// if the bridge account's withdrawer address is not the same as the bridge address.
// if unset, the signer of the transaction is used.
Expand Down