multisig

package
v0.3.9-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Overview

nolint

nolint

Index

Constants

This section is empty.

Variables

View Source
var (
	TemplateAddress core.Address
)

Functions

func BaseGas

func BaseGas(method uint8, signatures int) uint64

func ExecGas

func ExecGas(method uint8, keys int) uint64

func LoadGas

func LoadGas(keys int) uint64

func NewHandler

func NewHandler(address core.Address) core.Handler

NewHandler instantiates multisig handler with a particular configuration.

func Register

func Register(registry *registry.Registry)

Register template.

Types

type MultiSig

type MultiSig struct {
	Required   uint8
	PublicKeys []core.PublicKey `scale:"max=10"`
}

MultiSig K/N template.

func (*MultiSig) BaseGas

func (ms *MultiSig) BaseGas(method uint8) uint64

func (*MultiSig) DecodeScale

func (t *MultiSig) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*MultiSig) EncodeScale

func (t *MultiSig) EncodeScale(enc *scale.Encoder) (total int, err error)

func (*MultiSig) ExecGas

func (ms *MultiSig) ExecGas(method uint8) uint64

func (*MultiSig) LoadGas

func (ms *MultiSig) LoadGas() uint64

func (*MultiSig) MaxSpend

func (ms *MultiSig) MaxSpend(method uint8, args any) (uint64, error)

MaxSpend returns amount specified in the SpendArguments.

func (*MultiSig) Spend

func (ms *MultiSig) Spend(host core.Host, args *SpendArguments) error

Spend transfers an amount to the address specified in SpendArguments.

func (*MultiSig) Verify

func (ms *MultiSig) Verify(host core.Host, raw []byte, dec *scale.Decoder) bool

Verify that transaction is signed has k valid signatures.

type Part

type Part struct {
	Ref uint8
	Sig core.Signature
}

Part contains a reference to public key and signature from private key counterpart.

func (*Part) DecodeScale

func (t *Part) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*Part) EncodeScale

func (t *Part) EncodeScale(enc *scale.Encoder) (total int, err error)

type Signatures

type Signatures []Part

Signatures is a collections of parts that must satisfy multisig threshold requirement.

type SpawnArguments

type SpawnArguments struct {
	Required   uint8
	PublicKeys []core.PublicKey `scale:"max=10"` // update StorageLimit if it changes.
}

SpawnArguments contains a collection with PublicKeys.

func (*SpawnArguments) DecodeScale

func (t *SpawnArguments) DecodeScale(dec *scale.Decoder) (total int, err error)

func (*SpawnArguments) EncodeScale

func (t *SpawnArguments) EncodeScale(enc *scale.Encoder) (total int, err error)

type SpendArguments

type SpendArguments = wallet.SpendArguments

SpendArguments ...

type SpendTemplate

type SpendTemplate interface {
	Spend(core.Host, *SpendArguments) error
}

SpendTemplate interface for the template that support Spend method.

Jump to

Keyboard shortcuts

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