From 07d1258d5ee0ce25c6ad95b2b137406f25f49435 Mon Sep 17 00:00:00 2001 From: 0xPatrick Date: Wed, 31 Jul 2024 15:31:02 -0400 Subject: [PATCH] refactor: clean up outdated todo - whether an address is parsable or not is not a consideration for the vstorage story (#9066) - instead, this should be interpreted as an unexpected error if this path is reached - throwing here would not solve much - this is a notifier divorced from the callsite. instead, - the caller will experience an error when they try and use UNPARSABLE_CHAIN_ADDRESS --- packages/orchestration/src/exos/chain-account-kit.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/orchestration/src/exos/chain-account-kit.js b/packages/orchestration/src/exos/chain-account-kit.js index 842094fde67b..7e6c2f2642bb 100644 --- a/packages/orchestration/src/exos/chain-account-kit.js +++ b/packages/orchestration/src/exos/chain-account-kit.js @@ -163,10 +163,12 @@ export const prepareChainAccountKit = (zone, { watch, asVow }) => this.state.connection = connection; this.state.remoteAddress = remoteAddr; this.state.localAddress = localAddr; + const address = findAddressField(remoteAddr); + if (!address) { + console.error('🚨 failed to parse chain address', remoteAddr); + } this.state.chainAddress = harden({ - // FIXME need a fallback value like icacontroller-1-connection-1 if this fails - // https://github.com/Agoric/agoric-sdk/issues/9066 - value: findAddressField(remoteAddr) || UNPARSABLE_CHAIN_ADDRESS, + value: address || UNPARSABLE_CHAIN_ADDRESS, chainId: this.state.chainId, encoding: 'bech32', });