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

feat: Generate Cosmos address for Injective #4618

Merged
merged 10 commits into from
Oct 8, 2024
Merged

Conversation

ameten
Copy link
Contributor

@ameten ameten commented Oct 3, 2024

Description

Injective uses different logic compared to Neutron and Osmosis to generate account addresses from public key. It is implemented in this PR so that sender address is correctly generated from signer info of transaction.

Depending on the type of public key communicated in the transaction, we shall generate either Bitcoin-like or Ethereum-like address for Injective.

We can also specify the type of account id for the signer. Bitcoin-like will be chosen by default, so, we don't need to change the configuration of Relayer.

Drive-by changes

Made some errors to be warnings. We'll add metrics to measure how frequent the issues are and decide how to fix them:

  1. transaction contains multiple contract execution messages
  2. transaction contains fees in unsupported denominations

Made Scraper to refrain from recording transaction which it cannot parse properly.

Backward compatibility

Yes

Testing

Added unit tests
Manual testing with Injective blockchain

Copy link

changeset-bot bot commented Oct 3, 2024

⚠️ No Changeset found

Latest commit: 431c23b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.85%. Comparing base (b314d3e) to head (431c23b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4618   +/-   ##
=======================================
  Coverage   73.85%   73.85%           
=======================================
  Files         100      100           
  Lines        1423     1423           
  Branches      181      181           
=======================================
  Hits         1051     1051           
  Misses        351      351           
  Partials       21       21           
Components Coverage Δ
core 84.61% <ø> (ø)
hooks 75.71% <ø> (ø)
isms 78.94% <ø> (ø)
token 88.23% <ø> (ø)
middlewares 77.39% <ø> (ø)

@ameten ameten force-pushed the ameten/fix_address_generation branch 2 times, most recently from 0e38f36 to 11e13e5 Compare October 4, 2024 10:24
Copy link
Collaborator

@tkporter tkporter left a comment

Choose a reason for hiding this comment

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

🫡

@ameten ameten force-pushed the ameten/fix_address_generation branch from 11e13e5 to 6ac1ace Compare October 7, 2024 10:11
ameten and others added 9 commits October 8, 2024 09:11
Injective uses different logic on generating account addresses from
public key. It is implemented in this PR so that sender address is
correctly generated from signer info of transaction.

Yes

Added unit tests
Manual testing with Injective blockchain

---------

Co-authored-by: Danil Nemirovsky <[email protected]>
@ameten ameten force-pushed the ameten/fix_address_generation branch from 441a17b to 58cc9b6 Compare October 8, 2024 08:11
@ameten ameten enabled auto-merge October 8, 2024 10:15
@ameten ameten added this pull request to the merge queue Oct 8, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 8, 2024
@ameten ameten added this pull request to the merge queue Oct 8, 2024
Merged via the queue into main with commit e490e77 Oct 8, 2024
36 checks passed
@ameten ameten deleted the ameten/fix_address_generation branch October 8, 2024 10:56
ltyu pushed a commit that referenced this pull request Oct 8, 2024
### Description

Injective uses different logic compared to Neutron and Osmosis to
generate account addresses from public key. It is implemented in this PR
so that sender address is correctly generated from signer info of
transaction.

Depending on the type of public key communicated in the transaction, we
shall generate either Bitcoin-like or Ethereum-like address for
Injective.

We can also specify the type of account id for the signer. Bitcoin-like
will be chosen by default, so, we don't need to change the configuration
of Relayer.

### Drive-by changes

Made some errors to be warnings. We'll add metrics to measure how
frequent the issues are and decide how to fix them:
1. transaction contains multiple contract execution messages
2. transaction contains fees in unsupported denominations

Made Scraper to refrain from recording transaction which it cannot parse
properly.

### Backward compatibility

Yes

### Testing

Added unit tests
Manual testing with Injective blockchain

---------

Co-authored-by: Danil Nemirovsky <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants