Skip to content

Commit

Permalink
transactions unique to address
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Dec 23, 2022
1 parent ae1b84c commit 5d79675
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
7 changes: 5 additions & 2 deletions packages/bridge-ui/src/components/form/BridgeForm.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,11 @@
// tx.chainId is not set immediately but we need it later. set it
// manually.
tx.chainId = $fromChain.id;
const storageKey = `transactions-${await (
await $signer.getAddress()
).toLowerCase()}`;
let transactions: BridgeTransaction[] = JSON.parse(
await window.localStorage.getItem("transactions")
await window.localStorage.getItem(storageKey)
);
const bridgeTransaction: BridgeTransaction = {
Expand All @@ -215,7 +218,7 @@
}
await window.localStorage.setItem(
"transactions",
storageKey,
JSON.stringify(transactions)
);
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/domain/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const mainnet: WagmiChain = {

export const taiko: WagmiChain = {
id: CHAIN_ID_TAIKO,
name: "Taiko A1",
name: "Taiko Snæfellsjökull",
network: "",
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
rpcUrls: {
Expand Down
4 changes: 3 additions & 1 deletion packages/bridge-ui/src/erc20/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ class ERC20Bridge implements Bridge {
chains[opts.message.destChainId.toNumber()].headerSyncAddress,
});

return await contract.processMessage(opts.message, proof);
return await contract.processMessage(opts.message, proof, {
gasLimit: BigNumber.from(1200000),
});
} else {
return await contract.retryMessage(opts.message, false);
}
Expand Down
4 changes: 3 additions & 1 deletion packages/bridge-ui/src/eth/bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ class ETHBridge implements BridgeInterface {

const proof = await this.prover.GenerateProof(proofOpts);

return await contract.processMessage(opts.message, proof);
return await contract.processMessage(opts.message, proof, {
gasLimit: BigNumber.from(1000000),
});
} else {
return await contract.retryMessage(opts.message);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/bridge-ui/src/storage/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class StorageService implements Transactioner {
chainID?: number
): Promise<BridgeTransaction[]> {
const txs: BridgeTransaction[] = JSON.parse(
this.storage.getItem("transactions")
this.storage.getItem(`transactions-${address.toLowerCase()}`)
);

const bridgeTxs: BridgeTransaction[] = [];
Expand Down

0 comments on commit 5d79675

Please sign in to comment.