-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: reown #713
base: feat/lavamoat
Are you sure you want to change the base?
feat: reown #713
Conversation
b93d567
to
64134bd
Compare
src/components/TxData.js
Outdated
@@ -898,7 +898,7 @@ class TxData extends React.Component { | |||
<label>Type:</label> {upperFirst(action.type)} | |||
</div> | |||
<div> | |||
<label>Amount:</label> {numberUtils.prettyValue(action.amount, this.props.decimalPlaces)} {this.getSymbol(action.token_uid)} | |||
<label>Amount:</label> {numberUtils.prettyValue(typeof action.amount === 'bigint' ? action.amount : BigInt(action.amount), this.props.decimalPlaces)} {this.getSymbol(action.token)} |
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 was crashing
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.
Fixed by #715
ba4fca2
to
265efae
Compare
{typeof value === 'string' && value.length > 20 | ||
? helpers.truncateText(value, 8, 4) | ||
: typeof value === 'bigint' | ||
? value.toString() | ||
: value.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.
suggestion(non-blocking): It seems our linter did not complain about the use of nested ternaries here, so it's not a necessary change.
But it's worth avoiding, if possible.
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.
Fixed! Thanks
src/reducers/reown.js
Outdated
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.
thought(non-blocking): We already have @reduxjs/toolkit@v2
in this repository. It enables us to write reducers using Immer
( reference ) and slices
( reference ).
This is a migration we can do at any pace, but since this section of the reducers seem simple enough, we could make our pilot implementation here.
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 this PR is large enough as it is, let's do it in a later PR
src/sagas/modal.js
Outdated
* @param {Object} action.payload.modalProps - The props to pass to the modal | ||
*/ | ||
function* showModal({ payload: { modalType, modalProps } }) { | ||
if (modalContext) { |
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.
suggestion(non-blocking): Add an error message if the modalContext was not provided, allowing for easier debugging.
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.
Done! Thanks
src/screens/ReownConnect.js
Outdated
const connectionFailed = useSelector(state => state.reown.connectionFailed); | ||
const sessions = useSelector(state => state.reown.sessions || {}); |
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.
suggestion(non-blocking): Retrieve all data from store in a single fetch.
const connectionFailed = useSelector(state => state.reown.connectionFailed); | |
const sessions = useSelector(state => state.reown.sessions || {}); | |
const { connectionFailed, sessions } = useSelector(state => ({ | |
connectionFailed: state.reown.connectionFailed, | |
sessions: state.reown.sessions || {}, | |
})); |
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.
Done! Thanks
src/sagas/reown.js
Outdated
}); | ||
|
||
export function* onSignMessageRequest({ payload }) { | ||
const { accept, deny: denyCb, data, dapp } = payload; |
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.
question(non-blocking): Why not name the variable acceptCb
to match denyCb
?
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.
Done, thanks
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.
None of the remaining open comments are blocking, so this code is approved.
Screen.Recording.2025-01-02.at.10.39.57.mov
Acceptance Criteria
CreateNanoContractTx
andSignOracleData
Security Checklist