Skip to content
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

fix: contract periphery tests #688

Merged

Conversation

marcomariscal
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Jul 3, 2024

Deploy Preview for jolly-shaw-20fe62 ready!

Name Link
🔨 Latest commit 22fa0c0
🔍 Latest deploy log https://app.netlify.com/sites/jolly-shaw-20fe62/deploys/6685b5841948870008e18882
😎 Deploy Preview https://deploy-preview-688--jolly-shaw-20fe62.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@marcomariscal marcomariscal marked this pull request as ready for review July 4, 2024 14:32
@marcomariscal marcomariscal changed the base branch from master to feat/last-fetched-block-usage July 5, 2024 16:28
Copy link
Contributor

@jferas jferas left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link

github-actions bot commented Jul 8, 2024

Coverage after merging fix/contract-periphery-tests into feat/last-fetched-block-usage will be

81.12%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
contracts-periphery/src
   UmbraBatchSend.sol100%100%100%100%
   UniswapWithdrawHook.sol81.82%100%66.67%83.33%14
umbra-js/src
   ethers.ts76.27%100%61.11%100%
   types.ts50%100%0%100%
umbra-js/src/classes
   KeyPair.ts98.65%96.49%100%100%31–32
   RandomNumber.ts100%100%100%100%
   StealthKeyRegistry.ts100%100%100%100%
   TxHistoryProvider.ts77.55%76.47%66.67%79.31%11, 11, 19–20, 31, 38, 44, 53, 57, 8
   Umbra.ts75.41%63.69%82.93%82.09%105, 135–136, 157, 229–231, 315–318, 380, 394, 401–403, 405–406, 409–410, 428, 430, 432, 432, 432, 432–433, 433, 433–435, 450, 450, 450–451, 455, 458, 478, 496–498, 585, 602, 615–616, 626–627, 640, 643–644, 674–675, 751, 755, 755, 755–758, 758, 758, 758, 758, 758, 758–759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 761, 761, 761–762, 765, 765, 765, 765, 765–766, 769, 778, 778, 787, 790, 790, 790–792, 805, 809, 812–813, 819–821, 828, 828, 828–831, 862, 867–868, 868–869
umbra-js/src/typechain
   index.ts70.59%100%37.50%100%
umbra-js/src/typechain/factories
   index.ts100%100%100%100%
umbra-js/src/typechain/factories/@OpenZeppelin
   index.ts100%100%100%100%
umbra-js/src/typechain/factories/@openzeppelin/contracts
   index.ts100%100%100%100%
umbra-js/src/typechain/factories/@openzeppelin/contracts/access
   Ownable__factory.ts50%100%0%66.67%70, 76
   index.ts50%100%0%100%
umbra-js/src/typechain/factories/@openzeppelin/contracts/token
   index.ts100%100%100%100%
umbra-js/src/typechain/factories/@openzeppelin/contracts/token/ERC20
   ERC20__factory.ts29.03%0%12.50%47.06%310, 314, 314, 314–315, 317, 326, 326, 326, 333, 333, 333, 336, 339, 345
   IERC20__factory.ts50%100%0%66.67%201, 204
   index.ts50%100%0%100%
umbra-js/src/typechain/factories/contracts
   IUmbraHookReceiver__factory.ts50%100%0%66.67%61, 67
   MockHook__factory.ts22.58%0%0%41.18%107, 111, 111, 111–112, 114, 121, 121, 121, 126, 126, 126, 129, 132, 138, 144
   StealthKeyRegistry__factory.ts22.58%0%0%41.18%202, 206, 206, 206–207, 209, 216, 216, 216, 221, 221, 221, 224, 227, 233, 239
   TestToken__factory.ts64.52%66.67%50%70.59%329–330, 348, 351, 354, 360, 366
   Umbra__factory.ts70.97%66.67%62.50%76.47%495–496, 525, 529, 532, 538
   index.ts50%100%0%100%
