Skip to content

Commit

Permalink
bump registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentine1898 committed Jun 28, 2024
1 parent 88d2129 commit b17ab08
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 90 deletions.
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@bufbuild/protobuf": "^1.10.0",
"@connectrpc/connect": "^1.4.0",
"@connectrpc/connect-web": "^1.4.0",
"@penumbra-labs/registry": "8.0.1",
"@penumbra-labs/registry": "9.1.0",
"@penumbra-zone/bech32m": "^6.1.0",
"@penumbra-zone/client": "^9.0.0",
"@penumbra-zone/crypto-web": "^6.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@buf/cosmos_ibc.bufbuild_es": "1.10.0-20240625204953-f66a294d94c4.1",
"@buf/penumbra-zone_penumbra.bufbuild_es": "1.10.0-20240625233123-429cb316aa7c.1",
"@bufbuild/protobuf": "^1.10.0",
"@penumbra-labs/registry": "8.0.1",
"@penumbra-labs/registry": "9.1.0",
"@penumbra-zone/crypto-web": "^6.0.0",
"@penumbra-zone/query": "^7.0.0",
"@penumbra-zone/storage": "^7.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/components/ui/tx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { TransactionView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbr
import { MemoViewComponent } from './memo-view';
import { ActionViewComponent } from './action-view';
import { ViewBox, ViewSection } from './viewbox';
import { getStakingTokenMetaData } from './registry';
import { getFeeAssetMetadataOrDefault } from './registry';
import { ValueView } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb';
import { ValueViewComponent } from '../value';

Expand All @@ -13,7 +13,7 @@ export const TransactionViewComponent = ({ txv }: { txv: TransactionView }) => {
// Request the fee 'Metadata' and construct a 'ValueView' object
const chainId = txv.bodyView.transactionParameters.chainId;
const assetId = txv.bodyView.transactionParameters.fee.assetId;
const feeAssetMetadata = getStakingTokenMetaData(chainId, assetId);
const feeAssetMetadata = getFeeAssetMetadataOrDefault(chainId, assetId);
const feeValueView = new ValueView({
valueView: {
case: 'knownAssetId',
Expand Down
12 changes: 4 additions & 8 deletions packages/ui/components/ui/tx/registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ import {
Metadata,
} from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/asset/v1/asset_pb';

export function getStakingTokenMetaData(
export function getFeeAssetMetadataOrDefault(
chainId: string,
assetId: AssetId | undefined,
assetId?: AssetId,
): Metadata | undefined {
const registryClient = new ChainRegistryClient();
const registry = registryClient.get(chainId);

if (assetId === undefined) {
assetId = registry.stakingAssetId;
}
const StakingTokenMetadata = registry.getMetadata(assetId);

return StakingTokenMetadata;
const feeAssetId = assetId ?? registryClient.globals().stakingAssetId;
return registry.getMetadata(feeAssetId);
}
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@penumbra-labs/registry": "8.0.1",
"@penumbra-labs/registry": "9.1.0",
"@penumbra-zone/bech32m": "^6.1.0",
"@penumbra-zone/getters": "^9.0.0",
"@penumbra-zone/perspective": "^7.0.0",
Expand Down
160 changes: 83 additions & 77 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

0 comments on commit b17ab08

Please sign in to comment.