test

package
v0.6.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTestSigner

func CreateTestSigner() (*core.Ed25519Signer, ed25519.PublicKey, p2ptypes.PeerID)

Helper function to create test Ed25519 signer and keys

func DeployCapabilitiesRegistry

func DeployCapabilitiesRegistry(sethClient *seth.Client, pubKeys []*ed25519.PublicKey, p2pIds []p2ptypes.PeerID) (common.Address, error)

func DeployTestWorkflowRegistry

func DeployTestWorkflowRegistry(t *testing.T, sethClient *seth.Client) (*workflow_registry_wrapper_v2.WorkflowRegistry, error)

deployTestWorkflowRegistry deploys the WorkflowRegistry contract using the provided Seth client.

func NewSethClientWithContracts

func NewSethClientWithContracts(t *testing.T, logger *zerolog.Logger, rpcUrl string, chainId uint64, configFile string) *seth.Client

func PreparePayloadForSigning

func PreparePayloadForSigning(payload OwnershipProofSignaturePayload) ([]byte, error)

Convert payload fields into Solidity-compatible data types and concatenate them in the expected order. Use the same hashing algorithm as the Solidity contract (keccak256) to hash the concatenated data. Finally, follow the EIP-191 standard to create the final hash for signing.

Types

type OwnershipProofSignaturePayload

type OwnershipProofSignaturePayload struct {
	RequestType              uint8          // should be uint8 in Solidity, 1 byte
	WorkflowOwnerAddress     common.Address // should be 20 bytes in Solidity, address type
	ChainID                  string         // should be uint256 in Solidity, chain-selectors provide it as a string
	WorkflowRegistryContract common.Address // address of the WorkflowRegistry contract, should be 20 bytes in Solidity
	Version                  string         // should be dynamic type in Solidity (string)
	ValidityTimestamp        time.Time      // should be uint256 in Solidity
	OwnershipProofHash       common.Hash    // should be bytes32 in Solidity, 32 bytes hash of the ownership proof
}

Jump to

Keyboard shortcuts

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