Fetch AMB signatures a bit earlier (#620)
This commit is contained in:
parent
1e3aa53ab3
commit
4eba91ef7e
@ -45,6 +45,7 @@ export const ManualExecutionButton = ({
|
|||||||
const { library, activate, account, active } = useWeb3React()
|
const { library, activate, account, active } = useWeb3React()
|
||||||
const [manualExecution, setManualExecution] = useState(false)
|
const [manualExecution, setManualExecution] = useState(false)
|
||||||
const [allowFailures, setAllowFailures] = useState(false)
|
const [allowFailures, setAllowFailures] = useState(false)
|
||||||
|
const notReady = !foreign.bridgeContract || !signatureCollected || !signatureCollected.length
|
||||||
|
|
||||||
useEffect(
|
useEffect(
|
||||||
() => {
|
() => {
|
||||||
@ -150,7 +151,7 @@ export const ManualExecutionButton = ({
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="is-center">
|
<div className="is-center">
|
||||||
<ActionButton className="button outline" onClick={() => setManualExecution(true)}>
|
<ActionButton disabled={notReady} className="button outline" onClick={() => setManualExecution(true)}>
|
||||||
Execute
|
Execute
|
||||||
</ActionButton>
|
</ActionButton>
|
||||||
</div>
|
</div>
|
||||||
|
@ -86,6 +86,14 @@ export const getConfirmationsForTx = async (
|
|||||||
setPendingConfirmations(validatorPendingConfirmations.length > 0)
|
setPendingConfirmations(validatorPendingConfirmations.length > 0)
|
||||||
} else {
|
} else {
|
||||||
setPendingConfirmations(false)
|
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(
|
const undefinedConfirmations = validatorConfirmations.filter(
|
||||||
@ -115,15 +123,6 @@ export const getConfirmationsForTx = async (
|
|||||||
status: VALIDATOR_CONFIRMATION_STATUS.NOT_REQUIRED
|
status: VALIDATOR_CONFIRMATION_STATUS.NOT_REQUIRED
|
||||||
}))
|
}))
|
||||||
updateConfirmations(notRequiredConfirmations)
|
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
|
// get transactions from success signatures
|
||||||
|
Loading…
Reference in New Issue
Block a user