Skip to content

Comments

Revert 681 update constants#18

Merged
Dargon789 merged 9 commits intomainfrom
revert-681-update_constants
Mar 13, 2025
Merged

Revert 681 update constants#18
Dargon789 merged 9 commits intomainfrom
revert-681-update_constants

Conversation

@Dargon789
Copy link
Owner

@Dargon789 Dargon789 commented Mar 13, 2025

Summary by Sourcery

Chores:

  • Revert changes from commit 681, which updated constants in generated TypeScript API clients.

Dargon789 and others added 9 commits February 27, 2025 17:37
* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

---------

Co-authored-by: pkieltyka <18831+pkieltyka@users.noreply.github.com>
Co-authored-by: nachopiris <66640666+nachopiris@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
Co-authored-by: david-littlefarmer <17728576+david-littlefarmer@users.noreply.github.com>
)

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

---------

Co-authored-by: david-littlefarmer <17728576+david-littlefarmer@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
Co-authored-by: AlexanderKolberg <74478295+AlexanderKolberg@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
* feat: add auto prefixing check to account.signMessage

* refactor: refactor logic to use ethers method
Co-authored-by: taylanpince <12650+taylanpince@users.noreply.github.com>
@codesandbox
Copy link

codesandbox bot commented Mar 13, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 13, 2025

Reviewer's Guide by Sourcery

This pull request updates the webrpc-gen version and regenerates API clients for multiple packages. It also refactors message signing in the account package to handle already prefixed messages, removes testnet configurations for MONAD and SOMNIA networks, and updates signature validation in account tests to use ethers.hashMessage instead of ethers.keccak256.

Updated class diagram for Account

classDiagram
  class Account {
    +signMessage(message: BytesLike, chainId: BigNumberish, cantValidateBehavior: string): Promise<string>
  }
  note for Account "Refactors message signing to handle already prefixed messages"
Loading

Updated class diagram for AccountSigner

classDiagram
  class AccountSigner {
    +signMessage(message: string | BytesLike): Promise<string>
  }
  note for AccountSigner "Signs a message with EIP-191 prefix"
Loading

File-Level Changes

Change Details Files
Updated webrpc-gen version and regenerated API clients for multiple packages.
  • Updated the webrpc-gen version from v0.22.0 to v0.23.2 in packages/api/src/api.gen.ts.
  • Updated the webrpc-gen version from v0.21.1 to v0.23.2 in packages/marketplace/src/marketplace.gen.ts.
  • Updated the webrpc-gen version from v0.21.1 to v0.23.2 in packages/metadata/src/metadata.gen.ts.
  • Updated the webrpc-gen version from v0.22.0 to v0.23.2 in packages/relayer/src/rpc-relayer/relayer.gen.ts.
  • Updated the webrpc-gen version from v0.22.0 to v0.23.2 in packages/guard/src/guard.gen.ts.
packages/api/src/api.gen.ts
packages/marketplace/src/marketplace.gen.ts
packages/metadata/src/metadata.gen.ts
packages/relayer/src/rpc-relayer/relayer.gen.ts
packages/guard/src/guard.gen.ts
Refactored message signing in the account package to handle already prefixed messages.
  • Modified the signMessage method in packages/account/src/account.ts to check if the message is already prefixed with EIP-191 before hashing.
  • Updated the signMessage method in packages/account/src/signer.ts to align with the changes in packages/account/src/account.ts.
packages/account/src/account.ts
packages/account/src/signer.ts
Removed testnet configurations for MONAD and SOMNIA networks.
  • Removed MONAD_TESTNET and SOMNIA_TESTNET from the ChainId enum in packages/network/src/constants.ts.
  • Removed the network metadata for MONAD_TESTNET and SOMNIA_TESTNET from the networks object in packages/network/src/constants.ts.
packages/network/src/constants.ts
Updated signature validation in account tests to use ethers.hashMessage instead of ethers.keccak256.
  • Replaced ethers.keccak256(msg) with ethers.hashMessage(msg) in multiple test cases within packages/account/tests/account.spec.ts.
packages/account/tests/account.spec.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@snyk-io
Copy link

snyk-io bot commented Mar 13, 2025

🎉 Snyk checks have passed. No issues have been found so far.

code/snyk check is complete. No issues have been found. (View Details)

@Dargon789 Dargon789 merged commit 4bd3d26 into main Mar 13, 2025
9 checks passed
@Dargon789 Dargon789 deleted the revert-681-update_constants branch March 13, 2025 17:21
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @Dargon789 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider adding a comment explaining why the version constants are being reverted.
  • It looks like you're reverting the webrpc-gen version, is this intentional?
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟡 Complexity: 1 issue found
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Dargon789 added a commit that referenced this pull request Mar 13, 2025
* Revert "[AUTOMATED] Update constants.ts (0xsequence#681)"

This reverts commit a181b69.

* [AUTOMATED] Update files from 0xsequence/stack (0xsequence#680)

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

* [AUTOMATED] Update: api/proto/clients/api.gen.ts

---------






* [AUTOMATED] Update files from 0xsequence/marketplace-api (0xsequence#682)

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

* [AUTOMATED] Update: proto/clients/marketplace.gen.ts

---------





* [AUTOMATED] Update: proto/clients/metadata.gen.ts (0xsequence#684)



* [AUTOMATED] Update: proto/clients/relayer.gen.ts (0xsequence#685)



* [AUTOMATED] Update: proto/clients/guard.gen.ts (0xsequence#686)



* feat: auto prefix message with EIP191 if not prefixed (0xsequence#689)

* feat: add auto prefixing check to account.signMessage

* refactor: refactor logic to use ethers method

* [AUTOMATED] Update: api/proto/clients/api.gen.ts (0xsequence#690)



---------

Co-authored-by: 0xsequence-bot <50996415+0xsequence-bot@users.noreply.github.com>
Co-authored-by: pkieltyka <18831+pkieltyka@users.noreply.github.com>
Co-authored-by: nachopiris <66640666+nachopiris@users.noreply.github.com>
Co-authored-by: VojtechVitek <139342+VojtechVitek@users.noreply.github.com>
Co-authored-by: david-littlefarmer <17728576+david-littlefarmer@users.noreply.github.com>
Co-authored-by: AlexanderKolberg <74478295+AlexanderKolberg@users.noreply.github.com>
Co-authored-by: Gabi <56271768+VGabriel45@users.noreply.github.com>
Co-authored-by: taylanpince <12650+taylanpince@users.noreply.github.com>
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