testutils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const BLOCKCHAIN_RPC_URL = "http://localhost:7545"
View Source
const TEST_PRIVATE_KEY = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"

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

Variables

This section is empty.

Functions

func BuildIdentityUpdateEvent

func BuildIdentityUpdateEvent(inboxId [32]byte, update []byte, sequenceID uint64) ([]byte, error)

func BuildIdentityUpdateLog

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

Build a log message for an IdentityUpdateCreated event

func BuildMessageSentEvent

func BuildMessageSentEvent(
	groupID [32]byte,
	message []byte,
	sequenceID uint64,
) ([]byte, error)

Build an abi encoded MessageSent event struct

func BuildMessageSentLog

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

Build a log message for a MessageSent event

func DeployGroupMessagesContract

func DeployGroupMessagesContract(t *testing.T) string

func DeployIdentityUpdatesContract

func DeployIdentityUpdatesContract(t *testing.T) string

func DeployNodesContract

func DeployNodesContract(t *testing.T) string

func GetContractsOptions

func GetContractsOptions(t *testing.T) config.ContractsOptions

func GetPayerOptions

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

func InsertGatewayEnvelopes

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

func Marshal

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

func NewDB

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

func NewDBs

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

func NewLog

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

func RandomAddress

func RandomAddress() common.Address

func RandomBytes

func RandomBytes(n int) []byte

func RandomGroupID

func RandomGroupID() [32]byte

func RandomInboxId

func RandomInboxId() string

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