umbra-js/src/utils
   cns.ts50%33.33%50%55%33–36, 40, 40, 40, 40, 40–41, 44–46
   constants.ts100%100%100%100%
   ens.ts36.11%25%33.33%40%25–27, 35, 56–57, 57, 57–58, 63–64, 66, 70, 70, 70, 70, 70–71, 75–77
   utils.ts76.67%68.66%76.92%82%109–111, 113–115, 121, 139–140, 169, 190, 246, 253–260, 260, 260, 260, 260, 260, 260–261, 263, 294, 296–297, 306, 306, 306–307, 309, 312, 321–322, 363, 380, 380, 380, 400, 429, 431, 436, 448, 448–449, 454, 456–457, 468–472, 478, 480, 522–523, 523, 523–525, 525, 525, 536, 59–60, 779–780, 792–793, 85, 93, 93
umbra-js/test
   testPrivateKeys.ts100%100%100%100%
   utils.ts100%100%100%100%

@garyghayrat garyghayrat merged commit dcd0ab2 into feat/last-fetched-block-usage Jul 9, 2024
5 checks passed
garyghayrat added a commit that referenced this pull request Jul 11, 2024
…#685)

* feat: set the last fetched block as the start block

* feat: handle caching user announcements and latest fetched block

* feat: show user announcements if there are any

* fix: handle watching/loading announcements

* fix: parse out lastFetchedBlock and fix user announcement loading logic

* chore: log

* feat: handle block data caching

* feat: show most recent block data if exists

* fix: type check

* feat: handle user announcements already present and sign language

* feat: only show fetching when no user announcements

* feat: fetching latest from last fetched block component

* feat: fetching latest translation for cn

* feat: clear local storage button and functionality

* fix: start block handling logic

* feat: dedupe user announcements

* fix: logic

* fix: minimize debugging logs on userAnnouncement changes

* feat: handle scanning latest announcements from last fetched block

* feat: sort by timestamp explicitly

* feat: no loading sequence when there are announcements

* fix: need sig lately verbiage

* fix: add need sig lately to cn

* fix: little more mb

* fix: no withdraw verbiage on need-sig-lately

* feat: handle need sig

* Update frontend/src/i18n/locales/en-US.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* feat: handle sign button instead of needs sig

* Update frontend/src/i18n/locales/zh-CN.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* fix: move local storage clear button above lang

* fix: spacing more uniform

* fix: use computed ref as param, and set setIsInWithdrawFlow to false on mount

* feat: sign and withdraw

