Compare commits
No commits in common. "5a9fdbd580e4869cccec13d78c7ec26fe5130a0c" and "3bfc0169ee7c6709752fdc15934baa5a216861d4" have entirely different histories.
5a9fdbd580
...
3bfc0169ee
@ -2820,27 +2820,25 @@ func (h *MenuHandlers) LoadSwapToList(ctx context.Context, sym string, input []b
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get active pool address or fall back to default
|
defaultPool := dataserviceapi.PoolDetails{
|
||||||
var activePoolAddress []byte
|
PoolName: config.DefaultPoolName(),
|
||||||
activePoolAddress, err = userStore.ReadEntry(ctx, sessionId, storedb.DATA_ACTIVE_POOL_ADDRESS)
|
PoolSymbol: config.DefaultPoolSymbol(),
|
||||||
if err != nil {
|
PoolContractAdrress: config.DefaultPoolAddress(),
|
||||||
if db.IsNotFound(err) {
|
LimiterAddress: "",
|
||||||
defaultPoolAddress := config.DefaultPoolAddress()
|
VoucherRegistry: "",
|
||||||
// store the default as the active pool address
|
|
||||||
err = userStore.WriteEntry(ctx, sessionId, storedb.DATA_ACTIVE_POOL_ADDRESS, []byte(defaultPoolAddress))
|
|
||||||
if err != nil {
|
|
||||||
logg.ErrorCtxf(ctx, "failed to write default PoolContractAdrress", "key", storedb.DATA_ACTIVE_POOL_ADDRESS, "value", defaultPoolAddress, "error", err)
|
|
||||||
return res, err
|
|
||||||
}
|
}
|
||||||
activePoolAddress = []byte(defaultPoolAddress)
|
|
||||||
} else {
|
activePoolAddress := defaultPool.PoolContractAdrress
|
||||||
logg.ErrorCtxf(ctx, "failed to read active PoolContractAdrress", "key", storedb.DATA_ACTIVE_POOL_ADDRESS, "error", err)
|
|
||||||
|
// set the active pool contract address
|
||||||
|
err = userStore.WriteEntry(ctx, sessionId, storedb.DATA_ACTIVE_POOL_ADDRESS, []byte(activePoolAddress))
|
||||||
|
if err != nil {
|
||||||
|
logg.ErrorCtxf(ctx, "failed to write active PoolContractAdrress entry with", "key", storedb.DATA_ACTIVE_POOL_ADDRESS, "value", activePoolAddress, "error", err)
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// call the api using the ActivePoolAddress and ActiveVoucherAddress to check if it is part of the pool
|
// call the api using the ActivePoolAddress and ActiveVoucherAddress to check if it is part of the pool
|
||||||
r, err := h.accountService.CheckTokenInPool(ctx, string(activePoolAddress), string(activeAddress))
|
r, err := h.accountService.CheckTokenInPool(ctx, activePoolAddress, string(activeAddress))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
res.FlagSet = append(res.FlagSet, flag_api_error)
|
res.FlagSet = append(res.FlagSet, flag_api_error)
|
||||||
logg.ErrorCtxf(ctx, "failed on CheckTokenInPool", "error", err)
|
logg.ErrorCtxf(ctx, "failed on CheckTokenInPool", "error", err)
|
||||||
|
|||||||
@ -15,6 +15,5 @@ INCMP _ 0
|
|||||||
INCMP quit 99
|
INCMP quit 99
|
||||||
LOAD view_pool 80
|
LOAD view_pool 80
|
||||||
RELOAD view_pool
|
RELOAD view_pool
|
||||||
CATCH api_failure flag_api_call_error 1
|
|
||||||
CATCH . flag_incorrect_pool 1
|
CATCH . flag_incorrect_pool 1
|
||||||
INCMP view_pool *
|
INCMP view_pool *
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user