utils

package
v1.4.1-pre2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BaseURL = "http://127.0.0.1:26640"
)

Variables

This section is empty.

Functions

func BuildURL

func BuildURL(uri string) string

func GenTx added in v0.6.0

func GenTx(txf clienttx.Factory, _ client.TxConfig, msgs []sdk.Msg, signer string) (sdk.Tx, error)

GenTx generates a signed mock transaction.

func ParseUint

func ParseUint(num string) uint64

func RandString

func RandString() string

func ReadResponseBody

func ReadResponseBody(resp *http.Response) ([]byte, error)

func SendDeleteRequest

func SendDeleteRequest(uri string, body []byte, account string, passphrase string) ([]byte, error)

func SendGetRequest

func SendGetRequest(uri string) ([]byte, error)

func SendPatchRequest

func SendPatchRequest(uri string, body []byte, account string, passphrase string) ([]byte, error)

func SendPostRequest

func SendPostRequest(uri string, body []byte, account string, passphrase string) ([]byte, error)

func SendPutRequest

func SendPutRequest(uri string, body []byte, account string, passphrase string) ([]byte, error)

Types

type RESTError added in v0.6.0

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

func (*RESTError) Error added in v0.6.0

func (e *RESTError) Error() string

type TestSuite added in v0.6.0

type TestSuite struct {
	T              *testing.T
	EncodingConfig appparams.EncodingConfig
	ChainID        string
	Kr             keyring.Keyring
	Txf            clienttx.Factory
	Rest           bool
}

func SetupTest added in v0.6.0

func SetupTest(t *testing.T, chainID string, rest bool) (suite TestSuite)

func (*TestSuite) AssertNotFound added in v0.6.0

func (suite *TestSuite) AssertNotFound(err error)

func (*TestSuite) BroadcastTx added in v0.6.0

func (suite *TestSuite) BroadcastTx(txBytes []byte) (*sdk.TxResponse, error)

func (*TestSuite) BuildAndBroadcastTx added in v0.6.0

func (suite *TestSuite) BuildAndBroadcastTx(
	msgs []sdk.Msg, signer string, account *dclauthtypes.Account,
) (*sdk.TxResponse, error)

func (*TestSuite) BuildTx added in v0.6.0

func (suite *TestSuite) BuildTx(
	msgs []sdk.Msg, signer string, account *dclauthtypes.Account,
) []byte

Generates Protobuf-encoded bytes.

func (*TestSuite) GetAddress added in v0.6.0

func (suite *TestSuite) GetAddress(uid string) sdk.AccAddress

func (*TestSuite) GetGRPCConn added in v0.6.0

func (suite *TestSuite) GetGRPCConn() *grpc.ClientConn

func (*TestSuite) QueryREST added in v0.6.0

func (suite *TestSuite) QueryREST(uri string, resp proto.Message) error

Jump to

Keyboard shortcuts

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