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: usePSP22Balances ignores active chain #47

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

ical10
Copy link
Contributor

@ical10 ical10 commented Nov 8, 2023

Closes #42

@ical10 ical10 self-assigned this Nov 8, 2023
Copy link

changeset-bot bot commented Nov 8, 2023

🦋 Changeset detected

Latest commit: ca9ce54

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@ical10 ical10 requested a review from wottpal November 8, 2023 07:23
@ical10 ical10 force-pushed the feat/42-usePSP22Balances-ignores-active-chain branch from a717d90 to c4caf85 Compare November 8, 2023 07:29
@wottpal wottpal force-pushed the feat/42-usePSP22Balances-ignores-active-chain branch from d0c9881 to 25883e8 Compare November 14, 2023 10:21
let balance = new BN(0)

const contract = psp22ContractMap[slug]
const _balanceOf = await contract.query['psp22::balanceOf'](
Copy link
Member

Choose a reason for hiding this comment

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

When testing getPSP22Balance (without hook) it throws:

TypeError: Cannot read properties of undefined (reading 'query')

I expect this happens here because it seems you never initialized the ContractPromise's. Or do I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

let balance = new BN(0)

const contract = psp22ContractMap[slug]
const _balanceOf = await contract.query['psp22::balanceOf'](
Copy link
Member

Choose a reason for hiding this comment

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

Why are you not using our contractQuery helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced contract.query with contractQuery helper.

let balance = new BN(0)

const contract = psp22ContractMap[slug]
const _balanceOf = await contract.query['psp22::balanceOf'](
Copy link
Member

Choose a reason for hiding this comment

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

Why are you not using our contractQuery helper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

@ical10 ical10 force-pushed the feat/42-usePSP22Balances-ignores-active-chain branch from 493022d to f1a00ae Compare November 15, 2023 11:01
@ical10 ical10 requested a review from wottpal November 16, 2023 08:23
@wottpal wottpal merged commit 754334b into main Nov 16, 2023
@wottpal wottpal deleted the feat/42-usePSP22Balances-ignores-active-chain branch November 16, 2023 22:47
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.

usePSP22Balances ignores active chain
2 participants