-
Notifications
You must be signed in to change notification settings - Fork 39
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
Move vuex hdWallet methods to SDK wallet lib #2409
Move vuex hdWallet methods to SDK wallet lib #2409
Conversation
46c8d5e
to
ac7abc6
Compare
5853684
to
917b518
Compare
ac7abc6
to
1e9d4ec
Compare
917b518
to
358a241
Compare
1e9d4ec
to
d445277
Compare
df4c5e8
to
53cae92
Compare
d445277
to
21e1e69
Compare
ae128c4
to
d2f6c8b
Compare
message: params.message, | ||
tx: params.tx, | ||
txBase64: params.txBase64, |
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.
Previously the Raw Sign modal was receiving the props in a different format than the regular sign modal. I aligned both modals as they both are using the PopupProps
composable. Now the structure is enforced by the TypeScript - less possible to make a mistake.
1c1631d
to
21b67d8
Compare
if ( | ||
method === METHODS.sign | ||
&& (!modalProps.txBase64 || !isTxOfASupportedType(modalProps.txBase64)) | ||
) { | ||
modal = MODAL_CONFIRM_RAW_SIGN; | ||
popup = POPUP_TYPE_RAW_SIGN; | ||
} |
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.
Previously the openPopup
was detecting if the transaction is supported by the app or not. The same check was done in the previous permissions Vuex module. So there was 2 places doing the same logic. I consolidated this and moved here as the permissions composable is the only place where the openPopup
function is fired.
? popupProps.value?.data | ||
: Buffer.from(popupProps.value?.data as any).toString('hex'), | ||
); | ||
const dataAsString = computed((): string => popupProps.value?.txBase64?.toString() || ''); |
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.
As there is no such a thing as data
anymore we were able to skip any conditional checks.
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.
This is the most important file of the PR. It consists all the logic we had in the Vuex hdWallet
module. So this is a core of signing stuff and asking user for permission to do it.
Following methods does not exist anymore:
signTransactionWithoutConfirmation
- calculating if the confirmation modal should be open is now done in a different way.signTransactionFromAccount
- passingfromAccount
as one of the properties of any of the default sign method options causes to sign with the specified account.
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.
This class looks good 👍
cadb511
to
f0f4087
Compare
During my testing I've constantly got this issue in console, and I think it might be affect all errors that I listed below: Error: pubkey cannot be null or undefined.
2023-10-26.4.40.34.mov
@peronczyk please check it. |
1a2d0e8
to
8ca035f
Compare
@Liubov-crypto thank you for your comments. I addressed your feedback. Please retest. |
84a1f80
to
a4882aa
Compare
a4882aa
to
fc4876a
Compare
fc4876a
to
813a18a
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.
lgtm
813a18a
to
5b6f1be
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.
Code changes look reasonable.
Code changes looks good to me. Apart of that please fix the bugs we discussed. |
5b6f1be
to
c72d3d7
Compare
c72d3d7
to
077e957
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.
Cool PR.
No description provided.