service

package
v1.3.2-rc-1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockAssetsService added in v1.4.0

type MockAssetsService struct {
	mock.Mock
}

func (*MockAssetsService) FetchEvmFungibleReserveAmount added in v1.4.0

func (mas *MockAssetsService) FetchEvmFungibleReserveAmount(networkId uint64, assetAddress string, isNative bool, evmTokenClient client.EvmFungibleToken, routerContractAddress string) (inLowestDenomination *big.Int, err error)

FetchEvmFungibleReserveAmount Gets EVM's Fungible Token Reserve Amount

func (*MockAssetsService) FetchEvmNonFungibleReserveAmount added in v1.4.0

func (mas *MockAssetsService) FetchEvmNonFungibleReserveAmount(networkId uint64, assetAddress string, isNative bool, evmTokenClient client.EvmNft, routerContractAddress string) (inLowestDenomination *big.Int, err error)

FetchEvmNonFungibleReserveAmount Gets EVM's Non-Fungible Token Reserve Amount

func (*MockAssetsService) FetchHederaTokenReserveAmount added in v1.4.0

func (mas *MockAssetsService) FetchHederaTokenReserveAmount(assetId string, mirrorNode client.MirrorNode, isNative bool, hederaTokenBalances map[string]int) (reserveAmount *big.Int, err error)

FetchHederaTokenReserveAmount Gets Hedera's Token Reserve Amount

func (*MockAssetsService) FungibleAssetInfo added in v1.4.0

func (mas *MockAssetsService) FungibleAssetInfo(networkId uint64, assetAddress string) (assetInfo *assetModel.FungibleAssetInfo, exist bool)

FungibleAssetInfo Gets FungibleAssetInfo

func (*MockAssetsService) FungibleNativeAsset added in v1.4.0

func (mas *MockAssetsService) FungibleNativeAsset(chainId uint64, nativeAssetAddress string) *assetModel.NativeAsset

FungibleNativeAsset Gets NativeAsset for passed chainId and assetAddress

func (*MockAssetsService) FungibleNetworkAssets added in v1.4.0

func (mas *MockAssetsService) FungibleNetworkAssets() map[uint64][]string

FungibleNetworkAssets Gets all Fungible Assets by Network ID

func (*MockAssetsService) FungibleNetworkAssetsByChainId added in v1.4.0

func (mas *MockAssetsService) FungibleNetworkAssetsByChainId(chainId uint64) []string

FungibleNetworkAssetsByChainId Gets all Fungible assets for passed Chain ID

func (*MockAssetsService) IsNative added in v1.4.0

func (mas *MockAssetsService) IsNative(chainId uint64, assetAddress string) bool

IsNative Returns flag showing if the passed Asset's Address is Native for the passed Chain ID

func (*MockAssetsService) NativeToWrapped added in v1.4.0

func (mas *MockAssetsService) NativeToWrapped(nativeAssetAddress string, nativeChainId, targetChainId uint64) string

NativeToWrapped Gets Wrapped Asset for passed Native Asset's address and Target Chain ID

func (*MockAssetsService) NativeToWrappedAssets added in v1.4.0

func (mas *MockAssetsService) NativeToWrappedAssets() map[uint64]map[string]map[uint64]string

NativeToWrappedAssets Gets all Native assets with their Wrapped assets by Network ID

func (*MockAssetsService) NonFungibleAssetInfo added in v1.4.0

func (mas *MockAssetsService) NonFungibleAssetInfo(networkId uint64, assetAddress string) (assetInfo *assetModel.NonFungibleAssetInfo, exist bool)

NonFungibleAssetInfo Gets NonFungibleAssetInfo

func (*MockAssetsService) NonFungibleNetworkAssets added in v1.4.0

func (mas *MockAssetsService) NonFungibleNetworkAssets() map[uint64][]string

NonFungibleNetworkAssets Gets all Non-Fungible Assets by Network ID

func (*MockAssetsService) OppositeAsset added in v1.4.0

func (mas *MockAssetsService) OppositeAsset(sourceChainId uint64, targetChainId uint64, assetAddress string) string

OppositeAsset Gets Opposite asset for passed chain IDs and assetAddress

func (*MockAssetsService) WrappedFromNative added in v1.4.0

func (mas *MockAssetsService) WrappedFromNative(nativeChainId uint64, nativeAssetAddress string) map[uint64]string

WrappedFromNative Gets All Wrapped Assets for passed Native Asset's address

func (*MockAssetsService) WrappedToNative added in v1.4.0

