utils

package
v0.0.0-...-d45aa2c Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommonFlags

func AddCommonFlags(cmd *cobra.Command) error

AddCommonFlags adds common flags to the provided Cobra command.

func ConvJSONNum2ProtoValues

func ConvJSONNum2ProtoValues(jsonStr string) (string, error)

ConvJSONNum2ProtoValues converts numeric values in a JSON string to base64 encoded BigInt representations. It specifically looks for fields named "value" and converts their numeric contents.

func GetChainMonikers

func GetChainMonikers(cmd *cobra.Command, nodesMap config.NodesMap, opsCount int) ([]string, error)

GetChainMonikers parses the network moniker or numeric chain-id value from the command line flag 'c' and returns a slice of chain monikers.

func GetHashes

func GetHashes(cmd *cobra.Command) ([]common.Hash, error)

GetHashes parses the 32-byte hash values from the command line flag 'h' and returns a slice of common.Hash.

func GetUserOps

func GetUserOps(cmd *cobra.Command) ([]*model.UserOperation, error)

GetUserOps parses the 'userop' JSON string or file provided in the command flags and returns a slice of UserOperation objects. It processes numeric values before unmarshaling to ensure proper formatting.

func IsNumericString

func IsNumericString(s string) bool

IsNumericString checks if a string represents a numeric value (big.Int)

func IsValidHex

func IsValidHex(s string) bool

IsValidHex checks if a string is a valid hexadecimal representation.

func PrintPostIntentSolutionSignature

func PrintPostIntentSolutionSignature(userOp *model.UserOperation)

PrintPostIntentSolutionSignature prints the signature + hex encoded intent JSON (calldata).

func PrintSignedOpJSON

func PrintSignedOpJSON(userOp *model.UserOperation) error

func UpdateUserOp

func UpdateUserOp(userOp *model.UserOperation, nonce *big.Int) *model.UserOperation

UpdateUserOp sets the nonce value and 4337 default gas limits if they are zero.

Types

type NoncesMap

type NoncesMap map[string]*big.Int // moniker -> nonce

Jump to

Keyboard shortcuts

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