Documentation ¶
Index ¶
- func CondResetSignature(publicKey *ecdsa.PublicKey, userOps []*model.UserOperation, ...) error
- func GenXHash(opHashes []common.Hash) common.Hash
- func GenerateSignature(messageHash common.Hash, privateKey *ecdsa.PrivateKey) ([]byte, error)
- func HasEVMSolution(op *model.UserOperation) bool
- func HasXDataInCallData(op *model.UserOperation) bool
- func HasXDataInSignature(op *model.UserOperation) bool
- func IsAggregate(op *model.UserOperation) bool
- func RecoverSigner(messageHash common.Hash, signature []byte) string
- func SignUserOperations(signer *signer.EOA, hashes []common.Hash, userOps []*model.UserOperation) error
- func VerifyHashSignature(messageHash common.Hash, signature []byte, publicKey *ecdsa.PublicKey) bool
- func VerifySignature(publicKey *ecdsa.PublicKey, userOps []*model.UserOperation, ...) (bool, error)
- type ConsoleStyle
- type DebugParseResult
- type DebugParser
- type State
- type XDataExtractor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CondResetSignature ¶
func CondResetSignature(publicKey *ecdsa.PublicKey, userOps []*model.UserOperation, hashes []common.Hash) error
CondResetSignature resets the signature of UserOperations if the signature is invalid.
func GenXHash ¶
GenXHash computes the hash of multiple UserOperations' hashes. It concatenates the hashes, sorts them, and hashes the result. The result is the xChainHash.
func GenerateSignature ¶
GenerateSignature signs the prefixed message hash with the private key.
func HasEVMSolution ¶
func HasEVMSolution(op *model.UserOperation) bool
HasEVMSolution checks if the provided bytes likely represent valid EVM calldata through a number of heuristics.
func HasXDataInCallData ¶
func HasXDataInCallData(op *model.UserOperation) bool
func HasXDataInSignature ¶
func HasXDataInSignature(op *model.UserOperation) bool
func IsAggregate ¶
func IsAggregate(op *model.UserOperation) bool
func SignUserOperations ¶
func SignUserOperations(signer *signer.EOA, hashes []common.Hash, userOps []*model.UserOperation) error
SignUserOperations is a helper function to sign one or multiple UserOperations.
func VerifyHashSignature ¶
func VerifyHashSignature(messageHash common.Hash, signature []byte, publicKey *ecdsa.PublicKey) bool
VerifyHashSignature verifies the signature against the message hash and public key.
func VerifySignature ¶
func VerifySignature(publicKey *ecdsa.PublicKey, userOps []*model.UserOperation, hashes []common.Hash) (bool, error)
VerifySignature verifies the signature of one or multiple UserOperations. VerifySignature verifies the signature of one or multiple UserOperations.
Types ¶
type ConsoleStyle ¶
ConsoleStyle holds ANSI escape codes for console formatting
type DebugParseResult ¶
type DebugParseResult struct { XDataInCallData bool OpType uint16 IntentJSONLength int IntentJSON []byte LeadingGarbage []byte // Garbage bytes before IntentJSON TrailingGarbage []byte // Garbage bytes after IntentJSON HashListLength int HashList []model.CrossChainHashListEntry Error error }
DebugParseResult contains the parsed cross-chain data along with debug information
func DebugParseCrossChainData ¶
func DebugParseCrossChainData(data []byte, xDataInCallData bool) *DebugParseResult
DebugParseCrossChainData performs detailed parsing of cross-chain data with debugging information
func (*DebugParseResult) String ¶
func (r *DebugParseResult) String() string
String implements the Stringer interface for pretty-printing debug results
type DebugParser ¶
type DebugParser struct {
// contains filtered or unexported fields
}
DebugParser provides methods for parsing and analyzing cross-chain data
func NewDebugParser ¶
func NewDebugParser() *DebugParser
NewDebugParser creates a debug parser that can be used to analyze cross-chain data
func (*DebugParser) ParseAndDebug ¶
func (p *DebugParser) ParseAndDebug(data []byte, xDataInCallData bool) (*model.CrossChainData, *DebugParseResult)
ParseAndDebug parses the provided data and returns both the parsed result and debug information
type State ¶
type State int
State represents the state of a UserOperation
const ( StateUnsigned State = iota StateConventional StateIntentUnsolved // Intent JSON in callData, awaiting solution StateSolutionLess // Intent with empty solution StateIntentSolved // Intent with valid EVM solution StateXChainUnsolved // XData in callData, awaiting solution StateXChainInSignature // XData appended to signature StateXChainSolved // XData with valid EVM solution StateXChainAggregate // Special case: Aggregate XChain operation )
func DetermineState ¶
func DetermineState(op *model.UserOperation) State
DetermineState analyzes a UserOperation to determine its current state
func (State) FormatWithDetail ¶
FormatWithDetail returns a detailed colored status message
type XDataExtractor ¶
type XDataExtractor struct {
// contains filtered or unexported fields
}
XDataExtractor provides methods to extract XData from UserOperation fields
func NewXDataExtractor ¶
func NewXDataExtractor() *XDataExtractor
NewXDataExtractor creates a new XDataExtractor instance
func (*XDataExtractor) ExtractAndDebug ¶
func (x *XDataExtractor) ExtractAndDebug(op *model.UserOperation) (debug *DebugParseResult, err error)
ExtractAndDebug attempts to find and parse XData from a UserOperation