client

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountTxsResponse

type AccountTxsResponse struct {
	PageCount uint32        `json:"page_count"`
	TotalTxs  uint32        `json:"total_txs"`
	Txs       []*TxResponse `json:"txs"`
}

type Block

type Block struct {
	Header Header `json:"header"`
}

type BlockResponse

type BlockResponse struct {
	Block Block `json:"block"`
}
type Header struct {
	ChainID string `json:"chain_id"`
	Height  string `json:"height"`
}

type HeightResponse

type HeightResponse struct {
	Height int64 `json:"height"`
}

type MockPocketClient added in v0.1.9

type MockPocketClient struct {
	mock.Mock
}

MockPocketClient is an autogenerated mock type for the PocketClient type

func NewMockPocketClient added in v0.1.9

func NewMockPocketClient(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockPocketClient

NewMockPocketClient creates a new instance of MockPocketClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockPocketClient) EXPECT added in v0.1.9

func (*MockPocketClient) GetAccountTxsByHeight added in v0.1.9

func (_m *MockPocketClient) GetAccountTxsByHeight(address string, height int64) ([]*TxResponse, error)

GetAccountTxsByHeight provides a mock function with given fields: address, height

func (*MockPocketClient) GetBlock added in v0.1.9

func (_m *MockPocketClient) GetBlock() (*BlockResponse, error)

GetBlock provides a mock function with given fields:

func (*MockPocketClient) GetHeight added in v0.1.9

func (_m *MockPocketClient) GetHeight() (*HeightResponse, error)

GetHeight provides a mock function with given fields:

func (*MockPocketClient) GetTx added in v0.1.9

func (_m *MockPocketClient) GetTx(hash string) (*TxResponse, error)

GetTx provides a mock function with given fields: hash

func (*MockPocketClient) SubmitRawTx added in v0.1.9

func (_m *MockPocketClient) SubmitRawTx(params rpc.SendRawTxParams) (*SubmitRawTxResponse, error)

SubmitRawTx provides a mock function with given fields: params

func (*MockPocketClient) ValidateNetwork added in v0.1.9

func (_m *MockPocketClient) ValidateNetwork()

ValidateNetwork provides a mock function with given fields:

type MockPocketClient_Expecter added in v0.1.9

type MockPocketClient_Expecter struct {
	// contains filtered or unexported fields
}

func (*MockPocketClient_Expecter) GetAccountTxsByHeight added in v0.1.9

func (_e *MockPocketClient_Expecter) GetAccountTxsByHeight(address interface{}, height interface{}) *MockPocketClient_GetAccountTxsByHeight_Call

GetAccountTxsByHeight is a helper method to define mock.On call

  • address string
  • height int64

func (*MockPocketClient_Expecter) GetBlock added in v0.1.9

GetBlock is a helper method to define mock.On call

func (*MockPocketClient_Expecter) GetHeight added in v0.1.9

GetHeight is a helper method to define mock.On call

func (*MockPocketClient_Expecter) GetTx added in v0.1.9

func (_e *MockPocketClient_Expecter) GetTx(hash interface{}) *MockPocketClient_GetTx_Call

GetTx is a helper method to define mock.On call

  • hash string

func (*MockPocketClient_Expecter) SubmitRawTx added in v0.1.9

func (_e *MockPocketClient_Expecter) SubmitRawTx(params interface{}) *MockPocketClient_SubmitRawTx_Call

SubmitRawTx is a helper method to define mock.On call

  • params rpc.SendRawTxParams

func (*MockPocketClient_Expecter) ValidateNetwork added in v0.1.9

ValidateNetwork is a helper method to define mock.On call

type MockPocketClient_GetAccountTxsByHeight_Call added in v0.1.9

type MockPocketClient_GetAccountTxsByHeight_Call struct {
	*mock.Call
}

MockPocketClient_GetAccountTxsByHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAccountTxsByHeight'

func (*MockPocketClient_GetAccountTxsByHeight_Call) Return added in v0.1.9

func (*MockPocketClient_GetAccountTxsByHeight_Call) Run added in v0.1.9

