abi

package
v0.0.0-...-39f44e7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package abi defines the abi of the smartcontract

Package abi The new.go keeps the functions that creates a new Abi from given parameters

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Abi

type Abi struct {
	Body string `json:"body"`
	Id   string `json:"abi_id"`
}

func New

func New(kv key_value.KeyValue) (*Abi, error)

New Wraps the JSON abi interface to the internal data type. It's blockchain agnostic.

func NewFromBytes

func NewFromBytes(bytes []byte) (*Abi, error)

NewFromBytes creates the Abi data based on the JSON string. This function calculates the abi hash but won't set it in the database.

func NewFromInterface

func NewFromInterface(body interface{}) (*Abi, error)

NewFromInterface The bytes data are given as a JSON It will generate ID.

func (*Abi) Exist

func (a *Abi) Exist(_ interface{}) bool

Exist Not implemented common/data_type/database.Crud interface

Returns an error

func (*Abi) GenerateId

func (a *Abi) GenerateId() error

GenerateId Creates the abi hash from the abi body The Abi ID is the unique identifier of the abi

ID is the first 8 characters of the

sha256 checksum representation of the abi.

If the bytes field is invalid, then the id will be empty

func (*Abi) Insert

func (a *Abi) Insert(dbInterface interface{}) error

Insert into database

Implements common/data_type/database.Crud interface

func (*Abi) Interface

func (a *Abi) Interface(body interface{}) error

Interface Get the interface from the bytes It converts the bytes into the JSON value

func (*Abi) Select

func (a *Abi) Select(dbInterface interface{}) error

Select Not implemented common/data_type/database.Crud interface

Returns an error

func (*Abi) SelectAll

func (a *Abi) SelectAll(dbInterface interface{}, returnValues interface{}) error

SelectAll abi from database

Implements common/data_type/database.Crud interface

func (*Abi) SelectAllByCondition

func (a *Abi) SelectAllByCondition(_ interface{}, _ key_value.KeyValue, _ interface{}) error

SelectAllByCondition Not implemented common/data_type/database.Crud interface

Returns an error

func (*Abi) ToString

func (a *Abi) ToString() string

ToString Returns the abi content as a string. The abi bytes are first formatted. If the abi parameters are invalid, then the ToString() returns empty string.

func (*Abi) Update

func (a *Abi) Update(_ interface{}, _ uint8) error

Update Not implemented common/data_type/database.Crud interface

Returns an error

Jump to

Keyboard shortcuts

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