added CheckTokenInPool to check whether a token can be swapped from in a pool
This commit is contained in:
@@ -870,7 +870,6 @@ func (das *DevAccountService) GetPoolSwappableVouchers(ctx context.Context, pool
|
||||
}
|
||||
|
||||
func (das *DevAccountService) GetSwapFromTokenMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.MaxLimitResult, error) {
|
||||
|
||||
p, ok := das.pools[poolAddress]
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Pool address: %v not found ", poolAddress)
|
||||
@@ -884,3 +883,9 @@ func (das *DevAccountService) GetSwapFromTokenMaxLimit(ctx context.Context, pool
|
||||
Max: limit,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (das *DevAccountService) CheckTokenInPool(ctx context.Context, poolAddress, tokenAddress string) (*models.TokenInPoolResult, error) {
|
||||
return &models.TokenInPoolResult{
|
||||
CanSwapFrom: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user