func (*MockPocketClient_GetAccountTxsByHeight_Call) RunAndReturn added in v0.1.9

type MockPocketClient_GetBlock_Call added in v0.1.9

type MockPocketClient_GetBlock_Call struct {
	*mock.Call
}

MockPocketClient_GetBlock_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBlock'

func (*MockPocketClient_GetBlock_Call) Return added in v0.1.9

func (*MockPocketClient_GetBlock_Call) Run added in v0.1.9

func (*MockPocketClient_GetBlock_Call) RunAndReturn added in v0.1.9

type MockPocketClient_GetHeight_Call added in v0.1.9

type MockPocketClient_GetHeight_Call struct {
	*mock.Call
}

MockPocketClient_GetHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetHeight'

func (*MockPocketClient_GetHeight_Call) Return added in v0.1.9

func (*MockPocketClient_GetHeight_Call) Run added in v0.1.9

func (*MockPocketClient_GetHeight_Call) RunAndReturn added in v0.1.9

type MockPocketClient_GetTx_Call added in v0.1.9

type MockPocketClient_GetTx_Call struct {
	*mock.Call
}

MockPocketClient_GetTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetTx'

func (*MockPocketClient_GetTx_Call) Return added in v0.1.9

func (*MockPocketClient_GetTx_Call) Run added in v0.1.9

func (*MockPocketClient_GetTx_Call) RunAndReturn added in v0.1.9

type MockPocketClient_SubmitRawTx_Call added in v0.1.9

type MockPocketClient_SubmitRawTx_Call struct {
	*mock.Call
}

MockPocketClient_SubmitRawTx_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SubmitRawTx'

func (*MockPocketClient_SubmitRawTx_Call) Return added in v0.1.9

func (*MockPocketClient_SubmitRawTx_Call) Run added in v0.1.9

func (*MockPocketClient_SubmitRawTx_Call) RunAndReturn added in v0.1.9

type MockPocketClient_ValidateNetwork_Call added in v0.1.9

type MockPocketClient_ValidateNetwork_Call struct {
	*mock.Call
}

MockPocketClient_ValidateNetwork_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ValidateNetwork'

func (*MockPocketClient_ValidateNetwork_Call) Return added in v0.1.9

func (*MockPocketClient_ValidateNetwork_Call) Run added in v0.1.9

func (*MockPocketClient_ValidateNetwork_Call) RunAndReturn added in v0.1.9

type Msg

type Msg struct {
	Value Value  `json:"value"`
	Type  string `json:"type"`
}

type PocketClient

type PocketClient interface {
	GetBlock() (*BlockResponse, error)
	GetHeight() (*HeightResponse, error)
	SubmitRawTx(params rpc.SendRawTxParams) (*SubmitRawTxResponse, error)
	GetTx(hash string) (*TxResponse, error)
	GetAccountTxsByHeight(address string, height int64) ([]*TxResponse, error)
	ValidateNetwork()
}
var (
	Client PocketClient = &pocketClient{}
)

func NewClient

func NewClient() PocketClient

type StdTx

type StdTx struct {
	Memo string `json:"memo"`
	Msg  Msg    `json:"msg"`
}

type SubmitRawTxResponse

type SubmitRawTxResponse struct {
	TransactionHash string `json:"txhash"`
}

type TxResponse

type TxResponse struct {
	Hash     string   `json:"hash"`
	Height   int64    `json:"height"`
	Index    int64    `json:"index"`
	StdTx    StdTx    `json:"stdTx"`
	Tx       string   `json:"tx"`
	TxResult TxResult `json:"tx_result"`
}

type TxResult added in v0.1.2

type TxResult struct {
	Code        int64  `json:"code"`
	Codespace   string `json:"codespace"`
	Data        string `json:"data"`
	Events      string `json:"events"`
	Info        string `json:"info"`
	Log         string `json:"log"`
	MessageType string `json:"message_type"`
	Recipient   string `json:"recipient"`
	Signer      string `json:"signer"`
}

type Value

type Value struct {
	FromAddress string `json:"from_address"`
	ToAddress   string `json:"to_address"`
	Amount      string `json:"amount"`
}

Jump to

Keyboard shortcuts

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