multisig

package
v0.2.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Code generated by fastssz. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PublicKeyHashesToMultisigHash

func PublicKeyHashesToMultisigHash(pubkeys [][20]byte, numNeeded uint64) [20]byte

PublicKeyHashesToMultisigHash returns the hash of multiple publickey hashes

Types

type Multipub

type Multipub struct {
	PublicKeys [][48]byte `ssz-max:"15"`
	NumNeeded  uint64
}

Multipub represents multiple public keys that can be signed by some subset numNeeded.

func NewMultipub

func NewMultipub(pubs []common.PublicKey, numNeeded uint64) *Multipub

NewMultipub constructs a new multi-pubkey.

func (*Multipub) Copy

func (m *Multipub) Copy() *Multipub

Copy returns a copy of the multipub.

func (*Multipub) Hash

func (m *Multipub) Hash() ([20]byte, error)

Hash gets the hash of the multipub.

func (*Multipub) HashTreeRoot

func (m *Multipub) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Multipub object

func (*Multipub) HashTreeRootWith

func (m *Multipub) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Multipub object with a hasher

func (*Multipub) Marshal

func (m *Multipub) Marshal() ([]byte, error)

Marshal encodes the data.

func (*Multipub) MarshalSSZ

func (m *Multipub) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Multipub object

func (*Multipub) MarshalSSZTo

func (m *Multipub) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Multipub object to a target array

func (*Multipub) SizeSSZ

func (m *Multipub) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Multipub object

func (*Multipub) ToBech32

func (m *Multipub) ToBech32() (string, error)

ToBech32 returns the bech32 address.

func (*Multipub) Unmarshal

func (m *Multipub) Unmarshal(b []byte) error

Unmarshal decodes the data.

func (*Multipub) UnmarshalSSZ

func (m *Multipub) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Multipub object

type Multisig

type Multisig struct {
	PublicKey  *Multipub
	Signatures [][96]byte       `ssz-max:"15"`
	KeysSigned bitfield.Bitlist `ssz:"bitlist" ssz-max:"15"`
}

Multisig represents an m-of-n multisig.

func NewMultisig

func NewMultisig(multipub *Multipub) *Multisig

NewMultisig creates a new blank multisig.

func (*Multisig) Copy

func (m *Multisig) Copy() *Multisig

Copy copies the signature.

func (*Multisig) GetPublicKey

func (m *Multisig) GetPublicKey() (*Multipub, error)

GetPublicKey gets the public key included in the signature.

func (*Multisig) HashTreeRoot

func (m *Multisig) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the Multisig object

func (*Multisig) HashTreeRootWith

func (m *Multisig) HashTreeRootWith(hh *ssz.Hasher) (err error)

HashTreeRootWith ssz hashes the Multisig object with a hasher

func (*Multisig) Marshal

func (m *Multisig) Marshal() ([]byte, error)

Marshal encodes the data.

func (*Multisig) MarshalSSZ

func (m *Multisig) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the Multisig object

func (*Multisig) MarshalSSZTo

func (m *Multisig) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the Multisig object to a target array

func (*Multisig) Sign

func (m *Multisig) Sign(secKey common.SecretKey, msg []byte) error

Sign signs a multisig through a secret key.

func (*Multisig) SizeSSZ

func (m *Multisig) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the Multisig object

func (*Multisig) Unmarshal

func (m *Multisig) Unmarshal(b []byte) error

Unmarshal decodes the data.

func (*Multisig) UnmarshalSSZ

func (m *Multisig) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the Multisig object

func (*Multisig) Verify

func (m *Multisig) Verify(msg []byte) bool

Verify verifies a multisig message.

Jump to

Keyboard shortcuts

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