added the GetCreditSendMaxLimit to tests
This commit is contained in:
		
							parent
							
								
									c11060648d
								
							
						
					
					
						commit
						3e82e16923
					
				
							
								
								
									
										23
									
								
								dev/api.go
									
									
									
									
									
								
							
							
						
						
									
										23
									
								
								dev/api.go
									
									
									
									
									
								
							| @ -587,10 +587,10 @@ func (das *DevAccountService) FetchVouchers(ctx context.Context, publicKey strin | |||||||
| 	//TODO: Iterate over the account acc.Balances object
 | 	//TODO: Iterate over the account acc.Balances object
 | ||||||
| 	for _, voucher := range das.vouchers { | 	for _, voucher := range das.vouchers { | ||||||
| 		holdings = append(holdings, dataserviceapi.TokenHoldings{ | 		holdings = append(holdings, dataserviceapi.TokenHoldings{ | ||||||
| 			TokenAddress: voucher.Address, | 			TokenAddress:  voucher.Address, | ||||||
| 			TokenSymbol:     voucher.Symbol, | 			TokenSymbol:   voucher.Symbol, | ||||||
| 			TokenDecimals:   strconv.Itoa(voucher.Decimals), | 			TokenDecimals: strconv.Itoa(voucher.Decimals), | ||||||
| 			Balance:         strconv.Itoa(int(defaultVoucherBalance)), | 			Balance:       strconv.Itoa(int(defaultVoucherBalance)), | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -861,10 +861,10 @@ func (das *DevAccountService) GetPoolSwappableFromVouchers(ctx context.Context, | |||||||
| 	} | 	} | ||||||
| 	for _, v := range p.Vouchers { | 	for _, v := range p.Vouchers { | ||||||
| 		swapFromList = append(swapFromList, dataserviceapi.TokenHoldings{ | 		swapFromList = append(swapFromList, dataserviceapi.TokenHoldings{ | ||||||
| 			TokenAddress: v.Address, | 			TokenAddress:  v.Address, | ||||||
| 			TokenSymbol:     v.Symbol, | 			TokenSymbol:   v.Symbol, | ||||||
| 			TokenDecimals:   string(defaultDecimals), | 			TokenDecimals: string(defaultDecimals), | ||||||
| 			Balance:         fmt.Sprintf("%f", defaultVoucherBalance), | 			Balance:       fmt.Sprintf("%f", defaultVoucherBalance), | ||||||
| 		}) | 		}) | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| @ -907,3 +907,10 @@ func (das *DevAccountService) CheckTokenInPool(ctx context.Context, poolAddress, | |||||||
| 		CanSwapFrom: true, | 		CanSwapFrom: true, | ||||||
| 	}, nil | 	}, nil | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func (das *DevAccountService) GetCreditSendMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.CreditSendLimitsResult, error) { | ||||||
|  | 	return &models.CreditSendLimitsResult{ | ||||||
|  | 		MaxRAT: "45599996", | ||||||
|  | 		MaxSAT: "3507692", | ||||||
|  | 	}, nil | ||||||
|  | } | ||||||
|  | |||||||
| @ -120,3 +120,8 @@ func (m MockAccountService) CheckTokenInPool(ctx context.Context, poolAddress, t | |||||||
| 	args := m.Called(poolAddress, tokenAddress) | 	args := m.Called(poolAddress, tokenAddress) | ||||||
| 	return args.Get(0).(*models.TokenInPoolResult), args.Error(1) | 	return args.Get(0).(*models.TokenInPoolResult), args.Error(1) | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func (m MockAccountService) GetCreditSendMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.CreditSendLimitsResult, error) { | ||||||
|  | 	args := m.Called(poolAddress, fromTokenAddress, toTokenAddress, publicKey) | ||||||
|  | 	return args.Get(0).(*models.CreditSendLimitsResult), args.Error(1) | ||||||
|  | } | ||||||
|  | |||||||
| @ -116,3 +116,8 @@ func (m TestAccountService) GetSwapFromTokenMaxLimit(ctx context.Context, poolAd | |||||||
| func (m TestAccountService) CheckTokenInPool(ctx context.Context, poolAddress, tokenAddress string) (*models.TokenInPoolResult, error) { | func (m TestAccountService) CheckTokenInPool(ctx context.Context, poolAddress, tokenAddress string) (*models.TokenInPoolResult, error) { | ||||||
| 	return &models.TokenInPoolResult{}, nil | 	return &models.TokenInPoolResult{}, nil | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | func (m TestAccountService) GetCreditSendMaxLimit(ctx context.Context, poolAddress, fromTokenAddress, toTokenAddress, publicKey string) (*models.CreditSendLimitsResult, error) { | ||||||
|  | 	return &models.CreditSendLimitsResult{}, nil | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user