Skip to content

Conversation

@jurevans
Copy link
Collaborator

@jurevans jurevans commented Jan 8, 2024

resolves #552

  • Bump versions to 0.2.1
  • Updates integrations (useIntegration) to index instances by a ChainKey which is "namada" | "cosmos" | "ethereum" for now, instead of chain Id, as the chain ID can be changed on the Namada side in the extension
  • Similarly, account state in Interface was also keyed this way, updated to use ChainKey
  • With this change, got rid of the defaultChainId export (and related ones from Cosmos, etc.)
  • Changing chain ID in Extension does not break association with integration now
  • Fixed IBC form to work with integration updates
  • Update Ledger Tx to use correct chainId for Reveal PK (ConfirmLedgerTx)
  • All requests in Interface now use rpc & chainId from the extension settings (which user may override)

Testing

If you have balances on the current public testnet, then testing is pretty easy. This is the default value in the chain config for Namada, so the extension & interface can be built without any .env variables - if they are defined, they only affect the initial state of the chain config in the extension, and a user can override those with the Network form

  1. With a local chain connected, use the Network form in the interface, and update the Chain ID & URL
  2. Issue a transaction on the interface - this should submit to your local chain, with the correct chain ID (it will fail and complain otherwise)
  3. In the extension, switch the network to the following:
public-testnet-15.0dacadb8d663
https://proxy.heliax.click/public-testnet-15.0dacadb8d663/
  • Balances should update in the interface (if you have testnet balances for those same accounts)
  1. Issue a transaction - this should use balances & chain ID for the testnet

Also, we can test integrations on the IBC page - when switching Network around, and without refreshing the interface, you should see that Keplr & Namada integrations always work

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2024

@github-actions github-actions bot temporarily deployed to pull request January 8, 2024 13:34 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 8, 2024 14:27 Inactive
@jurevans jurevans changed the title WIP: feat/552 - Namada Interface Pubic Testnet updates WIP: feat/552 - Namada Interface Public Testnet updates Jan 9, 2024
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 1342ca5 to f16ef44 Compare January 10, 2024 12:38
@github-actions github-actions bot temporarily deployed to pull request January 10, 2024 12:42 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 10, 2024 17:28 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 11, 2024 17:29 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch 2 times, most recently from dd10c48 to 98208aa Compare January 12, 2024 12:30
@github-actions github-actions bot temporarily deployed to pull request January 12, 2024 12:34 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 98208aa to 7d0579d Compare January 12, 2024 13:26
@jurevans jurevans self-assigned this Jan 12, 2024
@github-actions github-actions bot temporarily deployed to pull request January 12, 2024 13:34 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 7d0579d to b96ffae Compare January 12, 2024 14:52
@github-actions github-actions bot temporarily deployed to pull request January 12, 2024 14:56 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 12, 2024 16:19 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from f496549 to c662bb9 Compare January 16, 2024 11:27
@github-actions github-actions bot temporarily deployed to pull request January 16, 2024 11:31 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 16, 2024 14:22 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from d6c6528 to f9aefc4 Compare January 17, 2024 17:29
@github-actions github-actions bot temporarily deployed to pull request January 17, 2024 17:33 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from f9aefc4 to 3649afc Compare January 19, 2024 12:24
@github-actions github-actions bot temporarily deployed to pull request January 19, 2024 12:33 Inactive
@jurevans jurevans changed the title WIP: feat/552 - Namada Interface Public Testnet updates feat/552 - Namada Interface Public Testnet updates Jan 19, 2024
@jurevans jurevans marked this pull request as ready for review January 19, 2024 16:37
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from c288537 to c0465ab Compare January 22, 2024 16:47
@github-actions github-actions bot temporarily deployed to pull request January 22, 2024 16:51 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from c0465ab to 1af132b Compare January 23, 2024 12:56
@github-actions github-actions bot temporarily deployed to pull request January 23, 2024 13:01 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 1af132b to 50b1882 Compare January 23, 2024 13:11
@github-actions github-actions bot temporarily deployed to pull request January 23, 2024 13:15 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 50b1882 to dce745e Compare January 24, 2024 13:35
@github-actions github-actions bot temporarily deployed to pull request January 24, 2024 13:39 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from dce745e to 95832d9 Compare January 24, 2024 13:55
@github-actions github-actions bot temporarily deployed to pull request January 24, 2024 14:00 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 167cc9a to dcb6875 Compare January 24, 2024 15:57
@github-actions github-actions bot temporarily deployed to pull request January 24, 2024 16:02 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from dcb6875 to 03b5b3a Compare January 24, 2024 16:58
@github-actions github-actions bot temporarily deployed to pull request January 24, 2024 17:03 Inactive
Copy link
Contributor

@emccorson emccorson left a comment

Choose a reason for hiding this comment

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

Code looks good to me! I just left some questions where I'm not familiar with the code.

It didn't work for me at first, but I just needed to clear the cache to get rid of the old chain config.

DerivedAccount,
"address" | "alias" | "type" | "publicKey"
> & {
chainId: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we still need to have chainId here now that chainKey is added?

NAMADA_INTERFACE_NAMADA_BECH32_PREFIX: bech32Prefix = DEFAULT_BECH32_PREFIX,
} = process.env;

const namada: Chain = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a problem with this PR, but I think chainId and rpc here are going to be wrong if they change in the extension. Although actually, is the RPC setting in the extension meant to apply to the interface too or just the extension?

Copy link
Collaborator Author

@jurevans jurevans Jan 25, 2024

Choose a reason for hiding this comment

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

yep, that's expected! These are just initial values. One of the things I needed to address is that the Network settings in extension are always read as the source of truth. RPC applies to both, since Query & SDK use it in extension, and the interface also uses Query, so the chain RPC setting in the interface must match the extension always (the query to load any new chain settings from extension is important)

{ state: RootState }
>(`${PROPOSALS_ACTIONS_BASE}/${ProposalsActions.FetchProposals}`, async () => {
const { rpc } = chains[defaultChainId];
const { rpc } = chains.namada;
Copy link
Contributor

Choose a reason for hiding this comment

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

In some cases, we are getting the Namada chain config from Redux state, and in others using chains.namada. What is the difference?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

oh, this is wrong! That should be pulled from Redux state. I can add it here, or in a follow up PR. I mainly focused on getting everything confirmed to work at least for transfers (to confirm extension is correct), but yeah, this needs to use Redux state here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just pushed up a fix for this, and also the Staking actions were referring to default config instead of the Redux state

@github-actions github-actions bot temporarily deployed to pull request January 25, 2024 13:28 Inactive
@jurevans jurevans force-pushed the feat/552-interface-testnet-updates branch from 3987d1b to 4f5244a Compare January 25, 2024 14:23
@github-actions github-actions bot temporarily deployed to pull request January 25, 2024 14:28 Inactive
@jurevans jurevans merged commit 24e9d1f into main Jan 25, 2024
@jurevans jurevans deleted the feat/552-interface-testnet-updates branch January 25, 2024 16:18
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.

Interface - Public Testnet release updates

4 participants