-
Notifications
You must be signed in to change notification settings - Fork 985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fraschetti/18343- Add contract test for wallet_getDerivedAddresses #19115
Fraschetti/18343- Add contract test for wallet_getDerivedAddresses #19115
Conversation
Jenkins BuildsClick to see older builds (5)
|
@@ -34,6 +36,7 @@ | |||
|
|||
(defn get-default-account | |||
[accounts] | |||
(println "DEFAULT ACCOUNT" accounts) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
{:rpc-endpoint "wallet_getDerivedAddresses" | ||
:params [sha3-pwd main-account derivation-path] | ||
:action assert-derived-account | ||
:on-error (fn [error] (println "RPC Call Failed:" error))})))))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need on error in this case 👍
(is (= (:public-key response) (:public-key response))) | ||
(is (= "m/43'/60'/1581'/0'/0" (:path (first response))))) | ||
|
||
(deftest wallet-create-derived-addresses |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better the test name matches the rpc event.
Can you follow the format I did in the other tests?
e.g wallet-get-derived-addressess-contract
Actually I think we need to adjust the other tests names too - we can do separately though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, I will change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one @FFFra
Thank you @J-Son89! |
@@ -0,0 +1,136 @@ | |||
(ns tests.test-utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't be copy & pasting like this. Just so you know @FFFra, this is a strategy we decided a long time ago to avoid because duplicated code leads to a lot of confusion and debt piles up quickly.
The file legacy.status-im.utils-test
is only used in a few places, so it's trivial to just move it. This whole namespace is identical except for the lines below:
:restoreAccountAndLogin
(fn [request]
(prn native-status)
(.restoreAccountAndLogin native-status request))
:loginAccount
(fn [request] (.loginAccount native-status request))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the context, Icaro. I'm adapting =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @FFFra 👍🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
83fb23c
to
c0ec094
Compare
c0ec094
to
62f2803
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
fixes #18343
Summary
This pull request introduces comprehensive tests for the
wallet_getDerivedAddresses
endpoint, ensuring its robustness and reliability in our wallet functionality.Additionally, this work leverages and extends upon the foundational changes introduced by @J-Son89 in PR #18910.
Steps to test
run
make test-contracts
status: ready!