Documentation ¶
Index ¶
- Constants
- func WithBalanceFromCurrency(currency money.CryptoCurrency, valueRaw string, isTest bool) func(params *repository.CreateBalanceParams)
- type Clear
- type Client
- type Database
- type IntegrationTest
- func (i *IntegrationTest) AssertTableRows(t *testing.T, table string, expected int64)
- func (i *IntegrationTest) AssertTableRowsByMerchant(t *testing.T, merchantID int64, table string, expected int64)
- func (i *IntegrationTest) CreatePayment(t *testing.T, merchantID int64, fiat money.FiatCurrency, amount float64, ...) *payment.Payment
- func (i *IntegrationTest) CreateRawPayment(t *testing.T, merchantID int64, opts ...func(*repository.CreatePaymentParams)) repository.Payment
- func (i *IntegrationTest) CreateSamplePayment(t *testing.T, merchantID int64, opts ...payment.CreateOpt) *payment.Payment
- func (i *IntegrationTest) SetupCreateBSCTransaction(walletID uuid.UUID, input kmsmodel.CreateBSCTransactionRequest, rawTx string)
- func (i *IntegrationTest) SetupCreateBSCTransactionWildcard(rawTx string)
- func (i *IntegrationTest) SetupCreateEthereumTransaction(walletID uuid.UUID, input kmsmodel.CreateEthereumTransactionRequest, ...)
- func (i *IntegrationTest) SetupCreateEthereumTransactionWildcard(rawTx string)
- func (i *IntegrationTest) SetupCreateMaticTransaction(walletID uuid.UUID, input kmsmodel.CreateMaticTransactionRequest, rawTx string)
- func (i *IntegrationTest) SetupCreateMaticTransactionWildcard(rawTx string)
- func (i *IntegrationTest) SetupCreateTronTransaction(walletID uuid.UUID, input kmsmodel.CreateTronTransactionRequest, rawTx string)
- func (i *IntegrationTest) SetupCreateTronTransactionWildcard(rawTx string)
- func (i *IntegrationTest) SetupCreateWallet(blockchain, address, pubKey string)
- func (i *IntegrationTest) SetupCreateWalletWithSubscription(blockchain, address, pubKey string)
- func (i *IntegrationTest) TearDown()
- type KMS
- type Marshable
- type Must
- func (m *Must) CreateBalance(t *testing.T, entityType wallet.EntityType, entityID int64, ...) *wallet.Balance
- func (m *Must) CreateCustomer(t *testing.T, merchantID int64, email string) *payment.Customer
- func (m *Must) CreateMerchant(t *testing.T, userID int64) (*merchant.Merchant, string)
- func (m *Must) CreateMerchantToken(t *testing.T, mt *merchant.Merchant) string
- func (m *Must) CreateSampleUser(t *testing.T) (*user.User, string)
- func (m *Must) CreateTransaction(t *testing.T, merchantID int64, ...) *transaction.Transaction
- func (m *Must) CreateUser(t *testing.T, params auth.GoogleUser) (*user.User, string)
- func (m *Must) CreateUserToken(t *testing.T, u *user.User) string
- func (m *Must) CreateUserViaEmail(t *testing.T, email, pass string) (*user.User, string)
- func (m *Must) CreateWallet(t *testing.T, blockchain, address, pubKey string, walletType wallet.Type) *wallet.Wallet
- func (m *Must) CreateWalletWithBalance(t *testing.T, blockchain string, walletType wallet.Type, ...) (*wallet.Wallet, *wallet.Balance)
- func (m *Must) GetBlockchainCoin(t *testing.T, chain money.Blockchain) money.CryptoCurrency
- func (m *Must) GetCurrency(t *testing.T, ticker string) money.CryptoCurrency
- type Providers
- type Request
- func (r *Request) Body(body []byte) *Request
- func (r *Request) Do() *Response
- func (r *Request) JSON(m Marshable) *Request
- func (r *Request) Param(key, value string) *Request
- func (r *Request) Path(path string) *Request
- func (r *Request) Query(key, value string) *Request
- func (r *Request) WithCSRF() *Request
- func (r *Request) WithToken(token string) *Request
- type Response
- type Services
- type TatumMock
Constants ¶
View Source
const RandomAddress = "random"
Variables ¶
This section is empty.
Functions ¶
func WithBalanceFromCurrency ¶
func WithBalanceFromCurrency(currency money.CryptoCurrency, valueRaw string, isTest bool) func(params *repository.CreateBalanceParams)
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) Conn ¶
func (db *Database) Conn() *pg.Connection
type IntegrationTest ¶
type IntegrationTest struct { *Client Context context.Context Database *Database Repository *repository.Queries Storage *repository.Store Services *Services KMS *KMS Providers *Providers Logger *zerolog.Logger Fakes *fakes.Fakes Clear *Clear Must *Must // contains filtered or unexported fields }
func NewIntegrationTest ¶
func NewIntegrationTest(t *testing.T) *IntegrationTest
func (*IntegrationTest) AssertTableRows ¶
func (i *IntegrationTest) AssertTableRows(t *testing.T, table string, expected int64)
func (*IntegrationTest) AssertTableRowsByMerchant ¶
func (*IntegrationTest) CreatePayment ¶
func (*IntegrationTest) CreateRawPayment ¶
func (i *IntegrationTest) CreateRawPayment( t *testing.T, merchantID int64, opts ...func(*repository.CreatePaymentParams), ) repository.Payment
func (*IntegrationTest) CreateSamplePayment ¶
func (*IntegrationTest) SetupCreateBSCTransaction ¶ added in v0.3.0
func (i *IntegrationTest) SetupCreateBSCTransaction( walletID uuid.UUID, input kmsmodel.CreateBSCTransactionRequest, rawTx string, )
func (*IntegrationTest) SetupCreateBSCTransactionWildcard ¶ added in v0.3.0
func (i *IntegrationTest) SetupCreateBSCTransactionWildcard(rawTx string)
func (*IntegrationTest) SetupCreateEthereumTransaction ¶
func (i *IntegrationTest) SetupCreateEthereumTransaction( walletID uuid.UUID, input kmsmodel.CreateEthereumTransactionRequest, rawTx string, )
func (*IntegrationTest) SetupCreateEthereumTransactionWildcard ¶
func (i *IntegrationTest) SetupCreateEthereumTransactionWildcard(rawTx string)
func (*IntegrationTest) SetupCreateMaticTransaction ¶
func (i *IntegrationTest) SetupCreateMaticTransaction( walletID uuid.UUID, input kmsmodel.CreateMaticTransactionRequest, rawTx string, )
func (*IntegrationTest) SetupCreateMaticTransactionWildcard ¶
func (i *IntegrationTest) SetupCreateMaticTransactionWildcard(rawTx string)
func (*IntegrationTest) SetupCreateTronTransaction ¶
func (i *IntegrationTest) SetupCreateTronTransaction( walletID uuid.UUID, input kmsmodel.CreateTronTransactionRequest, rawTx string, )
func (*IntegrationTest) SetupCreateTronTransactionWildcard ¶
func (i *IntegrationTest) SetupCreateTronTransactionWildcard(rawTx string)
func (*IntegrationTest) SetupCreateWallet ¶
func (i *IntegrationTest) SetupCreateWallet(blockchain, address, pubKey string)
func (*IntegrationTest) SetupCreateWalletWithSubscription ¶
func (i *IntegrationTest) SetupCreateWalletWithSubscription(blockchain, address, pubKey string)
func (*IntegrationTest) TearDown ¶
func (i *IntegrationTest) TearDown()
type Must ¶
type Must struct {
// contains filtered or unexported fields
}
func (*Must) CreateBalance ¶
func (m *Must) CreateBalance( t *testing.T, entityType wallet.EntityType, entityID int64, opts ...func(params *repository.CreateBalanceParams), ) *wallet.Balance
func (*Must) CreateCustomer ¶
func (*Must) CreateMerchant ¶
CreateMerchant creates merchant with api token.
func (*Must) CreateMerchantToken ¶
func (*Must) CreateTransaction ¶
func (m *Must) CreateTransaction(t *testing.T, merchantID int64, customize ...func(params *transaction.CreateTransaction)) *transaction.Transaction
func (*Must) CreateUser ¶
CreateUser creates user with api token.
func (*Must) CreateUserViaEmail ¶
CreateUserViaEmail creates user with email auth and api token.
func (*Must) CreateWallet ¶
func (*Must) CreateWalletWithBalance ¶
func (*Must) GetBlockchainCoin ¶ added in v0.3.0
func (m *Must) GetBlockchainCoin(t *testing.T, chain money.Blockchain) money.CryptoCurrency
func (*Must) GetCurrency ¶
type Providers ¶
type Providers struct { KMS *kmsmock.ClientService Tatum *tatumprovider.Provider TatumMock *TatumMock Trongrid *trongrid.Provider TrongridMock *fakes.Trongrid }
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func (*Response) StatusCode ¶
type Services ¶
type Services struct { AuthTokenManager *auth.TokenAuthManager Merchants *merchant.Service Users *user.Service Wallet *wallet.Service Payment *payment.Service Transaction *transaction.Service Blockchain *blockchain.Service Processing *processing.Service Registry *registry.Service Locker *lock.Locker JobLogger *log.JobLogger }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.