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!: chainHub.getAsset requires holdingChainName parameter #10588

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

0xpatrickdev
Copy link
Member

@0xpatrickdev 0xpatrickdev commented Nov 29, 2024

refs: #10445

Description

IBC Denoms are unique to a chain but not all not all chains. e.g., if channel-0 points to osmosis for two chains, the uosmo denom will be ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518 for both.

This change requires callers to specify the holdingChainName for the denom they wish to retrieve information about.

Security Considerations

None

Scaling Considerations

None

Documentation Considerations

None

Testing Considerations

Updates existing tests. Motivated from work in #10571 which surfaced this issue.

Upgrade Considerations

Breaking change, but for library code that will be part on NPM or FUSDC release.

@0xpatrickdev 0xpatrickdev added the force:integration Force integration tests to run on PR label Nov 29, 2024
Copy link

cloudflare-workers-and-pages bot commented Nov 29, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: c12d868
Status: ✅  Deploy successful!
Preview URL: https://4e07532d.agoric-sdk.pages.dev
Branch Preview URL: https://pc-10445-chain-hub-get-asset.agoric-sdk.pages.dev

View logs

@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch 3 times, most recently from 88245f1 to d280d69 Compare November 29, 2024 20:40
- to facililate registering the same denom across multiple chains in `ChainHub`
- denoms are unique to a chain, but not all chains
- since denoms are only unique to a chain and all chains, require `holdingChainName` parameter for asset info lookups
@0xpatrickdev 0xpatrickdev changed the base branch from pc/10445-transfer-pfm to master November 29, 2024 21:53
Copy link

Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label.

@0xpatrickdev 0xpatrickdev force-pushed the pc/10445-chain-hub-get-asset branch 2 times, most recently from 7cb895e to 1eed391 Compare November 29, 2024 22:39
@0xpatrickdev
Copy link
Member Author

✘ [fail]: user can open a vault under debt limit The IST balance should increase by the minted amount

This seems unrelated to these changes and is likely a flake.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

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

this seems about right

@@ -146,6 +146,7 @@ export interface Orchestrator {
IssuingChain extends keyof KnownChains,
>(
denom: Denom,
holdingChainName: HoldingChain,
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

why is holdingChainName constrained to a static list of known chains?

OK, I guess I see why for now. Tolerable tech debt, I suppose.

In due course, it seems like getDenomInfo should be parameterized by...

  getDenomInfo: <
    HoldingChainInfo extends ChainInfo,
    IssuingChainInfo extends ChainInfo,
  >(

and maybe even the ConnectionInfo between them.

const actual = orc.getDenomInfo('utoken1');
const actual = orc.getDenomInfo(
'utoken1',
// @ts-expect-error 'mock' not a KnownChain
Copy link
Member

Choose a reason for hiding this comment

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

doesn't seem like that should be an error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants