From 14287ed810ab8af3f0421e200c5904a6c87b11cb Mon Sep 17 00:00:00 2001 From: bengtlofgren Date: Tue, 5 Mar 2024 16:40:45 +0000 Subject: [PATCH 1/2] added clone to transaction structs --- crates/light_sdk/src/transaction/account.rs | 1 + crates/light_sdk/src/transaction/bridge.rs | 1 + crates/light_sdk/src/transaction/governance.rs | 1 + crates/light_sdk/src/transaction/ibc.rs | 1 + crates/light_sdk/src/transaction/mod.rs | 1 + crates/light_sdk/src/transaction/pgf.rs | 1 + crates/light_sdk/src/transaction/pos.rs | 1 + crates/light_sdk/src/transaction/transfer.rs | 1 + 8 files changed, 8 insertions(+) diff --git a/crates/light_sdk/src/transaction/account.rs b/crates/light_sdk/src/transaction/account.rs index b037238a2e..eec6ebd683 100644 --- a/crates/light_sdk/src/transaction/account.rs +++ b/crates/light_sdk/src/transaction/account.rs @@ -14,6 +14,7 @@ const TX_REVEAL_PK_WASM: &str = "tx_reveal_pk.wasm"; const TX_UPDATE_ACCOUNT_WASM: &str = "tx_update_account.wasm"; /// Transaction to initialize an established account +#[derive(Debug, Clone)] pub struct InitAccount(Tx); impl InitAccount { diff --git a/crates/light_sdk/src/transaction/bridge.rs b/crates/light_sdk/src/transaction/bridge.rs index a8fb35c2ab..a7085a85d6 100644 --- a/crates/light_sdk/src/transaction/bridge.rs +++ b/crates/light_sdk/src/transaction/bridge.rs @@ -13,6 +13,7 @@ use crate::transaction; const TX_BRIDGE_POOL_WASM: &str = "tx_bridge_pool.wasm"; /// A transfer over the Ethereum bridge +#[derive(Debug, Clone)] pub struct BridgeTransfer(Tx); impl BridgeTransfer { diff --git a/crates/light_sdk/src/transaction/governance.rs b/crates/light_sdk/src/transaction/governance.rs index ae97e0d4c9..230e423551 100644 --- a/crates/light_sdk/src/transaction/governance.rs +++ b/crates/light_sdk/src/transaction/governance.rs @@ -14,6 +14,7 @@ const TX_INIT_PROPOSAL_WASM: &str = "tx_init_proposal.wasm"; const TX_VOTE_PROPOSAL: &str = "tx_vote_proposal.wasm"; /// Transaction to initialize a governance proposal +#[derive(Debug, Clone)] pub struct InitProposal(Tx); impl InitProposal { diff --git a/crates/light_sdk/src/transaction/ibc.rs b/crates/light_sdk/src/transaction/ibc.rs index 32afdb4c30..9bd143c593 100644 --- a/crates/light_sdk/src/transaction/ibc.rs +++ b/crates/light_sdk/src/transaction/ibc.rs @@ -17,6 +17,7 @@ use crate::transaction; const TX_IBC_WASM: &str = "tx_ibc.wasm"; /// An IBC transfer +#[derive(Debug, Clone)] pub struct IbcTransfer(Tx); impl IbcTransfer { diff --git a/crates/light_sdk/src/transaction/mod.rs b/crates/light_sdk/src/transaction/mod.rs index 6f8aebd5da..ab043d211b 100644 --- a/crates/light_sdk/src/transaction/mod.rs +++ b/crates/light_sdk/src/transaction/mod.rs @@ -21,6 +21,7 @@ pub mod pos; pub mod transfer; /// Generic arguments required to construct a transaction +#[derive(Debug, Clone)] pub struct GlobalArgs { pub expiration: Option, pub code_hash: Hash, diff --git a/crates/light_sdk/src/transaction/pgf.rs b/crates/light_sdk/src/transaction/pgf.rs index 1a492b331b..02ce44141f 100644 --- a/crates/light_sdk/src/transaction/pgf.rs +++ b/crates/light_sdk/src/transaction/pgf.rs @@ -15,6 +15,7 @@ const TX_RESIGN_STEWARD: &str = "tx_resign_steward.wasm"; const TX_UPDATE_STEWARD_COMMISSION: &str = "tx_update_steward_commission.wasm"; /// A transaction to resign from stewarding pgf +#[derive(Debug, Clone)] pub struct ResignSteward(Tx); impl ResignSteward { diff --git a/crates/light_sdk/src/transaction/pos.rs b/crates/light_sdk/src/transaction/pos.rs index 25b7a19f37..746005754c 100644 --- a/crates/light_sdk/src/transaction/pos.rs +++ b/crates/light_sdk/src/transaction/pos.rs @@ -26,6 +26,7 @@ const TX_CHANGE_COMMISSION_WASM: &str = "tx_change_validator_commission.wasm"; const TX_WITHDRAW_WASM: &str = "tx_withdraw.wasm"; /// A bond transaction +#[derive(Debug, Clone)] pub struct Bond(Tx); impl Bond { diff --git a/crates/light_sdk/src/transaction/transfer.rs b/crates/light_sdk/src/transaction/transfer.rs index 3a5d188a21..9a8152ce69 100644 --- a/crates/light_sdk/src/transaction/transfer.rs +++ b/crates/light_sdk/src/transaction/transfer.rs @@ -13,6 +13,7 @@ use crate::transaction; const TX_TRANSFER_WASM: &str = "tx_transfer.wasm"; /// A transfer transaction +#[derive(Debug, Clone)] pub struct Transfer(Tx); impl Transfer { From f3765ee559c4ba97d5e4e09fbcd52e5c756fb49a Mon Sep 17 00:00:00 2001 From: Marco Granelli Date: Mon, 29 Apr 2024 15:05:19 +0200 Subject: [PATCH 2/2] Changelog #2817 --- .changelog/unreleased/bug-fixes/2817-light-sdk-clone.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/2817-light-sdk-clone.md diff --git a/.changelog/unreleased/bug-fixes/2817-light-sdk-clone.md b/.changelog/unreleased/bug-fixes/2817-light-sdk-clone.md new file mode 100644 index 0000000000..ce2e70b9f2 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/2817-light-sdk-clone.md @@ -0,0 +1,2 @@ +- Light SDK objects must be clone-able. + ([\#2817](https://github.com/anoma/namada/pull/2817)) \ No newline at end of file