Skip to content

Commit

Permalink
feat: Update wallet_connect.cc to use Walletconnect2Client
Browse files Browse the repository at this point in the history
  • Loading branch information
leejw51crypto committed May 22, 2024
1 parent 0ba2c32 commit 44f158a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions demo/examples/src/wallet_connect.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include <_types/_uint64_t.h>
#include <cassert>
#include <defi-wallet-core-cpp/src/contract.rs.h>
#include <defi-wallet-core-cpp/src/lib.rs.h>
Expand Down Expand Up @@ -110,14 +111,17 @@ int main(int argc, char *argv[]) {
// sign personal message
if (test_personal) {
/* message signing */
::std::uint64_t testchainid= result.eip155.accounts[0].chain_id;
::std::array<::std::uint8_t, 20> testaddress = result.eip155.accounts[0].address.address;
std::cout << "chainid=" << testchainid << std::endl;
std::cout << "address=" << address_to_hex_string(testaddress).c_str() << std::endl;
rust::Vec<uint8_t> sig1 = client->sign_personal_blocking(
"hello", result.eip155.accounts[0].address.address);
"hello", testaddress);
std::cout << "signature=" << bytes_to_hex_string(sig1).c_str()
<< std::endl;
std::cout << "signature length=" << sig1.size() << std::endl;

bool verifyresult = client->verify_personal_blocking(
"hello", sig1, result.eip155.accounts[0].address.address);
"hello", sig1, testaddress);
std::cout << "verify result=" << verifyresult << std::endl;
}

Expand Down

0 comments on commit 44f158a

Please sign in to comment.