adapters

package
v0.0.0-...-15c5627 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurseAdapter

type CurseAdapter struct {
	CCIPAddress          string
	LatestCCIPPackageID  string
	CCIPObjectRef        string
	CCIPOwnerCapObjectID string
	CurserCapObjectID    string
	RouterAddress        string
	RouterStateObjectID  string
}

CurseAdapter implements fastcurse.CurseAdapter and fastcurse.CurseSubjectAdapter for Sui.

Curse() routes through FastCurseCurseSequence and requires a registered CurserCap. Uncurse uses CCIP OwnerCap via UncurseSequence for slow MCMS proposals.

func NewCurseAdapter

func NewCurseAdapter() *CurseAdapter

NewCurseAdapter returns a new, uninitialized CurseAdapter.

func (*CurseAdapter) Curse

Curse returns a sequence that curses the given subjects via CurserCap on the fast MCMS path.

The adapter is only invoked by the generic fastcurse framework (fastcurse.CurseChangeset / fastcurse.GloballyCurseChainChangeset), which always builds an MCMS proposal via OutputBuilder.Build(cfg.MCMS). We therefore force ProposalOnly: true so the underlying operation never attempts direct execution — the CurserCap lives inside the fast MCMS Registry (registered via mint_and_register_curser_cap) and has no top-level owner, so direct PTB assembly against its object ID would fail with "Object not found".

func (*CurseAdapter) DeriveCurseAdapterVersion

func (c *CurseAdapter) DeriveCurseAdapterVersion(cldf.Environment, uint64) (*semver.Version, error)

DeriveCurseAdapterVersion returns the RMN adapter version for this Sui deployment.

func (*CurseAdapter) Initialize

func (c *CurseAdapter) Initialize(e cldf.Environment, selector uint64) error

Initialize populates the adapter's state fields from the on-chain state for the given selector. Chain metadata is resolved via LoadOnchainStatesui, which prefers datastore address refs (address_refs.json) and falls back to the legacy address book (addresses.json).

func (*CurseAdapter) IsChainConnectedToTargetChain

func (c *CurseAdapter) IsChainConnectedToTargetChain(e cldf.Environment, selector uint64, targetSelector uint64) (bool, error)

IsChainConnectedToTargetChain returns true if targetSelector is a configured destination on the Sui router for the chain identified by selector.

func (*CurseAdapter) IsCurseEnabledForChain

func (c *CurseAdapter) IsCurseEnabledForChain(cldf.Environment, uint64) (bool, error)

IsCurseEnabledForChain always returns true for Sui — cursing is always available.

func (*CurseAdapter) IsSubjectCursedOnChain

func (c *CurseAdapter) IsSubjectCursedOnChain(e cldf.Environment, selector uint64, subject fastcurse.Subject) (bool, error)

IsSubjectCursedOnChain returns true when subject is explicitly present in the on-chain cursed-subjects set. A global curse does not cause lane subjects to appear cursed here; call with GlobalCurseSubject() to test global curse state.

func (*CurseAdapter) ListConnectedChains

func (c *CurseAdapter) ListConnectedChains(e cldf.Environment, selector uint64) ([]uint64, error)

ListConnectedChains returns all destination chain selectors configured in the Sui router.

func (*CurseAdapter) SelectorToSubject

func (c *CurseAdapter) SelectorToSubject(selector uint64) fastcurse.Subject

SelectorToSubject converts a chain selector to a fastcurse.Subject using BigEndian encoding. Sui uses the same encoding as the generic (EVM-default) case.

func (*CurseAdapter) SubjectToSelector

func (c *CurseAdapter) SubjectToSelector(subject fastcurse.Subject) (uint64, error)

SubjectToSelector converts a fastcurse.Subject to a chain selector using BigEndian encoding.

func (*CurseAdapter) Uncurse

Uncurse returns a sequence that lifts the curse on given subjects on the specified Sui chain. Uncurse always uses OwnerCap via slow MCMS; fast MCMS cannot uncurse.

Like Curse, this adapter is only invoked by the generic fastcurse framework in MCMS-proposal mode, so we set ProposalOnly: true. In production the OwnerCap is owned by the slow MCMS timelock — the loaded Sui deployer signer cannot authorize direct execution anyway, so the only useful output here is an MCMS proposal leaf.

type MCMSReader

type MCMSReader struct{}

func (*MCMSReader) GetChainMetadata

func (r *MCMSReader) GetChainMetadata(e cldf.Environment, chainSelector uint64, input mcms_utils.Input) (mcmstypes.ChainMetadata, error)

func (*MCMSReader) GetMCMSRef

func (r *MCMSReader) GetMCMSRef(e cldf.Environment, chainSelector uint64, input mcms_utils.Input) (datastore.AddressRef, error)

func (*MCMSReader) GetTimelockRef

func (r *MCMSReader) GetTimelockRef(e cldf.Environment, chainSelector uint64, input mcms_utils.Input) (datastore.AddressRef, error)

Jump to

Keyboard shortcuts

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