Documentation ¶
Index ¶
- Constants
- func BlockGenerator(zc ZcashClient) chan ZcashBlockResult
- type ZCashMockClient
- func (zc *ZCashMockClient) CallZcash(method string, zresult nativejson.RawMessage) ZCashResponse
- func (zc *ZCashMockClient) CallZcashJson(method string, params []interface{}) ZCashResponse
- func (zc *ZCashMockClient) GetBlockCount() (int, error)
- func (zc *ZCashMockClient) GetZBlock(height int) ZcashBlockResult
- func (zc *ZCashMockClient) SendMany(from string, to string, amount float32) ZCashResponse
- func (zc *ZCashMockClient) SetHost(host string)
- func (zc *ZCashMockClient) SetPort(port int)
- func (zc *ZCashMockClient) SubmitBlock(zblk nativejson.RawMessage) error
- func (zc *ZCashMockClient) SuggestBlock() ZcashBlockResult
- func (zc *ZCashMockClient) ValidateBlock(zblk nativejson.RawMessage) error
- type ZCashRequest
- type ZCashRequestJson
- type ZCashResponse
- type ZcashBlockResult
- type ZcashClient
- type ZcashError
- type ZcashHTTPClient
- func (zc *ZcashHTTPClient) CallZcash(method string, zresult nativejson.RawMessage) ZCashResponse
- func (zc *ZcashHTTPClient) CallZcashJson(method string, params []interface{}) ZCashResponse
- func (zc *ZcashHTTPClient) GetBlockCount() (int, error)
- func (zc *ZcashHTTPClient) GetCompleteHost() string
- func (zc *ZcashHTTPClient) GetHost() string
- func (zc *ZcashHTTPClient) GetPassword() string
- func (zc *ZcashHTTPClient) GetPort() int
- func (zc *ZcashHTTPClient) GetUser() string
- func (zc *ZcashHTTPClient) GetZBlock(height int) ZcashBlockResult
- func (zc *ZcashHTTPClient) SendMany(from string, to string, amount float32) ZCashResponse
- func (zc *ZcashHTTPClient) SetHost(host string)
- func (zc *ZcashHTTPClient) SetPort(port int)
- func (zc *ZcashHTTPClient) SubmitBlock(zblk nativejson.RawMessage) error
- func (zc *ZcashHTTPClient) SuggestBlock() ZcashBlockResult
- func (zc *ZcashHTTPClient) ValidateBlock(zblk nativejson.RawMessage) error
Constants ¶
View Source
const ( ZcashHost = "127.0.0.1" ZcashPort = 8232 ZcashUser = "test" ZcashPw = "pw" )
View Source
const (
DefaultInitialBlocks = 15
)
View Source
const ZcashClientErrorCode = 100
Variables ¶
This section is empty.
Functions ¶
func BlockGenerator ¶
func BlockGenerator(zc ZcashClient) chan ZcashBlockResult
Types ¶
type ZCashMockClient ¶
type ZCashMockClient struct {
InitialBlocks int
}
func NewDefaultMock ¶
func NewDefaultMock() *ZCashMockClient
func (*ZCashMockClient) CallZcash ¶
func (zc *ZCashMockClient) CallZcash(method string, zresult nativejson.RawMessage) ZCashResponse
func (*ZCashMockClient) CallZcashJson ¶
func (zc *ZCashMockClient) CallZcashJson(method string, params []interface{}) ZCashResponse
func (*ZCashMockClient) GetBlockCount ¶
func (zc *ZCashMockClient) GetBlockCount() (int, error)
func (*ZCashMockClient) GetZBlock ¶
func (zc *ZCashMockClient) GetZBlock(height int) ZcashBlockResult
func (*ZCashMockClient) SendMany ¶
func (zc *ZCashMockClient) SendMany(from string, to string, amount float32) ZCashResponse
func (*ZCashMockClient) SetHost ¶
func (zc *ZCashMockClient) SetHost(host string)
func (*ZCashMockClient) SetPort ¶
func (zc *ZCashMockClient) SetPort(port int)
func (*ZCashMockClient) SubmitBlock ¶
func (zc *ZCashMockClient) SubmitBlock(zblk nativejson.RawMessage) error
func (*ZCashMockClient) SuggestBlock ¶
func (zc *ZCashMockClient) SuggestBlock() ZcashBlockResult
func (*ZCashMockClient) ValidateBlock ¶
func (zc *ZCashMockClient) ValidateBlock(zblk nativejson.RawMessage) error
type ZCashRequest ¶
type ZCashRequestJson ¶
type ZCashRequestJson struct { Params nativejson.RawMessage `json:"params"` Method string `json:"method"` ID string `json:"id"` }
type ZCashResponse ¶
type ZCashResponse struct { Result nativejson.RawMessage `json:"result"` Error *ZcashError `json:"error"` ID string `json:"id"` }
type ZcashBlockResult ¶
type ZcashBlockResult struct { Block nativejson.RawMessage `json:"block"` Timestamp int64 `json:"timestamp"` Error error }
type ZcashClient ¶
type ZcashClient interface { SetHost(host string) SetPort(port int) SendMany(from string, to string, amount float32) ZCashResponse GetBlockCount() (int, error) GetZBlock(height int) ZcashBlockResult ValidateBlock(zblk nativejson.RawMessage) error SubmitBlock(zblk nativejson.RawMessage) error SuggestBlock() ZcashBlockResult CallZcash(method string, zresult nativejson.RawMessage) ZCashResponse CallZcashJson(method string, params []interface{}) ZCashResponse }
type ZcashError ¶
func (*ZcashError) Error ¶
func (zc *ZcashError) Error() error
type ZcashHTTPClient ¶
func (*ZcashHTTPClient) CallZcash ¶
func (zc *ZcashHTTPClient) CallZcash(method string, zresult nativejson.RawMessage) ZCashResponse
func (*ZcashHTTPClient) CallZcashJson ¶
func (zc *ZcashHTTPClient) CallZcashJson(method string, params []interface{}) ZCashResponse
func (*ZcashHTTPClient) GetBlockCount ¶
func (zc *ZcashHTTPClient) GetBlockCount() (int, error)
func (*ZcashHTTPClient) GetCompleteHost ¶
func (zc *ZcashHTTPClient) GetCompleteHost() string
func (*ZcashHTTPClient) GetHost ¶
func (zc *ZcashHTTPClient) GetHost() string
func (*ZcashHTTPClient) GetPassword ¶
func (zc *ZcashHTTPClient) GetPassword() string
func (*ZcashHTTPClient) GetPort ¶
func (zc *ZcashHTTPClient) GetPort() int
func (*ZcashHTTPClient) GetUser ¶
func (zc *ZcashHTTPClient) GetUser() string
func (*ZcashHTTPClient) GetZBlock ¶
func (zc *ZcashHTTPClient) GetZBlock(height int) ZcashBlockResult
func (*ZcashHTTPClient) SendMany ¶
func (zc *ZcashHTTPClient) SendMany(from string, to string, amount float32) ZCashResponse
func (*ZcashHTTPClient) SetHost ¶
func (zc *ZcashHTTPClient) SetHost(host string)
func (*ZcashHTTPClient) SetPort ¶
func (zc *ZcashHTTPClient) SetPort(port int)
func (*ZcashHTTPClient) SubmitBlock ¶
func (zc *ZcashHTTPClient) SubmitBlock(zblk nativejson.RawMessage) error
func (*ZcashHTTPClient) SuggestBlock ¶
func (zc *ZcashHTTPClient) SuggestBlock() ZcashBlockResult
func (*ZcashHTTPClient) ValidateBlock ¶
func (zc *ZcashHTTPClient) ValidateBlock(zblk nativejson.RawMessage) error
Click to show internal directories.
Click to hide internal directories.