Search Apps Documentation Source Content File Folder Download Copy Actions Download

message_lib.gno

1.15 Kb · 42 lines
 1package lziface
 2
 3// MessageLibType represents the different types of message libraries
 4type MessageLibType uint8
 5
 6type SetConfigParam struct {
 7	EID        uint32
 8	ConfigType uint32
 9	Config     []byte
10}
11
12const (
13	Send MessageLibType = iota
14	Receive
15	SendAndReceive
16)
17
18// String representation for MessageLibType
19func (m MessageLibType) String() string {
20	return [...]string{"Send", "Receive", "SendAndReceive"}[m]
21}
22
23// MessageLib defines the interface for message libraries
24type MessageLib interface {
25	// IERC165 inheritance would be represented by including its interface methods
26	// if we were fully implementing it in Go
27
28	// SetConfig sets configuration parameters for an OApp
29	SetConfig(oappPkgPath string, config []SetConfigParam)
30
31	// GetConfig retrieves configuration for a specific endpoint and config type
32	GetConfig(eid uint32, oappPkgPath string, configType uint32) []byte
33
34	// IsSupportedEid checks if an endpoint ID is supported
35	IsSupportedEid(eid uint32) bool
36
37	// Version returns the version information
38	Version() (major uint64, minor uint8, endpointVersion uint8)
39
40	// MessageLibType returns the type of message library
41	MessageLibType() MessageLibType
42}