func (mas *MockAssetsService) WrappedToNative(wrappedAssetAddress string, wrappedChainId uint64) *assetModel.NativeAsset

WrappedToNative Gets Native Asset from passed Wrapped Asset's address and Wrapped Chain ID

type MockBridgeConfigService added in v1.4.0

type MockBridgeConfigService struct {
	mock.Mock
}

func (*MockBridgeConfigService) ProcessLatestConfig added in v1.4.0

func (m *MockBridgeConfigService) ProcessLatestConfig(topicID hedera.TopicID) (*parser.Bridge, error)

type MockBurnService added in v1.4.0

type MockBurnService struct {
	mock.Mock
}

func (*MockBurnService) ProcessEvent added in v1.4.0

func (m *MockBurnService) ProcessEvent(event payload.Transfer)

func (*MockBurnService) TransactionID added in v1.4.0

func (m *MockBurnService) TransactionID(id string) (string, error)

type MockDistrubutorService added in v1.4.0

type MockDistrubutorService struct {
	mock.Mock
}

func (*MockDistrubutorService) CalculateMemberDistribution added in v1.4.0

func (mds *MockDistrubutorService) CalculateMemberDistribution(validFee int64) ([]transfer.Hedera, error)

func (*MockDistrubutorService) PrepareTransfers added in v1.4.0

func (mds *MockDistrubutorService) PrepareTransfers(amount int64, token string) ([]transaction.Transfer, error)

func (*MockDistrubutorService) ValidAmount added in v1.4.0

func (mds *MockDistrubutorService) ValidAmount(amount int64) int64

type MockFeeService added in v1.4.0

type MockFeeService struct {
	mock.Mock
}

func (*MockFeeService) CalculateFee added in v1.4.0

func (mfs *MockFeeService) CalculateFee(token string, amount int64) (fee, remainder int64)

type MockLockService added in v1.4.0

type MockLockService struct {
	mock.Mock
}

func (*MockLockService) ProcessEvent added in v1.4.0

func (m *MockLockService) ProcessEvent(event payload.Transfer)

type MockMessageService added in v1.4.0

type MockMessageService struct {
	mock.Mock
}

func (*MockMessageService) ProcessSignature added in v1.4.0

func (m *MockMessageService) ProcessSignature(transferID, signature string, targetChainId uint64, timestamp int64, authMsg []byte) error

ProcessSignature processes the signature message, verifying and updating all necessary fields in the DB

func (*MockMessageService) SanityCheckFungibleSignature added in v1.4.0

func (m *MockMessageService) SanityCheckFungibleSignature(tm *proto.TopicEthSignatureMessage) (bool, error)

SanityCheckFungibleSignature performs any validation required prior handling the topic message (verifies metadata against the corresponding Transaction record)

func (*MockMessageService) SanityCheckNftSignature added in v1.4.0

func (m *MockMessageService) SanityCheckNftSignature(tm *proto.TopicEthNftSignatureMessage) (bool, error)

SanityCheckNftSignature performs any validation required prior handling the topic message (verifies metadata against the corresponding Transaction record)

func (*MockMessageService) SignFungibleMessage added in v1.4.0

func (m *MockMessageService) SignFungibleMessage(transfer payload.Transfer) ([]byte, error)

func (*MockMessageService) SignNftMessage added in v1.4.0

func (m *MockMessageService) SignNftMessage(transfer payload.Transfer) ([]byte, error)

type MockPricingService added in v1.4.0

type MockPricingService struct {
	mock.Mock
}

func (*MockPricingService) FetchAndUpdateNftFeesForApi added in v1.4.0

func (mas *MockPricingService) FetchAndUpdateNftFeesForApi() error

func (*MockPricingService) FetchAndUpdateUsdPrices added in v1.4.0

func (mas *MockPricingService) FetchAndUpdateUsdPrices() error

FetchAndUpdateUsdPrices fetches all prices from the Web APIs and updates them in the mapping

func (*MockPricingService) GetHederaNftFee added in v1.4.0

func (mas *MockPricingService) GetHederaNftFee(token string) (int64, bool)

GetHederaNftFee returns the nft fee for Hedera NFTs based on token id

func (*MockPricingService) GetHederaNftPrevFee added in v1.4.0

func (mas *MockPricingService) GetHederaNftPrevFee(token string) (int64, bool)

GetHederaNftPrevFee returns the previous nft fee for Hedera NFTs based on token id

func (*MockPricingService) GetMinAmountsForAPI added in v1.4.0

func (mas *MockPricingService) GetMinAmountsForAPI() map[uint64]map[string]string

GetMinAmountsForAPI getting all prices by networkId

func (*MockPricingService) GetTokenPriceInfo added in v1.4.0

func (mas *MockPricingService) GetTokenPriceInfo(networkId uint64, tokenAddressOrId string) (priceInfo pricing.TokenPriceInfo, exist bool)

GetTokenPriceInfo gets price for token with the passed networkId and tokenAddressOrId

func (*MockPricingService) NftFees added in v1.4.0

func (mas *MockPricingService) NftFees() map[uint64]map[string]pricing.NonFungibleFee

type MockPrometheusService added in v1.4.0

type MockPrometheusService struct {
	mock.Mock
}

func (*MockPrometheusService) ConstructMetricName added in v1.4.0

func (mps *MockPrometheusService) ConstructMetricName(sourceNetworkId, targetNetworkId uint64, asset, transactionId, metricTarget string) (string, error)

ConstructMetricName constructing name for metric

func (*MockPrometheusService) CreateCounterIfNotExists added in v1.4.0

func (mps *MockPrometheusService) CreateCounterIfNotExists(opts prometheus.CounterOpts) prometheus.Counter

CreateCounterIfNotExists creates new Counter Metric and registers it in Prometheus

func (*MockPrometheusService) CreateGaugeIfNotExists added in v1.4.0

func (mps *MockPrometheusService) CreateGaugeIfNotExists(opts prometheus.GaugeOpts) prometheus.Gauge

CreateGaugeIfNotExists creates new Gauge Metric and registers it in Prometheus if not exists

func (*MockPrometheusService) CreateSuccessRateGaugeIfNotExists added in v1.4.0

func (mps *MockPrometheusService) CreateSuccessRateGaugeIfNotExists(transactionId string, sourceChainId, targetChainId uint64, asset, metricNameSuffix, metricHelp string) (prometheus.Gauge, error)

CreateSuccessRateGaugeIfNotExists creates new Gauge Metric for Success Rate and registers it in Prometheus if not exists

func (*MockPrometheusService) DeleteCounter added in v1.4.0

func (mps *MockPrometheusService) DeleteCounter(name string)

DeleteCounter unregisters and deletes Counter with the passed name

func (*MockPrometheusService) DeleteGauge added in v1.4.0

func (mps *MockPrometheusService) DeleteGauge(name string)

DeleteGauge unregisters and deletes Gauge with the passed name

func (*MockPrometheusService) GetCounter added in v1.4.0

func (mps *MockPrometheusService) GetCounter(name string) prometheus.Counter

GetCounter retrieves Counter by name with flag for existence

func (*MockPrometheusService) GetGauge added in v1.4.0

func (mps *MockPrometheusService) GetGauge(name string) prometheus.Gauge

GetGauge retrieves Gauge by name with flag for existence

func (*MockPrometheusService) GetIsMonitoringEnabled added in v1.4.0

func (mps *MockPrometheusService) GetIsMonitoringEnabled() bool

GetIsMonitoringEnabled returns if the monitoring is enabled

type MockReadOnlyService added in v1.4.0

type MockReadOnlyService struct {
	mock.Mock
}

func (*MockReadOnlyService) FindAssetTransfer added in v1.4.0

func (m *MockReadOnlyService) FindAssetTransfer(transferID string, asset string, transfers []transfer.Hedera, fetch func() (*mirrorNodeTransaction.Response, error), save func(transactionID, scheduleID, status string) error)

func (*MockReadOnlyService) FindNftTransfer added in v1.4.0

func (m *MockReadOnlyService) FindNftTransfer(transferID string, tokenID string, serialNum int64, sender string, receiver string, save func(transactionID string, scheduleID string, status string) error)

func (*MockReadOnlyService) FindScheduledNftAllowanceApprove added in v1.4.0

func (m *MockReadOnlyService) FindScheduledNftAllowanceApprove(t *payload.Transfer, sender hedera.AccountID, save func(transactionID string, scheduleID string, status string) error)

func (*MockReadOnlyService) FindTransfer added in v1.4.0

func (m *MockReadOnlyService) FindTransfer(transferID string, fetch func() (*mirrorNodeTransaction.Response, error), save func(transactionID, scheduleID, status string) error)

type MockScheduledService added in v1.4.0

type MockScheduledService struct {
	mock.Mock
}

func (*MockScheduledService) ExecuteScheduledBurnTransaction added in v1.4.0

func (mss *MockScheduledService) ExecuteScheduledBurnTransaction(id, asset string, amount int64, status *chan string, onExecutionSuccess func(transactionID string, scheduleID string), onExecutionFail, onSuccess, onFail func(transactionID string))

func (*MockScheduledService) ExecuteScheduledMintTransaction added in v1.4.0

func (mss *MockScheduledService) ExecuteScheduledMintTransaction(id, asset string, amount int64, status *chan string, onExecutionSuccess func(transactionID string, scheduleID string), onExecutionFail, onSuccess, onFail func(transactionID string))

func (*MockScheduledService) ExecuteScheduledNftAllowTransaction added in v1.4.0

func (mss *MockScheduledService) ExecuteScheduledNftAllowTransaction(id string, nftID hedera.NftID, owner hedera.AccountID, spender hedera.AccountID, onExecutionSuccess func(txId string, scheduleId string), onExecutionFail, onSuccess, onFail func(txId string))

func (*MockScheduledService) ExecuteScheduledNftTransferTransaction added in v1.4.0

func (mss *MockScheduledService) ExecuteScheduledNftTransferTransaction(id string, nftID hedera.NftID, sender hedera.AccountID, receiving hedera.AccountID, approved bool, onExecutionSuccess func(transactionID string, scheduleID string), onExecutionFail, onSuccess, onFail func(transactionID string))

func (*MockScheduledService) ExecuteScheduledTransferTransaction added in v1.4.0

func (mss *MockScheduledService) ExecuteScheduledTransferTransaction(id, nativeAsset string, transfers []transfer.Hedera, onExecutionSuccess func(transactionID, scheduleID string), onExecutionFail, onSuccess, onFail func(transactionID string))

type MockSignerService added in v1.4.0

type MockSignerService struct {
	mock.Mock
}

func (*MockSignerService) Address added in v1.4.0

func (m *MockSignerService) Address() string

func (*MockSignerService) NewKeyTransactor added in v1.4.0

func (m *MockSignerService) NewKeyTransactor(chainId *big.Int) (*bind.TransactOpts, error)

func (*MockSignerService) Sign added in v1.4.0

func (m *MockSignerService) Sign(msg []byte) ([]byte, error)

type MockTransferService

type MockTransferService struct {
	mock.Mock
}

func (*MockTransferService) Create added in v1.4.0

func (*MockTransferService) GetByTransactionId added in v1.4.0

func (mts *MockTransferService) GetByTransactionId(txId string) (*entity.Transfer, error)

func (*MockTransferService) GetWithFee added in v1.4.0

func (mts *MockTransferService) GetWithFee(txId string) (*entity.Transfer, error)

func (*MockTransferService) GetWithPreloads added in v1.4.0

func (mts *MockTransferService) GetWithPreloads(txId string) (*entity.Transfer, error)

func (*MockTransferService) InitiateNewTransfer

func (mts *MockTransferService) InitiateNewTransfer(tm payload.Transfer) (*entity.Transfer, error)

func (*MockTransferService) Paged added in v1.4.0

func (mts *MockTransferService) Paged(filter *transfer.PagedRequest) (*transfer.Paged, error)

func (*MockTransferService) ProcessNativeNftTransfer added in v1.4.0

func (mts *MockTransferService) ProcessNativeNftTransfer(tm payload.Transfer) error

func (*MockTransferService) ProcessNativeTransfer added in v1.4.0

func (mts *MockTransferService) ProcessNativeTransfer(tm payload.Transfer) error

func (*MockTransferService) ProcessWrappedTransfer added in v1.4.0

func (mts *MockTransferService) ProcessWrappedTransfer(tm payload.Transfer) error

func (*MockTransferService) SanityCheckTransfer

func (*MockTransferService) TransferData

func (mts *MockTransferService) TransferData(txId string) (interface{}, error)

func (*MockTransferService) UpdateStatusCompleted added in v1.4.0

func (mts *MockTransferService) UpdateStatusCompleted(txId string) error

func (*MockTransferService) UpdateStatusFailed added in v1.4.0

func (mts *MockTransferService) UpdateStatusFailed(txId string) error

type MockUtilsService added in v1.4.0

type MockUtilsService struct {
	mock.Mock
}

func (*MockUtilsService) ConvertEvmHashToBridgeTxId added in v1.4.0

func (m *MockUtilsService) ConvertEvmHashToBridgeTxId(txId string, chainId uint64) (*service.BridgeTxId, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL