Documentation ¶
Index ¶
- Constants
- func CreateBlake2Hash(data []byte) ([32]byte, string)
- func EnforceNoError(err error)
- func EnforceType(value, valueType interface{}, msg string)
- func EnforceValid(valid bool, err error)
- func MakeExpression(programName string, args ...interface{}) string
- func MarshalBody(value interface{}) (b *bytes.Buffer, err error)
- func SPV(spvCmd SPVCommand, apiHost string) (res interface{}, err error)
- type Command
- type CommandField
- type Cont
- type Error
- type Exec
- type KeyPair
- type ListenResponse
- type LocalResponse
- type Meta
- type PactEvents
- type Payload
- type PayloadType
- type PollResponse
- type PrepareCommand
- type PrepareCont
- type PrepareExec
- type Request
- type RequestKeys
- type Result
- type SPVCommand
- type Scheme
- type SendCommand
- type SendResponse
- type Sig
- type Signer
Constants ¶
View Source
const ( TEST_PACT_URL = "https://api.testnet.chainweb.com/chainweb/0.0/testnet04/chain/0/pact" TEST_URL = "https://api.testnet.chainweb.com" LOCAL_PACT_URL = "http://localhost:9001" )
Variables ¶
This section is empty.
Functions ¶
func CreateBlake2Hash ¶
func EnforceNoError ¶
func EnforceNoError(err error)
func EnforceType ¶
func EnforceType(value, valueType interface{}, msg string)
func EnforceValid ¶
func MakeExpression ¶
func MarshalBody ¶
func SPV ¶
func SPV(spvCmd SPVCommand, apiHost string) (res interface{}, err error)
Types ¶
type Command ¶
func PrepareContCmd ¶
func PrepareContCmd(cmd PrepareCont) Command
func PrepareExecCommand ¶
func PrepareExecCommand(cmd PrepareExec) Command
PrepareExecCommand creates a command that can be sent to the /exec pact server route
type CommandField ¶
type Cont ¶
type Cont struct { PactId string `json:"pactId"` Rollback bool `json:"rollback"` Step uint64 `json:"step"` Data interface{} `json:"data"` Proof string `json:"proof"` }
func (Cont) PayloadType ¶
func (Cont) PayloadType()
type Exec ¶
type Exec struct { Code string `json:"code"` Data *interface{} `json:"data"` }
func (Exec) PayloadType ¶
func (Exec) PayloadType()
type KeyPair ¶
type KeyPair struct { Private ed25519.PrivateKey Public ed25519.PublicKey }
func GenKeyPair ¶
type ListenResponse ¶
type LocalResponse ¶
type LocalResponse struct { Gas uint64 `json:"gas,omitempty"` Result Result `json:"result,omitempty"` ReqKey string `json:"reqKey,omitempty"` Logs string `json:"logs,omitempty"` MetaData interface{} `json:"metaData,omitempty"` Continuation interface{} `json:"continuation,omitempty"` TxId string `json:"txId,omitempty"` }
func Local ¶
func Local(localCmd PrepareExec, apiHost string) (res *LocalResponse, err error)
type Meta ¶
type PactEvents ¶
type PayloadType ¶
type PayloadType interface {
PayloadType()
}
type PollResponse ¶
type PollResponse struct { Gas int64 `json:"gas,omitempty"` ReqKey string `json:"reqKey,omitempty"` TxId string `json:"txId,omitempty"` Logs string `json:"logs,omitempty"` MetaData interface{} `json:"metaData,omitempty"` Continuation interface{} `json:"continuation,omitempty"` Events PactEvents `json:"events,omitempty"` }
type PrepareCommand ¶
type PrepareCommand interface {
// contains filtered or unexported methods
}
type PrepareCont ¶
type PrepareExec ¶
type RequestKeys ¶
type RequestKeys struct {
RequestKeys []string `json:"requestKeys,omitempty"`
}
type Result ¶
type Result struct { Status string `json:"status,omitempty"` Data interface{} `json:"data,omitempty"` }
type SPVCommand ¶
type SendCommand ¶
type SendCommand struct {
Cmds []Command `json:"cmds,omitempty"`
}
type SendResponse ¶
type SendResponse struct {
RequestKeys []string `json:"requestKeys,omitempty"`
}
SendResponse is the response for a /send api call
func Send ¶
func Send(sendCmd []PrepareCommand, apiHost string) (res *SendResponse, err error)
Send sends a Pact command to a running Pact server and retrieves the transaction result
Click to show internal directories.
Click to hide internal directories.