counterchain

package
v0.0.0-...-eab7081 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_MESSAGE_BODY_BYTES = 2_000

Variables

View Source
var (
	LEGACY_MULTISIG      = "LegacyMultiSig"
	MERKLE_ROOT_MULTISIG = "MerkleRootMultiSig"
	MESSAGE_ID_MULTISIG  = "MessageIdMultiSig"
)

Functions

This section is empty.

Types

type CounterChain

type CounterChain struct {
	T       *testing.T
	ValSet  ValSet
	Tree    *imt.Tree
	Domain  uint32
	IsmType string
}

func CreateCounterChain

func CreateCounterChain(t *testing.T, domain uint32, ismType string) *CounterChain

func CreateEmperorValidator

func CreateEmperorValidator(t *testing.T, domain uint32, ismType string, privKey string) *CounterChain

He's the emperor because he's the only one

func (*CounterChain) CreateLegacyMetadata

func (c *CounterChain) CreateLegacyMetadata(message []byte, proof [imt.TreeDepth][32]byte) (metadata []byte)

Validator will not have proof -- needs to get it from relayer which assembles it. Relayer assembles message, metadata, and proof

func (*CounterChain) CreateMerkleRootMetadata

func (c *CounterChain) CreateMerkleRootMetadata(message []byte, proof [imt.TreeDepth][32]byte) (metadata []byte)

func (*CounterChain) CreateMessage

func (c *CounterChain) CreateMessage(sender string, originDomain uint32, destDomain uint32, recipient string, msg string) (message []byte, proof [imt.TreeDepth][32]byte)

func (*CounterChain) CreateMessageIdMetadata

func (c *CounterChain) CreateMessageIdMetadata(message []byte) (metadata []byte)

func (*CounterChain) CreateRelayerLegacyMetadata

func (c *CounterChain) CreateRelayerLegacyMetadata(message []byte, proof [imt.TreeDepth][32]byte, originMailbox []byte) (metadata []byte)

Relayer assembles message, metadata, and proof but does not sign

func (*CounterChain) GetMessageId

func (c *CounterChain) GetMessageId(message []byte) []byte

func (*CounterChain) Sign

func (c *CounterChain) Sign(digest []byte) []byte

func (*CounterChain) VerifyAbstractIsm

func (c *CounterChain) VerifyAbstractIsm(ism ismtypes.AbstractIsm) bool

type Val

type Val struct {
	Addr string
	Priv *ecdsa.PrivateKey
}

func CreateVal

func CreateVal(t *testing.T) *Val

func CreateValFromKey

func CreateValFromKey(t *testing.T, ecdsaPrivKey string) *Val

type ValSet

type ValSet struct {
	Vals      []Val
	Total     uint32
	Threshold uint8
}

func CreateValSet

func CreateValSet(t *testing.T, total uint32, threshold uint8) *ValSet

Jump to

Keyboard shortcuts

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