From fb1013c9144eb7bee0d424533df275dd1bfd5540 Mon Sep 17 00:00:00 2001 From: Flavio Fraschetti Date: Wed, 28 Feb 2024 16:34:22 +0000 Subject: [PATCH] Add contract test for wallet_getderivedaddress --- src/tests/contract_test/wallet_test.cljs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/tests/contract_test/wallet_test.cljs b/src/tests/contract_test/wallet_test.cljs index 72e30df893a3..93e62d0a04e5 100644 --- a/src/tests/contract_test/wallet_test.cljs +++ b/src/tests/contract_test/wallet_test.cljs @@ -84,3 +84,23 @@ (h/logout) (rf-test/wait-for [::logout/logout-method]))))) + +(defn get-derived-account + [response] + (is (= "0x1" (:sha3-pwd response))) + (is (= "🍌" (:emoji response))) + (is (= :army (:color response))) + (is (= "m/44'/60'/0'/0/7" (:path response))) + (is (= "Test 3" (:account-name response)))) + +(deftest wallet-create-derived-addresses-success + (h/log-headline :wallet/create-derived-addresses) + (rf-test/run-test-async + (h/with-app-initialized + (h/with-account + (contract-utils/call-rpc-endpoint + {:rpc-endpoint "wallet_getDerivedAccount" + :params ["0x1" + "some-account-address" + ["m/44'/60'/0'/0/7"]] + :action get-derived-account})))))