keplr-wallet icon indicating copy to clipboard operation
keplr-wallet copied to clipboard

[Extension] Fix viewing key bug

Open HeesungB opened this issue 1 year ago • 0 comments

It is original source. If It is not secret-20, It will be cosmwasm contract information.

const query = isSecret20
    ? queries.secret.querySecret20ContractInfo
    : queries.cosmwasm.querycw20ContractInfo;
  const queryContractInfo = query.getQueryContract(contractAddress);

This source has bug. Because If tokenType is undefined, It will be cosmwasm contract information.

const queryContractInfo = (() => {
  switch (tokenType) {
    case "cosmwasm":
      return queries.cosmwasm.querycw20ContractInfo.getQueryContract(
        contractAddress
      );
    case "secretwasm":
      return queries.secret.querySecret20ContractInfo.getQueryContract(
        contractAddress
      );
    case "erc20":
      return queries.erc20.queryERC20ContractInfo.getQueryContract(
        contractAddress
      );
  }
})();

HeesungB avatar Mar 17 '23 09:03 HeesungB