testutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TEST_PRIVATE_KEY  = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
	THIS_FILE_DEPTH   = "../.."
	PATH_TO_JSON_FILE = "dev/environments/anvil.json"
)

This is the private key that anvil has funded by default This is safe to commit

View Source
const (
	LocalTestDBDSNPrefix = "postgres://postgres:xmtp@localhost:8765"
	LocalTestDBDSNSuffix = "?sslmode=disable"
)
View Source
const (
	LOCAL_PRIVATE_KEY = "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"
)

Variables

This section is empty.

Functions

func BuildIdentityUpdateEvent

func BuildIdentityUpdateEvent(update []byte) ([]byte, error)

func BuildIdentityUpdateLog

func BuildIdentityUpdateLog(
	t *testing.T,
	inboxId [32]byte,
	clientEnvelope *envelopesProto.ClientEnvelope,
	sequenceID uint64,
) types.Log

Build a log message for an IdentityUpdateCreated event

func BuildMessageSentEvent

func BuildMessageSentEvent(
	message []byte,
) ([]byte, error)

Build an abi encoded MessageSent event struct

func BuildMessageSentLog

func BuildMessageSentLog(
	t *testing.T,
	groupID [32]byte,
	clientEnvelope *envelopesProto.ClientEnvelope,
	sequenceID uint64,
) types.Log

Build a log message for a MessageSent event

func CancelledContext added in v0.1.1

func CancelledContext() context.Context

func CreatePayer added in v0.3.0

func CreatePayer(t *testing.T, db *sql.DB, address ...string) int32

func GetCallerName added in v0.2.0

func GetCallerName(depth int) string

func GetHealthyNode added in v0.3.0

func GetHealthyNode(nodeID uint32) registry.Node

func GetLatestTag added in v0.2.1

func GetLatestTag(t *testing.T) string

func GetLatestVersion added in v0.2.1

func GetLatestVersion(t *testing.T) *semver.Version

func GetPayerOptions

func GetPayerOptions(t *testing.T) config.PayerOptions

func GetScriptPath added in v0.4.0

func GetScriptPath(paths ...string) string

func GetUnhealthyNode added in v0.3.0

func GetUnhealthyNode(nodeID uint32) registry.Node

func InsertGatewayEnvelopes

func InsertGatewayEnvelopes(
	t *testing.T,
	db *sql.DB,
	rows []queries.InsertGatewayEnvelopeParams,
	notifyChan ...chan bool,
)

func Int64ToHash added in v0.2.0

func Int64ToHash(x int64) common.Hash

func Marshal

func Marshal(t *testing.T, msg proto.Message) []byte

func NewContractsOptions added in v0.3.0

func NewContractsOptions(t *testing.T, wsUrl string) config.ContractsOptions

func NewDB

func NewDB(t *testing.T, ctx context.Context) (*sql.DB, string)

func NewDBs

func NewDBs(t *testing.T, ctx context.Context, count int) []*sql.DB

func NewLog

func NewLog(t testing.TB) *zap.Logger

func RandomAddress

func RandomAddress() common.Address

func RandomBlockHash added in v0.2.0

func RandomBlockHash() common.Hash

func RandomBytes

func RandomBytes(n int) []byte

func RandomGroupID

func RandomGroupID() [32]byte

func RandomInboxId

func RandomInboxId() string

func RandomInt32 added in v0.3.0

func RandomInt32() int32

func RandomLogTopic

func RandomLogTopic() common.Hash

func RandomPrivateKey

func RandomPrivateKey(t *testing.T) *ecdsa.PrivateKey

func RandomString

func RandomString(n int) string

func RandomStringLower

func RandomStringLower(n int) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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