File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
apps/extension/src/pages/setting/advanced/delete-suggest-chain
packages/chain-validator/src Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,8 @@ export const SettingGeneralDeleteSuggestChainPage: FunctionComponent = observer(
4949 key = { chainInfo . chainIdentifier }
5050 chainInfo = { chainInfo }
5151 onClickClose = { async ( ) => {
52- await chainStore . removeChainInfo (
53- chainInfo . chainIdentifier
54- ) ;
52+ // 여기서 chain identifier를 쓰면 안되고 꼭 chainId를 써야함
53+ await chainStore . removeChainInfo ( chainInfo . chainId ) ;
5554
5655 dispatchGlobalEventExceptSelf (
5756 "keplr_suggested_chain_removed"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313import { SupportedChainFeatures } from "./feature" ;
1414
1515import Joi , { ObjectSchema } from "joi" ;
16+ import { ChainIdHelper } from "@keplr-wallet/cosmos" ;
1617
1718export const CurrencySchema = Joi . object <
1819 Currency & {
@@ -281,6 +282,16 @@ export const ChainInfoSchema = Joi.object<ChainInfo>({
281282 hideInUI : Joi . boolean ( ) ,
282283 isTestnet : Joi . boolean ( ) ,
283284} ) . custom ( ( value : ChainInfo ) => {
285+ const chainIdentifier1 = ChainIdHelper . parse ( value . chainId ) ;
286+ if ( chainIdentifier1 . version !== 0 ) {
287+ const chainIdentifier2 = ChainIdHelper . parse ( chainIdentifier1 . identifier ) ;
288+ if ( chainIdentifier1 . identifier !== chainIdentifier2 . identifier ) {
289+ throw new Error (
290+ `chainIdentifier cannot be nested in the {chainIdentifier}-{version} format (chainId: ${ value . chainId } , chainIdentifier: ${ chainIdentifier1 . identifier } )`
291+ ) ;
292+ }
293+ }
294+
284295 if ( value . nodeProvider ) {
285296 if ( ! value . nodeProvider . email && ! value . nodeProvider . discord ) {
286297 throw new Error ( "email or discord should be provided" ) ;
You can’t perform that action at this time.
0 commit comments