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

Stargate with musselnet #69

Merged
merged 25 commits into from
Jan 21, 2021
Merged

Stargate with musselnet #69

merged 25 commits into from
Jan 21, 2021

Conversation

abefernan
Copy link
Collaborator

@abefernan abefernan commented Jan 19, 2021

Closes #67
Closes #56

@abefernan abefernan self-assigned this Jan 19, 2021
@abefernan abefernan marked this pull request as draft January 19, 2021 18:49
@ethanfrey
Copy link
Member

ethanfrey commented Jan 20, 2021

PO review testing workflows:

  • Local keys and hitting faucet works (in Firefox)
  • Cw20-wallet works
    • Check balance
    • Check other's balance
    • Send Balances
    • Set Allowances
    • Use Allowance (could not test)
  • Wallet works
    • View own balance
    • Check other's balance
    • Send tokens
  • Name Service works
    • List name services
    • Search name
    • Create name
    • Transfer name
  • Staking service works
    • List contracts
    • Cannot stake/withdraw without funds (proper ui feedback)
    • Can stake with funds (Blocked on receiving ufrites)
    • Can withdraw
    • List claims proper
    • (Withdraw claims needs 3 weeks to test)

Other:

  • Test ledger app (with chrome)
  • Test keplr support

If you want to add cw20 allowance for me to test, my address is wasm17qgdxytgygz54etpq4nkmptfl5c3rl8z2j5d5h

Notes for improvements

  • Going directly to http://localhost:3000/stakes/result gives me TypeError: _history$location$sta is undefined in src/components/logic/OperationResult/index.tsx:38 (doesn't happen if I just go to /stakes/)

  • NameApp UI improvement: do not allow purchase/transfer if insufficient funds (or better error message at least). When I try to purchase a fries name (with no ufrites), I get: Error: Error when broadcasting tx 0D6C3027C3C7C82FD9A6AF918CC352F49D20D0D459919F1664ADE671AC52489F at height 141960. Code: 5; Raw log: failed to execute message (which says nothing about not having the funds to pay it)

@ethanfrey
Copy link
Member

Listing claims has an error (I think this is when we moved from one item to a paginated list of claims): http://localhost:3000/stakes/claims/wasm1k0jntykt7e4g3y88ltc60czgjuqdy4c937v7dp gives

ClaimsStackTrace

@ethanfrey
Copy link
Member

What's the status here?

It seems to me (reading commit history) that all of the open issues have been addressed. Please mark as "ready for review" when you feel it is ready for a final PR review. I will test it as a user, and ask @willclarktech to give it a quick pass for code.

While this is all fresh in your head, can you make a new PR documenting all the steps you took here to make it work? Please include things like update ledger dependencies for new chrome, etc.

@abefernan abefernan marked this pull request as ready for review January 21, 2021 09:02
packages/cw20-wallet/package.json Outdated Show resolved Hide resolved
@@ -14,25 +14,26 @@ const local: AppConfig = {
uatom: { denom: "ATOM", fractionalDigits: 6 },
},
gasPrice: 0.025,
// TODO make sure it's correct
codeId: 40,
Copy link
Contributor

Choose a reason for hiding this comment

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

What's this codeId for? The CW20 upload? I believe it's 2.

packages/logic/src/service/wallet.tsx Outdated Show resolved Hide resolved
for (const denom in config.coinMap) {
const coin = await client.getBalance(address, denom);
if (coin) balance.push(coin);
}
Copy link
Contributor

@willclarktech willclarktech Jan 21, 2021

Choose a reason for hiding this comment

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

This is a pretty strange way of doing this. Why does this mutate an existing array rather than just returning the new balances and assigning them outside the function?

packages/logic/src/service/wallet.tsx Outdated Show resolved Hide resolved
@@ -14,25 +14,26 @@ const local: AppConfig = {
uatom: { denom: "ATOM", fractionalDigits: 6 },
},
gasPrice: 0.025,
// TODO make sure it's correct
codeId: 5,
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you uploading this yourself? We don't deploy it in the init script.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just a placeholder, I'll indicate that it needs to be filled with the code used when uploading

Copy link
Member

Choose a reason for hiding this comment

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

For local apps, it is unclear.
I think it is 6 on musselnet (I added it with wasmd commands)

Maybe address this in another PR - proper local setup.
That should start up a blockchain, a faucet, and load all the contracts you want under predictable IDs (and a few instances of each). This is a fair bit of work (including getting proper setup for a staking contract to a real validator)

Copy link
Contributor

Choose a reason for hiding this comment

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

We already have a lot of codes deployed with predictable IDs via the scripts in CosmJS, but we don't currently deploy a name service there.

const typeRegistry = new Registry();
typeRegistry.register(msgStoreCodeTypeUrl, MsgStoreCode);
typeRegistry.register(msgInstantiateContractTypeUrl, MsgInstantiateContract);
typeRegistry.register(msgExecuteContractTypeUrl, MsgExecuteContract);
Copy link
Contributor

Choose a reason for hiding this comment

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

You shouldn't need to use a custom type registry with the latest release.

Copy link
Member

Choose a reason for hiding this comment

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

Very nice. All x/wasm, x/bank, x/staking types are included by default?
So only if you have custom app-specific protos?

I guess this can lead to simplifying the migration guide

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes exactly, x/bank and x/staking are included in the SigningStargateClient and x/wasm is added in SigningCosmWasmClient.

Copy link
Member

@ethanfrey ethanfrey left a comment

Choose a reason for hiding this comment

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

I did a second PO review and everything is working now.

Tested with both ledger and keplr in chrome. Great stuff.

I will create some issues for the outstanding comments from Will

@ethanfrey
Copy link
Member

I'm going to merge this as-is.
Left some follow up in #72 #73 and #74

@ethanfrey ethanfrey merged commit 0eecbde into master Jan 21, 2021
@ethanfrey ethanfrey deleted the stargate-musselnet branch January 21, 2021 13:12
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.

Update all dApps to stargate When faucet is down, it goes in infinite loop in initializing
3 participants