Fetch AMB signatures a bit earlier (#620)

This commit is contained in:
Kirill Fedoseev 2021-11-03 19:21:35 +03:00 committed by GitHub
parent 1e3aa53ab3
commit 4eba91ef7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

@ -45,6 +45,7 @@ export const ManualExecutionButton = ({
const { library, activate, account, active } = useWeb3React()
const [manualExecution, setManualExecution] = useState(false)
const [allowFailures, setAllowFailures] = useState(false)
const notReady = !foreign.bridgeContract || !signatureCollected || !signatureCollected.length
useEffect(
() => {
@ -150,7 +151,7 @@ export const ManualExecutionButton = ({
return (
<div>
<div className="is-center">
<ActionButton className="button outline" onClick={() => setManualExecution(true)}>
<ActionButton disabled={notReady} className="button outline" onClick={() => setManualExecution(true)}>
Execute
</ActionButton>
</div>

@ -86,6 +86,14 @@ export const getConfirmationsForTx = async (
setPendingConfirmations(validatorPendingConfirmations.length > 0)
} else {
setPendingConfirmations(false)
if (fromHome) {
// fetch collected signatures for possible manual processing
setSignatureCollected(
await Promise.all(
Array.from(Array(requiredSignatures).keys()).map(i => bridgeContract.methods.signature(hashMsg, i).call())
)
)
}
}
const undefinedConfirmations = validatorConfirmations.filter(
@ -115,15 +123,6 @@ export const getConfirmationsForTx = async (
status: VALIDATOR_CONFIRMATION_STATUS.NOT_REQUIRED
}))
updateConfirmations(notRequiredConfirmations)
if (fromHome) {
// fetch collected signatures for possible manual processing
setSignatureCollected(
await Promise.all(
Array.from(Array(requiredSignatures).keys()).map(i => bridgeContract.methods.signature(hashMsg, i).call())
)
)
}
}
// get transactions from success signatures