Skip to content

SD-102: Refactor fee handling to separate shielding and sending fees#91

Merged
rAskVAL merged 1 commit into
mainfrom
sd-102-refactor-shielding-fees
Jun 26, 2025
Merged

SD-102: Refactor fee handling to separate shielding and sending fees#91
rAskVAL merged 1 commit into
mainfrom
sd-102-refactor-shielding-fees

Conversation

@rAskVAL

@rAskVAL rAskVAL commented Jun 16, 2025

Copy link
Copy Markdown
Contributor

No description provided.

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-91.d1rxgx3w89g7ku.amplifyapp.com

@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 2d7ce88 to 9ca204f Compare June 18, 2025 07:59
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 9ca204f to 9c4ab84 Compare June 18, 2025 08:18
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 9c4ab84 to 275861b Compare June 18, 2025 08:33
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 275861b to 0ca5a62 Compare June 18, 2025 08:39
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 0ca5a62 to 0e91371 Compare June 18, 2025 10:52
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 0e91371 to b8b8652 Compare June 18, 2025 10:55
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 9c89685 to fd390c9 Compare June 18, 2025 14:09
@rAskVAL rAskVAL requested review from jalooc and youPickItUp and removed request for youPickItUp June 18, 2025 14:14
Comment thread src/domains/misc/utils/getQueryKey.ts Outdated
Comment on lines +6 to +9
sendingFees: 'sendingFees',
shieldingFees: 'shieldingFees',
allowanceFeeEstimate: 'allowanceFeeEstimate',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit lacking consistency, no? - sometimes calling it just fee, sometimes fee estimate.

Or are the sending and shielding fees really the actual values, not estimates?

Comment on lines +31 to +42
if (!chainId) throw new Error('chainId is not available');
if (!walletAddress) throw new Error('walletAddress is not available');

const localId = v4();

await upsertTransaction(chainId, {
token: token.isNative ?
{ type: 'native' } :
{ type: 'erc20', address: token.address },
token: token.isNative ? { type: 'native' } : { type: 'erc20', address: token.address },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still have IDE formatting turned on?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no i've changed it, i think its nicer this way

@jalooc jalooc Jun 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very subjective - e.g. I liked the previous one better ;)

Anyway - when making changes remember that it obfuscates git history, making it harder to trace what and when happened; not to mention that it's an impossible-to-analyse noise for any kind of automatic analysis tools. Sometimes it's justified, sometimes not so much - of course impossible to set a unequivocal general rule for when to do it and when not. But I'd say that making such an non-undoubtedly-useful stylistic change in a code that's completely outside of a scope of the code changes from PR, is definitely too much.

Comment thread src/domains/shielder/stores/getShielderIndexedDB.ts Outdated
Comment thread src/domains/shielder/stores/getShielderIndexedDB.ts Outdated
Comment thread src/domains/shielder/utils/useShielderFees.tsx Outdated
Comment thread src/domains/shielder/utils/useShielderFees.tsx
Comment thread src/domains/shielder/utils/useEstimateAllowanceFee.tsx Outdated
Comment thread src/domains/shielder/utils/useEstimateAllowanceFee.tsx Outdated
Comment thread src/domains/shielder/components/TransactionDetailsModal/ActivityDetailsModal.tsx Outdated
Comment thread src/domains/shielder/components/TokenList/Modals/SendModal/SelectAmountPage.tsx Outdated
shielderPrivateKey: 'shielderPrivateKey',
tokenSymbol: 'token-symbol',
wasmCryptoClient: 'wasm-crypto-client',
} as const;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have sorted them alphabetically

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's a good idea - they should be grouped semantically (I think that this won't always be the same as the alphabetical order).

Also this comment applies here.

@jalooc jalooc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GTG. Just wrt of this comment, please revert all subjective stylistic changes that were performed on a code that this PR doesn't relate to.

Comment thread src/domains/shielder/utils/useShieldingFees.tsx
@rAskVAL rAskVAL force-pushed the sd-102-refactor-shielding-fees branch from 7749ab0 to 6d2d4f1 Compare June 26, 2025 10:35
@rAskVAL rAskVAL merged commit 9c44ef2 into main Jun 26, 2025
6 checks passed
@rAskVAL rAskVAL deleted the sd-102-refactor-shielding-fees branch June 26, 2025 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants