Documentation ¶
Overview ¶
Package service is a generated GoMock package.
Index ¶
- Constants
- Variables
- func ChecksumAddress(address string) (string, bool)
- func NewAccountService(config *Config, client client.Client, pChainBackend AccountBackend, ...) server.AccountAPIServicer
- func NewBlockService(config *Config, c client.Client, pChainBackend BlockBackend) server.BlockAPIServicer
- func NewCallService(config *Config, client client.Client) server.CallAPIServicer
- func NewConstructionService(config *Config, client client.Client, pChainBackend ConstructionBackend, ...) server.ConstructionAPIServicer
- func NewMempoolService(config *Config, client client.Client) server.MempoolAPIServicer
- func NewNetworkService(config *Config, client client.Client, pChainBackend NetworkBackend) server.NetworkAPIServicer
- func WrapError(err *types.Error, message interface{}) *types.Error
- type AccountBackend
- type AccountService
- type BlockBackend
- type BlockService
- type CallService
- type Config
- type ConstructionBackend
- type ConstructionService
- func (s ConstructionService) ConstructionCombine(ctx context.Context, req *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (s ConstructionService) ConstructionDerive(ctx context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (s ConstructionService) ConstructionHash(ctx context.Context, req *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (s ConstructionService) ConstructionMetadata(ctx context.Context, req *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (s ConstructionService) ConstructionParse(ctx context.Context, req *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (s ConstructionService) ConstructionPayloads(ctx context.Context, req *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (s ConstructionService) ConstructionPreprocess(ctx context.Context, req *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (s ConstructionService) ConstructionSubmit(ctx context.Context, req *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (s ConstructionService) CreateUnwrapOperationDescription(operations []*types.Operation) ([]*parser.OperationDescription, error)
- type GetTransactionReceiptInput
- type MempoolService
- type MockAccountBackend
- func (m *MockAccountBackend) AccountBalance(arg0 context.Context, arg1 *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
- func (m *MockAccountBackend) AccountCoins(arg0 context.Context, arg1 *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
- func (m *MockAccountBackend) EXPECT() *MockAccountBackendMockRecorder
- func (m *MockAccountBackend) ShouldHandleRequest(arg0 any) bool
- type MockAccountBackendMockRecorder
- type MockConstructionBackend
- func (m *MockConstructionBackend) ConstructionCombine(arg0 context.Context, arg1 *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionDerive(arg0 context.Context, arg1 *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionHash(arg0 context.Context, arg1 *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionMetadata(arg0 context.Context, arg1 *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionParse(arg0 context.Context, arg1 *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionPayloads(arg0 context.Context, arg1 *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionPreprocess(arg0 context.Context, arg1 *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
- func (m *MockConstructionBackend) ConstructionSubmit(arg0 context.Context, arg1 *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
- func (m *MockConstructionBackend) EXPECT() *MockConstructionBackendMockRecorder
- func (m *MockConstructionBackend) ShouldHandleRequest(arg0 any) bool
- type MockConstructionBackendMockRecorder
- func (mr *MockConstructionBackendMockRecorder) ConstructionCombine(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionDerive(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionHash(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionMetadata(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionParse(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionPayloads(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionPreprocess(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ConstructionSubmit(arg0, arg1 any) *gomock.Call
- func (mr *MockConstructionBackendMockRecorder) ShouldHandleRequest(arg0 any) *gomock.Call
- type NetworkBackend
- type NetworkService
- func (s *NetworkService) NetworkList(_ context.Context, _ *types.MetadataRequest) (*types.NetworkListResponse, *types.Error)
- func (s *NetworkService) NetworkOptions(ctx context.Context, request *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error)
- func (s *NetworkService) NetworkStatus(ctx context.Context, request *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error)
Constants ¶
const ( ModeOffline = "offline" ModeOnline = "online" StandardIngestion = "standard" AnalyticsIngestion = "analytics" )
const ( MiddlewareVersion = "0.1.46" BlockchainName = "Avalanche" )
const BalanceOfMethodPrefix = "0x70a08231000000000000000000000000"
Variables ¶
var ( // Errors lists all available error types Errors = []*types.Error{ ErrNotReady, ErrNotImplemented, ErrNotSupported, ErrUnavailableOffline, ErrInternalError, ErrInvalidInput, ErrClientError, ErrBlockInvalidInput, ErrBlockNotFound, ErrCallInvalidMethod, ErrCallInvalidParams, ErrTransactionNotFound, } // General errors ErrNotReady = makeError(1, "Node is not ready", true) ErrNotImplemented = makeError(2, "Endpoint is not implemented", false) ErrNotSupported = makeError(3, "Endpoint is not supported", false) ErrInternalError = makeError(5, "Internal server error", true) ErrInvalidInput = makeError(6, "Invalid input", false) ErrClientError = makeError(7, "Client error", true) ErrBlockInvalidInput = makeError(8, "Block number or hash is required", false) ErrBlockNotFound = makeError(9, "Block was not found", true) ErrCallInvalidMethod = makeError(10, "Invalid call method", false) ErrCallInvalidParams = makeError(11, "invalid call params", false) ErrTransactionNotFound = makeError(12, "Transaction was not found", true) )
Functions ¶
func ChecksumAddress ¶ added in v0.0.7
ChecksumAddress ensures an Ethereum hex address is in Checksum Format. If the address cannot be converted, it returns !ok.
func NewAccountService ¶
func NewAccountService( config *Config, client client.Client, pChainBackend AccountBackend, cChainAtomicTxBackend AccountBackend, ) server.AccountAPIServicer
NewAccountService returns a new network servicer
func NewBlockService ¶
func NewBlockService( config *Config, c client.Client, pChainBackend BlockBackend, ) server.BlockAPIServicer
NewBlockService returns a new block servicer
func NewCallService ¶
func NewCallService(config *Config, client client.Client) server.CallAPIServicer
NewCallService returns a new call servicer
func NewConstructionService ¶
func NewConstructionService( config *Config, client client.Client, pChainBackend ConstructionBackend, cChainAtomicTxBackend ConstructionBackend, ) server.ConstructionAPIServicer
NewConstructionService returns a new construction servicer
func NewMempoolService ¶
func NewMempoolService(config *Config, client client.Client) server.MempoolAPIServicer
NewMempoolService returns a new mempool servicer
func NewNetworkService ¶
func NewNetworkService( config *Config, client client.Client, pChainBackend NetworkBackend, ) server.NetworkAPIServicer
NewNetworkService returns a new network servicer
Types ¶
type AccountBackend ¶ added in v0.1.26
type AccountBackend interface { // ShouldHandleRequest returns whether a given request should be handled by this backend ShouldHandleRequest(req interface{}) bool // AccountBalance implements /account/balance endpoint for this backend AccountBalance(ctx context.Context, req *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error) // AccountCoins implements /account/coins endpoint for this backend AccountCoins(ctx context.Context, req *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error) }
AccountBackend represents a backend that implements /account family of apis for a subset of requests. Endpoint handlers in this file delegates requests to corresponding backends based on the request. Each backend implements a ShouldHandleRequest method to determine whether that backend should handle the given request.
P-chain and C-chain atomic transaction logic are implemented in pchain.Backend and cchainatomictx.Backend respectively. Eventually, the C-chain non-atomic transaction logic implemented in this file should be extracted to its own backend as well.
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
AccountService implements the /account/* endpoints
func (AccountService) AccountBalance ¶
func (s AccountService) AccountBalance( ctx context.Context, req *types.AccountBalanceRequest, ) (*types.AccountBalanceResponse, *types.Error)
AccountBalance implements the /account/balance endpoint
func (AccountService) AccountCoins ¶
func (s AccountService) AccountCoins( ctx context.Context, req *types.AccountCoinsRequest, ) (*types.AccountCoinsResponse, *types.Error)
AccountCoins implements the /account/coins endpoint
type BlockBackend ¶ added in v0.1.26
type BlockBackend interface { // ShouldHandleRequest returns whether a given request should be handled by this backend ShouldHandleRequest(req interface{}) bool // Block implements /block endpoint for this backend Block(ctx context.Context, request *types.BlockRequest) (*types.BlockResponse, *types.Error) // BlockTransaction implements /block/transaction endpoint for this backend BlockTransaction(ctx context.Context, request *types.BlockTransactionRequest) (*types.BlockTransactionResponse, *types.Error) }
BlockBackend represents a backend that implements /block family of apis for a subset of requests Endpoint handlers in this file delegates requests to corresponding backends based on the request. Each backend implements a ShouldHandleRequest method to determine whether that backend should handle the given request.
P-chain support is implemented in pchain.Backend which implements this interface. Eventually, the C-chain block logic implemented in this file should be extracted to its own backend as well.
type BlockService ¶
type BlockService struct {
// contains filtered or unexported fields
}
BlockService implements the /block/* endpoints
func (*BlockService) Block ¶
func (s *BlockService) Block( ctx context.Context, request *types.BlockRequest, ) (*types.BlockResponse, *types.Error)
Block implements the /block endpoint
func (*BlockService) BlockTransaction ¶
func (s *BlockService) BlockTransaction( ctx context.Context, request *types.BlockTransactionRequest, ) (*types.BlockTransactionResponse, *types.Error)
BlockTransaction implements the /block/transaction endpoint.
type CallService ¶
type CallService struct {
// contains filtered or unexported fields
}
CallService implements /call/* endpoints
func (CallService) Call ¶
func (s CallService) Call( ctx context.Context, req *types.CallRequest, ) (*types.CallResponse, *types.Error)
Call implements the /call endpoint.
type Config ¶
type Config struct { Mode string ChainID *big.Int NetworkID *types.NetworkIdentifier GenesisBlockHash string AvaxAssetID string IngestionMode string TokenWhiteList []string BridgeTokenList []string IndexUnknownTokens bool // Upgrade Times AP5Activation uint64 }
Config holds the service configuration
func (Config) IsAnalyticsMode ¶ added in v0.0.26
IsAnalyticsMode returns true if running in analytics ingestion mode
func (Config) IsOfflineMode ¶
IsOfflineMode returns true if running in offline mode
func (Config) IsOnlineMode ¶
IsOnlineMode returns true if running in online mode
func (Config) IsStandardMode ¶ added in v0.0.26
IsStandardMode returns true if running in standard ingestion mode
func (Config) IsTokenListEmpty ¶ added in v0.0.26
IsTokenListEmpty returns true if the token addresses list is empty
type ConstructionBackend ¶ added in v0.1.26
type ConstructionBackend interface { // ShouldHandleRequest returns whether a given request should be handled by this backend ShouldHandleRequest(req interface{}) bool // ConstructionDerive implements /construction/derive endpoint for this backend ConstructionDerive(ctx context.Context, req *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error) // ConstructionPreprocess implements /construction/preprocess endpoint for this backend ConstructionPreprocess(ctx context.Context, req *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error) // ConstructionMetadata implements /construction/metadata endpoint for this backend ConstructionMetadata(ctx context.Context, req *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error) // ConstructionPayloads implements /construction/payloads endpoint for this backend ConstructionPayloads(ctx context.Context, req *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error) // ConstructionParse implements /construction/parse endpoint for this backend ConstructionParse(ctx context.Context, req *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error) // ConstructionCombine implements /construction/combine endpoint for this backend ConstructionCombine(ctx context.Context, req *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error) // ConstructionHash implements /construction/hash endpoint for this backend ConstructionHash(ctx context.Context, req *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error) // ConstructionSubmit implements /construction/submit endpoint for this backend ConstructionSubmit(ctx context.Context, req *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error) }
ConstructionBackend represents a backend that implements /construction family of apis for a subset of requests. Endpoint handlers in this file delegates requests to corresponding backends based on the request. Each backend implements a ShouldHandleRequest method to determine whether that backend should handle the given request.
P-chain and C-chain atomic transaction logic are implemented in pchain.Backend and cchainatomictx.Backend respectively. Eventually, the C-chain non-atomic transaction logic implemented in this file should be extracted to its own backend as well.
type ConstructionService ¶
type ConstructionService struct {
// contains filtered or unexported fields
}
ConstructionService implements /construction/* endpoints
func (ConstructionService) ConstructionCombine ¶
func (s ConstructionService) ConstructionCombine( ctx context.Context, req *types.ConstructionCombineRequest, ) (*types.ConstructionCombineResponse, *types.Error)
ConstructionCombine implements /construction/combine endpoint.
Combine creates a network-specific transaction from an unsigned transaction and an array of provided signatures. The signed transaction returned from this method will be sent to the /construction/submit endpoint by the caller.
func (ConstructionService) ConstructionDerive ¶
func (s ConstructionService) ConstructionDerive( ctx context.Context, req *types.ConstructionDeriveRequest, ) (*types.ConstructionDeriveResponse, *types.Error)
ConstructionDerive implements /construction/derive endpoint.
Derive returns the AccountIdentifier associated with a public key. Blockchains that require an on-chain action to create an account should not implement this method.
func (ConstructionService) ConstructionHash ¶
func (s ConstructionService) ConstructionHash( ctx context.Context, req *types.ConstructionHashRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionHash implements /construction/hash endpoint.
TransactionHash returns the network-specific transaction hash for a signed transaction.
func (ConstructionService) ConstructionMetadata ¶
func (s ConstructionService) ConstructionMetadata( ctx context.Context, req *types.ConstructionMetadataRequest, ) (*types.ConstructionMetadataResponse, *types.Error)
ConstructionMetadata implements /construction/metadata endpoint.
Get any information required to construct a transaction for a specific network. Metadata returned here could be a recent hash to use, an account sequence number, or even arbitrary chain state. The request used when calling this endpoint is created by calling /construction/preprocess in an offline environment.
func (ConstructionService) ConstructionParse ¶
func (s ConstructionService) ConstructionParse( ctx context.Context, req *types.ConstructionParseRequest, ) (*types.ConstructionParseResponse, *types.Error)
ConstructionParse implements /construction/parse endpoint
Parse is called on both unsigned and signed transactions to understand the intent of the formulated transaction. This is run as a sanity check before signing (after /construction/payloads) and before broadcast (after /construction/combine).
func (ConstructionService) ConstructionPayloads ¶
func (s ConstructionService) ConstructionPayloads( ctx context.Context, req *types.ConstructionPayloadsRequest, ) (*types.ConstructionPayloadsResponse, *types.Error)
ConstructionPayloads implements /construction/payloads endpoint
Payloads is called with an array of operations and the response from /construction/metadata. It returns an unsigned transaction blob and a collection of payloads that must be signed by particular AccountIdentifiers using a certain SignatureType. The array of operations provided in transaction construction often times can not specify all "effects" of a transaction (consider invoked transactions in Ethereum). However, they can deterministically specify the "intent" of the transaction, which is sufficient for construction. For this reason, parsing the corresponding transaction in the Data API (when it lands on chain) will contain a superset of whatever operations were provided during construction.
func (ConstructionService) ConstructionPreprocess ¶
func (s ConstructionService) ConstructionPreprocess( ctx context.Context, req *types.ConstructionPreprocessRequest, ) (*types.ConstructionPreprocessResponse, *types.Error)
ConstructionPreprocess implements /construction/preprocess endpoint.
Preprocess is called prior to /construction/payloads to construct a request for any metadata that is needed for transaction construction given (i.e. account nonce).
func (ConstructionService) ConstructionSubmit ¶
func (s ConstructionService) ConstructionSubmit( ctx context.Context, req *types.ConstructionSubmitRequest, ) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionSubmit implements /construction/submit endpoint.
Submit a pre-signed transaction to the node.
func (ConstructionService) CreateUnwrapOperationDescription ¶ added in v0.1.23
func (s ConstructionService) CreateUnwrapOperationDescription( operations []*types.Operation, ) ([]*parser.OperationDescription, error)
type GetTransactionReceiptInput ¶
type GetTransactionReceiptInput struct {
TxHash string `json:"tx_hash"`
}
GetTransactionReceiptInput is the input to the call method "eth_getTransactionReceipt".
type MempoolService ¶
type MempoolService struct {
// contains filtered or unexported fields
}
MempoolService implements the /mempool/* endpoints
func (MempoolService) Mempool ¶
func (s MempoolService) Mempool( ctx context.Context, _ *types.NetworkRequest, ) (*types.MempoolResponse, *types.Error)
Mempool implements the /mempool endpoint
func (MempoolService) MempoolTransaction ¶
func (MempoolService) MempoolTransaction( _ context.Context, _ *types.MempoolTransactionRequest, ) (*types.MempoolTransactionResponse, *types.Error)
MempoolTransaction implements the /mempool/transaction endpoint
type MockAccountBackend ¶ added in v0.1.42
type MockAccountBackend struct {
// contains filtered or unexported fields
}
MockAccountBackend is a mock of AccountBackend interface.
func NewMockAccountBackend ¶ added in v0.1.42
func NewMockAccountBackend(ctrl *gomock.Controller) *MockAccountBackend
NewMockAccountBackend creates a new mock instance.
func (*MockAccountBackend) AccountBalance ¶ added in v0.1.42
func (m *MockAccountBackend) AccountBalance(arg0 context.Context, arg1 *types.AccountBalanceRequest) (*types.AccountBalanceResponse, *types.Error)
AccountBalance mocks base method.
func (*MockAccountBackend) AccountCoins ¶ added in v0.1.42
func (m *MockAccountBackend) AccountCoins(arg0 context.Context, arg1 *types.AccountCoinsRequest) (*types.AccountCoinsResponse, *types.Error)
AccountCoins mocks base method.
func (*MockAccountBackend) EXPECT ¶ added in v0.1.42
func (m *MockAccountBackend) EXPECT() *MockAccountBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAccountBackend) ShouldHandleRequest ¶ added in v0.1.42
func (m *MockAccountBackend) ShouldHandleRequest(arg0 any) bool
ShouldHandleRequest mocks base method.
type MockAccountBackendMockRecorder ¶ added in v0.1.42
type MockAccountBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockAccountBackendMockRecorder is the mock recorder for MockAccountBackend.
func (*MockAccountBackendMockRecorder) AccountBalance ¶ added in v0.1.42
func (mr *MockAccountBackendMockRecorder) AccountBalance(arg0, arg1 any) *gomock.Call
AccountBalance indicates an expected call of AccountBalance.
func (*MockAccountBackendMockRecorder) AccountCoins ¶ added in v0.1.42
func (mr *MockAccountBackendMockRecorder) AccountCoins(arg0, arg1 any) *gomock.Call
AccountCoins indicates an expected call of AccountCoins.
func (*MockAccountBackendMockRecorder) ShouldHandleRequest ¶ added in v0.1.42
func (mr *MockAccountBackendMockRecorder) ShouldHandleRequest(arg0 any) *gomock.Call
ShouldHandleRequest indicates an expected call of ShouldHandleRequest.
type MockConstructionBackend ¶ added in v0.1.42
type MockConstructionBackend struct {
// contains filtered or unexported fields
}
MockConstructionBackend is a mock of ConstructionBackend interface.
func NewMockConstructionBackend ¶ added in v0.1.42
func NewMockConstructionBackend(ctrl *gomock.Controller) *MockConstructionBackend
NewMockConstructionBackend creates a new mock instance.
func (*MockConstructionBackend) ConstructionCombine ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionCombine(arg0 context.Context, arg1 *types.ConstructionCombineRequest) (*types.ConstructionCombineResponse, *types.Error)
ConstructionCombine mocks base method.
func (*MockConstructionBackend) ConstructionDerive ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionDerive(arg0 context.Context, arg1 *types.ConstructionDeriveRequest) (*types.ConstructionDeriveResponse, *types.Error)
ConstructionDerive mocks base method.
func (*MockConstructionBackend) ConstructionHash ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionHash(arg0 context.Context, arg1 *types.ConstructionHashRequest) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionHash mocks base method.
func (*MockConstructionBackend) ConstructionMetadata ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionMetadata(arg0 context.Context, arg1 *types.ConstructionMetadataRequest) (*types.ConstructionMetadataResponse, *types.Error)
ConstructionMetadata mocks base method.
func (*MockConstructionBackend) ConstructionParse ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionParse(arg0 context.Context, arg1 *types.ConstructionParseRequest) (*types.ConstructionParseResponse, *types.Error)
ConstructionParse mocks base method.
func (*MockConstructionBackend) ConstructionPayloads ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionPayloads(arg0 context.Context, arg1 *types.ConstructionPayloadsRequest) (*types.ConstructionPayloadsResponse, *types.Error)
ConstructionPayloads mocks base method.
func (*MockConstructionBackend) ConstructionPreprocess ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionPreprocess(arg0 context.Context, arg1 *types.ConstructionPreprocessRequest) (*types.ConstructionPreprocessResponse, *types.Error)
ConstructionPreprocess mocks base method.
func (*MockConstructionBackend) ConstructionSubmit ¶ added in v0.1.42
func (m *MockConstructionBackend) ConstructionSubmit(arg0 context.Context, arg1 *types.ConstructionSubmitRequest) (*types.TransactionIdentifierResponse, *types.Error)
ConstructionSubmit mocks base method.
func (*MockConstructionBackend) EXPECT ¶ added in v0.1.42
func (m *MockConstructionBackend) EXPECT() *MockConstructionBackendMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockConstructionBackend) ShouldHandleRequest ¶ added in v0.1.42
func (m *MockConstructionBackend) ShouldHandleRequest(arg0 any) bool
ShouldHandleRequest mocks base method.
type MockConstructionBackendMockRecorder ¶ added in v0.1.42
type MockConstructionBackendMockRecorder struct {
// contains filtered or unexported fields
}
MockConstructionBackendMockRecorder is the mock recorder for MockConstructionBackend.
func (*MockConstructionBackendMockRecorder) ConstructionCombine ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionCombine(arg0, arg1 any) *gomock.Call
ConstructionCombine indicates an expected call of ConstructionCombine.
func (*MockConstructionBackendMockRecorder) ConstructionDerive ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionDerive(arg0, arg1 any) *gomock.Call
ConstructionDerive indicates an expected call of ConstructionDerive.
func (*MockConstructionBackendMockRecorder) ConstructionHash ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionHash(arg0, arg1 any) *gomock.Call
ConstructionHash indicates an expected call of ConstructionHash.
func (*MockConstructionBackendMockRecorder) ConstructionMetadata ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionMetadata(arg0, arg1 any) *gomock.Call
ConstructionMetadata indicates an expected call of ConstructionMetadata.
func (*MockConstructionBackendMockRecorder) ConstructionParse ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionParse(arg0, arg1 any) *gomock.Call
ConstructionParse indicates an expected call of ConstructionParse.
func (*MockConstructionBackendMockRecorder) ConstructionPayloads ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionPayloads(arg0, arg1 any) *gomock.Call
ConstructionPayloads indicates an expected call of ConstructionPayloads.
func (*MockConstructionBackendMockRecorder) ConstructionPreprocess ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionPreprocess(arg0, arg1 any) *gomock.Call
ConstructionPreprocess indicates an expected call of ConstructionPreprocess.
func (*MockConstructionBackendMockRecorder) ConstructionSubmit ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ConstructionSubmit(arg0, arg1 any) *gomock.Call
ConstructionSubmit indicates an expected call of ConstructionSubmit.
func (*MockConstructionBackendMockRecorder) ShouldHandleRequest ¶ added in v0.1.42
func (mr *MockConstructionBackendMockRecorder) ShouldHandleRequest(arg0 any) *gomock.Call
ShouldHandleRequest indicates an expected call of ShouldHandleRequest.
type NetworkBackend ¶ added in v0.1.26
type NetworkBackend interface { // ShouldHandleRequest returns whether a given request should be handled by this backend ShouldHandleRequest(req interface{}) bool // NetworkIdentifier returns the identifier of the network it supports NetworkIdentifier() *types.NetworkIdentifier // NetworkStatus implements /network/status endpoint for this backend NetworkStatus(ctx context.Context, request *types.NetworkRequest) (*types.NetworkStatusResponse, *types.Error) // NetworkOptions implements /network/options endpoint for this backend NetworkOptions(ctx context.Context, request *types.NetworkRequest) (*types.NetworkOptionsResponse, *types.Error) }
NetworkBackend represents a backend that implements /block family of apis for a subset of requests Endpoint handlers in this file delegates requests to corresponding backends based on the request. Each backend implements a ShouldHandleRequest method to determine whether that backend should handle the given request.
P-chain support is implemented in pchain.Backend which implements this interface. Eventually, the C-chain block logic implemented in this file should be extracted to its own backend as well.
type NetworkService ¶
type NetworkService struct {
// contains filtered or unexported fields
}
NetworkService implements all /network endpoints
func (*NetworkService) NetworkList ¶
func (s *NetworkService) NetworkList( _ context.Context, _ *types.MetadataRequest, ) (*types.NetworkListResponse, *types.Error)
NetworkList implements the /network/list endpoint
func (*NetworkService) NetworkOptions ¶
func (s *NetworkService) NetworkOptions( ctx context.Context, request *types.NetworkRequest, ) (*types.NetworkOptionsResponse, *types.Error)
NetworkOptions implements the /network/options endpoint
func (*NetworkService) NetworkStatus ¶
func (s *NetworkService) NetworkStatus( ctx context.Context, request *types.NetworkRequest, ) (*types.NetworkStatusResponse, *types.Error)
NetworkStatus implements the /network/status endpoint
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
backend
|
|
pchain/indexer
Package indexer is a generated GoMock package.
|
Package indexer is a generated GoMock package. |