mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
fix simulation
This commit is contained in:
parent
645bf1ecbf
commit
41597bc02f
|
@ -28,15 +28,19 @@ export function useDSA() {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(dsa, async () => {
|
const refreshAccounts = async () => {
|
||||||
if (dsa.value) {
|
accounts.value = await dsa.value.getAccounts(account.value);
|
||||||
accounts.value = await dsa.value.getAccounts();
|
|
||||||
|
|
||||||
if (accounts.value.length > 0) {
|
if (accounts.value.length > 0) {
|
||||||
activeAccount.value = accounts.value[0];
|
activeAccount.value = accounts.value[0];
|
||||||
} else {
|
} else {
|
||||||
activeAccount.value = undefined;
|
activeAccount.value = undefined;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(dsa, async () => {
|
||||||
|
if (dsa.value) {
|
||||||
|
refreshAccounts()
|
||||||
}
|
}
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
window.dsa = dsa.value;
|
window.dsa = dsa.value;
|
||||||
|
@ -161,6 +165,7 @@ export function useDSA() {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dsa,
|
dsa,
|
||||||
|
refreshAccounts,
|
||||||
activeAccount: readonly(activeAccount),
|
activeAccount: readonly(activeAccount),
|
||||||
accounts,
|
accounts,
|
||||||
createAccount,
|
createAccount,
|
||||||
|
|
|
@ -9,7 +9,7 @@ const forkId = ref(null);
|
||||||
export function useTenderly() {
|
export function useTenderly() {
|
||||||
const { $config } = useContext();
|
const { $config } = useContext();
|
||||||
const { setWeb3, refreshWeb3 } = useWeb3();
|
const { setWeb3, refreshWeb3 } = useWeb3();
|
||||||
const { accounts } = useDSA();
|
const { accounts, refreshAccounts } = useDSA();
|
||||||
const canSimulate = computed(
|
const canSimulate = computed(
|
||||||
() => $config.TENDERLY_FORK_PATH && $config.TENDERLY_KEY
|
() => $config.TENDERLY_FORK_PATH && $config.TENDERLY_KEY
|
||||||
);
|
);
|
||||||
|
@ -40,12 +40,13 @@ export function useTenderly() {
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setForkId(data?.simulation_fork?.id);
|
await setForkId(data?.simulation_fork?.id);
|
||||||
if (data?.simulation_fork?.id) {
|
if (data?.simulation_fork?.id) {
|
||||||
addBalance();
|
await addBalance();
|
||||||
|
await refreshAccounts();
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
stopSimulation();
|
await stopSimulation();
|
||||||
}
|
}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
@ -65,7 +66,7 @@ export function useTenderly() {
|
||||||
|
|
||||||
forkId.value = null;
|
forkId.value = null;
|
||||||
window.localStorage.removeItem("forkId");
|
window.localStorage.removeItem("forkId");
|
||||||
refreshWeb3();
|
await refreshWeb3();
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user