gear_utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToHex added in v0.1.2

func AddToHex(addr []byte) string

func CallsMapByModuleName

func CallsMapByModuleName(meta *types.MetadataStruct, moduleName string) map[string]*types.MetadataCalls

func DecodeToString added in v1.0.3

func DecodeToString(str string) (string, error)

func GetArgumentsForExtrinsicParams added in v0.1.3

func GetArgumentsForExtrinsicParams(moduleName, callName string, modules []types.MetadataModules) []types.MetadataModuleCallArgument

func GetCallArgsByModuleAndCallNames

func GetCallArgsByModuleAndCallNames(meta *types.MetadataStruct, moduleName, callName string) (args []types.MetadataModuleCallArgument)

GetCallArgsByModuleAndCallNames finds extrinction's Args by parent ModuleName and its CallName

e.g: ModuleName: `Gear` CallName: `upload_code`

func GetCallArgsByModuleCallName

func GetCallArgsByModuleCallName(meta *types.MetadataStruct, moduleCallName string) (args []types.MetadataModuleCallArgument)

GetCallArgsByModuleCallName finds extrinction's Args by its CallName

Warning! It's safer to use GetCallArgsByModuleAndCallNames instead

func GetCallLookupIndexByModuleAndCallNames

func GetCallLookupIndexByModuleAndCallNames(meta *types.MetadataStruct, moduleName, callName string) string

GetCallLookupIndexByModuleAndCallNames finds extrinction's LookupIndex by parent ModuleName and its CallName

e.g: ModuleName: `Gear` CallName: `upload_code`

func GetCallLookupIndexByModuleCallName

func GetCallLookupIndexByModuleCallName(meta *types.MetadataStruct, moduleCallName string) string

GetCallLookupIndexByModuleCallName finds extrinction's CallIndex by its CallName

Warning! It's safer to use GetCallLookupIndexByModuleAndCallNames instead

func GetCodeIdFromWasmFile added in v1.0.0

func GetCodeIdFromWasmFile(filePath string) (string, error)

GetCodeIdFromWasmFile reads wasm file and returns it Blake2 hash

https://docs.rs/gprimitives/latest/gprimitives/struct.CodeId.html

func GetEventsByModuleName added in v0.1.2

func GetEventsByModuleName(meta *types.MetadataStruct, moduleName string) (events []types.MetadataEvents)

func GetExtrinsicDecoderByRawHex added in v1.0.0

func GetExtrinsicDecoderByRawHex(raw string, meta *types.MetadataStruct) *scalecodec.ExtrinsicDecoder

func GetMetaData

func GetMetaData(cli gear_client.IClient) (*types.MetadataStruct, error)

func GetMinimalGasForProgram added in v1.0.2

func GetMinimalGasForProgram(calculateGasResponse *models.RpcGenericResponse) (*int, error)

func GetStorageTypeByModuleAndMethodNames added in v0.1.2

func GetStorageTypeByModuleAndMethodNames(moduleName, methodName string, modules []types.MetadataModules) (*types.StorageType, error)

func GetStoragesByModuleName added in v0.1.2

func GetStoragesByModuleName(meta *types.MetadataStruct, moduleName string) (storages []types.MetadataStorage)

func ModulesMap

func ModulesMap(meta *types.MetadataStruct) map[string]*types.MetadataModules

func StrToAny added in v1.0.3

func StrToAny(aArr []string) []any

func TextToHex added in v1.0.2

func TextToHex(text string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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