Skip to content

Commit

Permalink
tx status interval updates appropriately for all stats
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberhorsey committed Dec 23, 2022
1 parent 1d4918a commit 32bc229
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
10 changes: 9 additions & 1 deletion packages/bridge-ui/src/components/Transaction.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import { fetchSigner, switchNetwork } from "@wagmi/core";
import Tooltip from "./Tooltip.svelte";
import TooltipModal from "./modals/TooltipModal.svelte";
import Bridge from "../constants/abi/Bridge";
export let transaction: BridgeTransaction;
Expand All @@ -34,7 +35,6 @@
let tooltipOpen: boolean = false;
let processable: boolean = false;
onMount(async () => {
processable = await isProcessable();
});
Expand Down Expand Up @@ -103,6 +103,14 @@
const interval = setInterval(async () => {
processable = await isProcessable();
const contract = new ethers.Contract(
chains[transaction.toChainId].bridgeAddress,
Bridge,
$providers.get(chains[transaction.message.destChainId.toNumber()].id)
);
transaction.status = await contract.getMessageStatus(transaction.signal);
transaction = transaction;
if (transaction.status === MessageStatus.Done) clearInterval(interval);
}, 20 * 1000);
</script>
Expand Down
27 changes: 14 additions & 13 deletions packages/relayer/message/process_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,20 @@ func (p *Processor) sendProcessMessageCall(
return nil, errors.New("p.getLatestNonce")
}

profitable, gas, err := p.isProfitable(ctx, event.Message, proof)
if err != nil {
return nil, errors.Wrap(err, "p.isProfitable")
}

if bool(p.profitableOnly) && !profitable {
return nil, relayer.ErrUnprofitable
}

if gas != 0 {
auth.GasLimit = gas
log.Infof("gasLimit: %v", gas)
}
// profitable, gas, err := p.isProfitable(ctx, event.Message, proof)
// if err != nil {
// return nil, errors.Wrap(err, "p.isProfitable")
// }

// if bool(p.profitableOnly) && !profitable {
// return nil, relayer.ErrUnprofitable
// }

// if gas != 0 {
// auth.GasLimit = gas
// log.Infof("gasLimit: %v", gas)
// }
auth.GasLimit = 800000

// process the message on the destination bridge.
tx, err := p.destBridge.ProcessMessage(auth, event.Message, proof)
Expand Down

0 comments on commit 32bc229

Please sign in to comment.