Skip to content

Commit

Permalink
Problem: wc 2.0 fix not applied to c++ api (fix cronos-labs#467) (cro…
Browse files Browse the repository at this point in the history
…nos-labs#468)

reformat

update log
  • Loading branch information
leejw51crypto authored Dec 6, 2023
1 parent 0572f72 commit c4bdafa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

## [v0.0.24-alpha] - 2023-12-4
- fix walletconnect 2.0 send_tx
- add from_address for walletconnect 2.0 sendtx

## [v0.0.23-alpha] - 2023-8-7
- add mac universal binary (arm64 + x86_64)
Expand Down
1 change: 1 addition & 0 deletions extra-cpp-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ mod ffi {
/// wallet connect cronos(eth) eip155-tx signing info
#[derive(Debug, Default)]
pub struct WalletConnectTxEip155 {
pub from: String, // hexstring, "0x..."
pub to: String, // hexstring, "0x..."
pub value: String, // decimal string, in wei units
pub data: Vec<u8>, // data, as bytes
Expand Down
5 changes: 5 additions & 0 deletions extra-cpp-bindings/src/walletconnect2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ impl Walletconnect2Client {

let mut tx = Eip1559TransactionRequest::new();

if !userinfo.from.is_empty() {
// from address is necessary for wc.20 , metamask
tx = tx.from(Address::from_str(&userinfo.from)?);
}

if !userinfo.to.is_empty() {
tx = tx.to(NameOrAddress::Address(Address::from_str(&userinfo.to)?));
}
Expand Down

0 comments on commit c4bdafa

Please sign in to comment.