* fix: contract periphery tests (#688)

* fix: explicitly sort the tokens by addr

* fix: use vm.computeCreateAddress

* fix: mirror test sender params

* fix: use actual owner

* fix: add back gnosis

* Remove all reference to INFURA_ID (#687)

---------

Co-authored-by: John Feras <jferas@ferasinfotech.com>

* fix: use balanceIndex to ensure that the correct balance is fetched from the stealthBalances array

* fix: dedupe by tx hash and receiver instead of just tx hash

* fix: include receiver to derive isWithdrawn

* fix: img

---------

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>
Co-authored-by: John Feras <jferas@ferasinfotech.com>
OKEAMAH pushed a commit to OKEAMAH/umbra-protocol that referenced this pull request Jul 11, 2024
…ScopeLift#685)

* feat: set the last fetched block as the start block

* feat: handle caching user announcements and latest fetched block

* feat: show user announcements if there are any

* fix: handle watching/loading announcements

* fix: parse out lastFetchedBlock and fix user announcement loading logic

* chore: log

* feat: handle block data caching

* feat: show most recent block data if exists

* fix: type check

* feat: handle user announcements already present and sign language

* feat: only show fetching when no user announcements

* feat: fetching latest from last fetched block component

* feat: fetching latest translation for cn

* feat: clear local storage button and functionality

* fix: start block handling logic

* feat: dedupe user announcements

* fix: logic

* fix: minimize debugging logs on userAnnouncement changes

* feat: handle scanning latest announcements from last fetched block

* feat: sort by timestamp explicitly

* feat: no loading sequence when there are announcements

* fix: need sig lately verbiage

* fix: add need sig lately to cn

* fix: little more mb

* fix: no withdraw verbiage on need-sig-lately

* feat: handle need sig

* Update frontend/src/i18n/locales/en-US.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* feat: handle sign button instead of needs sig

* Update frontend/src/i18n/locales/zh-CN.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* fix: move local storage clear button above lang

* fix: spacing more uniform

* fix: use computed ref as param, and set setIsInWithdrawFlow to false on mount

* feat: sign and withdraw

* fix: contract periphery tests (ScopeLift#688)

* fix: explicitly sort the tokens by addr

* fix: use vm.computeCreateAddress

* fix: mirror test sender params

* fix: use actual owner

* fix: add back gnosis

* Remove all reference to INFURA_ID (ScopeLift#687)

---------

Co-authored-by: John Feras <jferas@ferasinfotech.com>

* fix: use balanceIndex to ensure that the correct balance is fetched from the stealthBalances array

* fix: dedupe by tx hash and receiver instead of just tx hash

* fix: include receiver to derive isWithdrawn

* fix: img

---------

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>
Co-authored-by: John Feras <jferas@ferasinfotech.com>
garyghayrat added a commit that referenced this pull request Jul 15, 2024
* feat: set the last fetched block as the start block

* feat: handle caching user announcements and latest fetched block

* feat: show user announcements if there are any

* fix: handle watching/loading announcements

* fix: parse out lastFetchedBlock and fix user announcement loading logic

* chore: log

* feat: handle block data caching

* feat: show most recent block data if exists

* fix: type check

* feat: handle user announcements already present and sign language

* feat: only show fetching when no user announcements

* feat: fetching latest from last fetched block component

* feat: fetching latest translation for cn

* feat: clear local storage button and functionality

* fix: start block handling logic

* feat: dedupe user announcements

* fix: logic

* fix: minimize debugging logs on userAnnouncement changes

* feat: handle scanning latest announcements from last fetched block

* feat: sort by timestamp explicitly

* feat: no loading sequence when there are announcements

* fix: need sig lately verbiage

* fix: add need sig lately to cn

* fix: little more mb

* fix: no withdraw verbiage on need-sig-lately

* feat: handle need sig

* Update frontend/src/i18n/locales/en-US.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* feat: handle sign button instead of needs sig

* Update frontend/src/i18n/locales/zh-CN.json

Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>

* fix: move local storage clear button above lang

* fix: spacing more uniform

* fix: use computed ref as param, and set setIsInWithdrawFlow to false on mount

* feat: sign and withdraw

* fix: contract periphery tests (#688)

* fix: explicitly sort the tokens by addr

* fix: use vm.computeCreateAddress

* fix: mirror test sender params

* fix: use actual owner

* fix: add back gnosis

* Remove all reference to INFURA_ID (#687)

---------

Co-authored-by: John Feras <jferas@ferasinfotech.com>

* fix: use balanceIndex to ensure that the correct balance is fetched from the stealthBalances array

* fix: dedupe by tx hash and receiver instead of just tx hash

* fix: include receiver to derive isWithdrawn

* fix: img

* Query StealthKeyChanged events from subgraph for user registration block number and stealthkeys

* Added valid non-found in subgraph error (vs schema error) and removed wasteful retries from wallet function getRegisteredStealthKeys

* When getting stealthKeys via subgraph StealthKeyChanged event, save block number of event in storage as starting point of announcements scan

* Remove unneeded 'block: undefined' return values from 'lookupRecipient' function

* Query 10k announcements unless it's Gnosis subgraph

* Update `umbra-js` version and add `.npmignore`

* Changed public key acquisition to query registry contract before subgraph.. umbra-js change

* Fix to return proper error string when public address not found in subgraph

* Update UmbraJs version to 0.2.1

* Use umbra-js@0.2.1 in frontend

---------

Co-authored-by: marcomariscal <marco.a.mariscal@gmail.com>
Co-authored-by: marcomariscal <42938673+marcomariscal@users.noreply.github.com>
Co-authored-by: Gary Ghayrat <61768337+garyghayrat@users.noreply.github.com>
Co-authored-by: garyghayrat <gary.ghayrat@pm.me>
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.

3 participants