Skip to content

Conversation

@obrok
Copy link
Contributor

@obrok obrok commented Aug 27, 2025

We use token kind to identify tokens in the price feed. This makes sure there aren't any duplicates without going too deep into refactoring that.

We use token kind to identify tokens in the price feed. This makes sure
there aren't any duplicates without going too deep into refactoring
that.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements validation to ensure token kind uniqueness in the token configuration to prevent duplicates that could cause issues in the price feed identification system.

  • Modifies config resolution functions to return Result<ServerConfig> instead of ServerConfig to handle validation errors
  • Adds a new validation function check_token_config that verifies no duplicate token kinds exist
  • Updates main function and test to handle the new error-returning configuration resolution

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
crates/shielder-relayer/src/main.rs Updates main function to handle error from config resolution
crates/shielder-relayer/src/config/tests.rs Modifies test to handle and return Result from config resolution
crates/shielder-relayer/src/config/mod.rs Adds token kind uniqueness validation and updates config functions to return Results
README.md Formats license list items using markdown bullet points

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@github-actions
Copy link

github-actions bot commented Aug 27, 2025

📊 Coverage Report

📈 Total Coverage Summary

Type Covered Total Coverage
📝 Lines 1746 2478 🟠 70.46%
📄 Statements 1746 2478 🟠 70.46%
⚡ Functions 115 135 🟡 85.18%
🔀 Branches 277 295 🟡 93.89%

Coverage Legend

  • ✅ 100% Coverage
  • 🟡 80-99% Coverage
  • 🟠 50-79% Coverage
  • ❌ 0-49% Coverage

📁 File Coverage

📋 Detailed Coverage Report
File Lines Statements Functions Branches
🟡 blanksquare-monorepo/ts/shielder-sdk/src/actions/deposit.ts 89.74% 89.74% 100% 85.71%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/actions/newAccount.ts 86.27% 86.27% 100% 80%
blanksquare-monorepo/ts/shielder-sdk/src/actions/types.ts 100% 100% 100% 100%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/actions/utils.ts 97.33% 97.33% 100% 90.9%
🟠 blanksquare-monorepo/ts/shielder-sdk/src/actions/withdraw.ts 78.14% 78.14% 87.5% 100%
blanksquare-monorepo/ts/shielder-sdk/src/chain/contract.ts 1.8% 1.8% 0% 0%
blanksquare-monorepo/ts/shielder-sdk/src/chain/relayer.ts 35.22% 35.22% 33.33% 50%
blanksquare-monorepo/ts/shielder-sdk/src/client/actions.ts 100% 100% 100% 100%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/client/client.ts 86.5% 86.5% 71.42% 80%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/client/factories.ts 97.4% 97.4% 100% 85.71%
blanksquare-monorepo/ts/shielder-sdk/src/client/types.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/constants.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/errors.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/index.ts 0% 0% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/protocolFees.ts 18.51% 18.51% 14.28% 100%
blanksquare-monorepo/ts/shielder-sdk/src/referral.ts 36.84% 36.84% 0% 0%
blanksquare-monorepo/ts/shielder-sdk/src/state/accountFactory.ts 100% 100% 100% 100%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/state/accountOnchain.ts 94.44% 94.44% 100% 77.77%
blanksquare-monorepo/ts/shielder-sdk/src/state/accountRegistry.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/accountStateSerde.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/idManager.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/localStateTransition.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/sync/chainStateTransition.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/sync/historyFetcher.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/sync/synchronizer.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/sync/tokenAccountFinder.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/state/types.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/storage/storageManager.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/storage/storageSchema.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/types.ts 100% 100% 100% 100%
blanksquare-monorepo/ts/shielder-sdk/src/utils.ts 100% 100% 100% 100%
🟡 blanksquare-monorepo/ts/shielder-sdk/src/utils/errorHandler.ts 93.33% 93.33% 100% 75%

@github-actions
Copy link

github-actions bot commented Aug 27, 2025

Transaction NameMainCurrentDifference (%)
Deposit (size)20255202550.00000%
DepositERC20 (gas)17660751765955-0.00679%
DepositERC20Fees (gas)17747511774703-0.00270%
DepositERC20FeesMemo (gas)17756251775529-0.00541%
DepositERC20Memo (gas)17667571766817+0.00340%
DepositNative (gas)17483051748389+0.00480%
DepositNativeFees (gas)17576851757721+0.00205%
DepositNativeFeesMemo (gas)17585831758559-0.00136%
DepositNativeMemo (gas)17662671766207-0.00340%
NewAccount (size)22867228670.00000%
NewAccountERC20 (gas)17996791799691+0.00067%
NewAccountERC20Fees (gas)18083791808463+0.00465%
NewAccountERC20FeesMemo (gas)17921401792092-0.00268%
NewAccountERC20Memo (gas)17834281783344-0.00471%
NewAccountNative (gas)17643951764335-0.00340%
NewAccountNativeFees (gas)18158511815803-0.00264%
NewAccountNativeFeesMemo (gas)177449217744920.00000%
NewAccountNativeMemo (gas)17651721765028-0.00816%
Withdraw (size)21573215730.00000%
WithdrawERC20 (gas)18671731867293+0.00643%
WithdrawERC20Fees (gas)18417811841817+0.00195%
WithdrawERC20FeesMemo (gas)18425951842571-0.00130%
WithdrawERC20Memo (gas)18337751833715-0.00327%
WithdrawNative (gas)18674091867397-0.00064%
WithdrawNativeFees (gas)18268491826801-0.00263%
WithdrawNativeFeesMemo (gas)18446801844752+0.00390%
WithdrawNativeMemo (gas)18182121818260+0.00264%

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