bugfixes
This commit is contained in:
@@ -36,6 +36,7 @@ import RoutePrice from "@/components/RoutePrice.vue";
|
||||
import {findRoute} from "@/blockchain/route.js";
|
||||
import {SingletonCoroutine, routeInverted} from "@/misc.js";
|
||||
import {computed, ref} from "vue";
|
||||
import {queryHelperContract} from "@/blockchain/contract.js";
|
||||
|
||||
const s = useStore()
|
||||
const os = useOrderStore()
|
||||
@@ -83,9 +84,16 @@ async function componentFindRoute() {
|
||||
console.log('finding route', s.chainId.value, tokenA, tokenB)
|
||||
os.routesPending = true
|
||||
try {
|
||||
const result = await findRoute(s.chainId.value, tokenA, tokenB)
|
||||
console.log('found route', result)
|
||||
os.routes = result
|
||||
console.log('getting query helper')
|
||||
const helper = await queryHelperContract(s.helper, s.provider)
|
||||
if (!helper) {
|
||||
console.log('no helper')
|
||||
}
|
||||
else {
|
||||
const result = await findRoute(helper, s.chainId.value, tokenA, tokenB)
|
||||
console.log('found route', result)
|
||||
os.routes = result
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
console.log('ignoring routes exception', e)
|
||||
|
||||
@@ -90,7 +90,7 @@ const TokenRow = defineAsyncComponent(()=>import('./TokenRow.vue'))
|
||||
const s = useStore()
|
||||
|
||||
const props = defineProps(['owner', 'num'])
|
||||
const addr = computed(()=>vaultAddress(props.owner, props.num))
|
||||
const addr = computed(()=>vaultAddress(s.factory, s.vaultInitCodeHash, props.owner, props.num))
|
||||
const balances = computed(()=>{
|
||||
const bs = s.vaultBalances[addr.value]
|
||||
console.log('balances', addr.value, s.vaultBalances, bs)
|
||||
@@ -115,8 +115,7 @@ function checkVault() {
|
||||
ensureVault()
|
||||
}
|
||||
|
||||
// todo remove automatic vault creation for Alpha 2
|
||||
s.$subscribe((mutation, state)=>{checkVault()})
|
||||
setTimeout(checkVault, 1)
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user