Documentation
¶
Index ¶
- func FromHex(s string) []byte
- func FromTimeStamp(ts string) time.Time
- func HumanToBlockchain(amount string, decimals int) xc.AmountBlockchain
- func JsonPrint(a any)
- func Ref[T any](s T) *T
- func Reserialize[T any](val *T) *T
- func TxInfoEqual(t *testing.T, expected, actual txinfo.TxInfo)
- type MockHTTPServer
- type MockJSONRPCServer
- type MockXcTx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromTimeStamp ¶
func HumanToBlockchain ¶
func HumanToBlockchain(amount string, decimals int) xc.AmountBlockchain
func Reserialize ¶
func Reserialize[T any](val *T) *T
reserialize will drop internal fields set by constructors
func TxInfoEqual ¶
Produces more readable diffs when comparing TxInfo in unit tests
Types ¶
type MockHTTPServer ¶
type MockHTTPServer struct {
*httptest.Server
Counter int
Response interface{}
StatusCodes []int
// contains filtered or unexported fields
}
MockHTTPServer is a mocked HTTP server
type MockJSONRPCServer ¶
type MockJSONRPCServer struct {
*httptest.Server
Counter int
ForceError int
Response interface{}
// contains filtered or unexported fields
}
MockJSONRPCServer is a mocked RPC server
func MockJSONRPC ¶
func MockJSONRPC(t *testing.T, response interface{}) (mock *MockJSONRPCServer, close func())
MockJSONRPC creates a new MockJSONRPCServer given a response, or array of responses
type MockXcTx ¶
type MockXcTx struct {
SerializedSignedTx []byte
Signatures []xc.TxSignature
}
An object that only supports .Serialize for SubmitTx()
func (*MockXcTx) SetSignatures ¶
func (tx *MockXcTx) SetSignatures(...*xc.SignatureResponse) error
Click to show internal directories.
Click to hide internal directories.