diadem

package module
v0.0.0-...-0b06f50 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: BSD-3-Clause Imports: 17 Imported by: 42

README

go-diadem Build Status

Go package for building Go Smart Contracts for the diadem SDK

This package is also used for building Clients to DAppChains in the diadem SDK.

The code that runs the actual DAppChain(sidechain) is in a different repository.

based on go-loom

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowDebug = kitlevel.AllowDebug
	AllowInfo  = kitlevel.AllowInfo
	AllowWarn  = kitlevel.AllowWarn
	AllowError = kitlevel.AllowError
	Allow      = func(level string) kitlevel.Option {
		switch level {
		case "debug":
			return AllowDebug()
		case "info":
			return AllowInfo()
		case "warn":
			return AllowWarn()
		case "error":
			return AllowError()
		default:
			return nil
		}
	}
)
View Source
var (
	ErrInvalidAddress = errors.New("invalid address")
)

Functions

func BigZeroPB

func BigZeroPB() *types.BigUInt

func DataPrefix

func DataPrefix(addr Address) []byte

func MakeFileLoggerWriter

func MakeFileLoggerWriter(diademLogLevel, dest string) io.Writer

func PermPrefix

func PermPrefix(addr Address) []byte

func TextKey

func TextKey(addr Address) []byte

Types

type Address

type Address struct {
	ChainID string
	Local   LocalAddress
}

func MustParseAddress

func MustParseAddress(s string) Address

func ParseAddress

func ParseAddress(s string) (Address, error)

ParseAddress parses an address generated from String()

func RootAddress

func RootAddress(chainID string) Address

func UnmarshalAddressPB

func UnmarshalAddressPB(pb *types.Address) Address

func (Address) Bytes

func (a Address) Bytes() []byte

func (Address) Compare

func (a Address) Compare(other Address) int

func (Address) IsEmpty

func (a Address) IsEmpty() bool

func (Address) MarshalPB

func (a Address) MarshalPB() *types.Address

func (Address) String

func (a Address) String() string

type BigUInt

type BigUInt = common.BigUInt

func NewBigUInt

func NewBigUInt(i *big.Int) *BigUInt

NewBigUint creates a biguint from a bigint

func NewBigUIntFromInt

func NewBigUIntFromInt(i int64) *BigUInt

NewBigUintFromInt creates a biguint from a int64

type BlockHeader

type BlockHeader = types.BlockHeader

type LocalAddress

type LocalAddress = common.LocalAddress

func LocalAddressFromHexString

func LocalAddressFromHexString(hexAddr string) (LocalAddress, error)

func LocalAddressFromPublicKey

func LocalAddressFromPublicKey(pubKey []byte) LocalAddress

func LocalAddressFromPublicKeyV2

func LocalAddressFromPublicKeyV2(pubKey []byte) LocalAddress

recent versions of Tendermint > 0.22.0

type Logger

type Logger struct {
	kitlog.Logger
}

func MakediademLogger

func MakediademLogger(logLevel string, w io.Writer, tr func(w io.Writer) kitlog.Logger) *Logger

func NewFilter

func NewFilter(next kitlog.Logger, options ...kitlevel.Option) *Logger

func NewdiademLogger

func NewdiademLogger(diademLogLevel, dest string) *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg string, keyvals ...interface{})

Debug logs a message at level Debug.

func (*Logger) Error

func (l *Logger) Error(msg string, keyvals ...interface{})

Error logs a message at level Error.

func (*Logger) Info

func (l *Logger) Info(msg string, keyvals ...interface{})

Info logs a message at level Info.

func (*Logger) Warn

func (l *Logger) Warn(msg string, keyvals ...interface{})

Warn logs a message at level Debug.

type Validator

type Validator = types.Validator

type ValidatorSet

type ValidatorSet map[string]*Validator

func NewValidatorSet

func NewValidatorSet(vals ...*Validator) ValidatorSet

func (ValidatorSet) Get

func (vs ValidatorSet) Get(pubKey []byte) *Validator

func (ValidatorSet) Set

func (vs ValidatorSet) Set(v *Validator)

func (ValidatorSet) Slice

func (vs ValidatorSet) Slice() []*Validator

Jump to

Keyboard shortcuts

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