Compare commits

..
Author SHA1 Message Date
Thunnini 1536977473 Fix a bug related to evm chain and ledger 2022-12-21 01:55:40 +09:00
Thunnini aec2bc7fd3 Add evmos, injective 2022-12-21 01:30:50 +09:00
Thunnini ad6e806e52 Add logging before simulating 2022-12-21 01:20:27 +09:00
4 changed files with 20 additions and 20 deletions
+2
View File
@@ -81,4 +81,6 @@ export const CHAIN_ALLOWLIST =
"tgrade-mainnet-1",
"umee-1",
"vidulum-1",
"evmos_9001-2",
"injective-1",
].join(",");
+8 -7
View File
@@ -15,8 +15,7 @@ import { TendermintTxTracer } from "@keplr-wallet/cosmos";
import { queryAddressesFromTwitterName } from "../../queries";
import { RegisteredAddresses } from "../../types";
import { SHARE_URL } from "../../constants/twitter";
import { REST_URL, RPC_URL } from "../../constants/icns";
import { fetch_retry } from "../../utils/url";
import { RPC_URL } from "../../constants/icns";
export default function CompletePage() {
const router = useRouter();
@@ -36,12 +35,14 @@ export default function CompletePage() {
}, [router.query]);
const initialize = async (txHash: string, twitterUserName: string) => {
try {
const response = await (
await fetch_retry(`${REST_URL}/cosmos/tx/v1beta1/txs/${txHash}`, 12)
).json();
const txTracer = new TendermintTxTracer(RPC_URL, "/websocket");
if (response.code || response.tx_response.code === 0) {
try {
const result: { code?: number } = await txTracer.traceTx(
Buffer.from(txHash, "hex"),
);
if (!result.code || result.code === 0) {
amplitude.track("complete registration");
const addresses = await queryAddressesFromTwitterName(twitterUserName);
+10
View File
@@ -127,6 +127,12 @@ export default function VerificationPage() {
return true;
}
if (walletKey) {
if (walletKey.isLedgerNano && chain.isEthermintLike) {
return true;
}
}
for (const registeredChain of registeredChainList) {
if (
chain.prefix === registeredChain.bech32_prefix &&
@@ -214,6 +220,8 @@ export default function VerificationPage() {
);
setRegisteredChainList(addressesQueryResponse.data.addresses);
} else {
setRegisteredChainList([]);
}
} catch (error) {
if (error instanceof Error) {
@@ -416,6 +424,8 @@ export default function VerificationPage() {
rest: REST_URL,
};
console.log(aminoMsgs);
const simulated = await simulateMsgs(
chainInfo,
walletKey.bech32Address,
-13
View File
@@ -21,19 +21,6 @@ export function request<TResponse>(
.then((data) => data as TResponse);
}
export const fetch_retry = async (
url: string,
n: number,
options?: RequestInit,
): Promise<Response> => {
try {
return await fetch(url, options);
} catch (err) {
if (n === 1) throw err;
return await fetch_retry(url, n - 1, options);
}
};
export function buildQueryString(query: Record<string, any>): string {
return Object.entries(query)
.map(([key, value]) =>