transaction

package
v0.0.0-...-b6721d7 Latest Latest
Warning

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

Go to latest
Published: May 27, 2014 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

// Block Allocation Transaction (BAT)

// Name Allocation Transaction (NAT)

// Name Deallocation Transaction (NDT)

// Name Reservation Transaction (NRT)

Reference Update Transaction (RUT)

Index

Constants

View Source
const (
	BLOCK_ATTRIBUTION_VERSION = 1
)
View Source
const (
	NAME_ALLOCATION_VERSION = 1
)
View Source
const (
	NAME_DEALLOCATION_VERSION = 1
)
View Source
const (
	NAME_RESERVATION_VERSION = 1
)
View Source
const (
	REFERENCE_UPDATE_VERSION = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockAttribution

type BlockAttribution struct {
	Version uint32
}

func NewBlockAttribution

func NewBlockAttribution() (*BlockAttribution, error)

func (*BlockAttribution) Encode

func (txn *BlockAttribution) Encode() ([]byte, error)

func (*BlockAttribution) Hash

func (txn *BlockAttribution) Hash() types.Hash

func (*BlockAttribution) MarshalJSON

func (tx *BlockAttribution) MarshalJSON() ([]byte, error)

func (*BlockAttribution) String

func (*BlockAttribution) String() string

func (*BlockAttribution) Valid

func (txn *BlockAttribution) Valid() bool

type Envelope

type Envelope struct {
	PreviousEnvelopeHash types.Hash
	SignatureR           []byte
	SignatureS           []byte
	PublicKey            []byte
	NextPublicKey        []byte
	Transaction          T
}

func DecodeEnvelope

func DecodeEnvelope(b []byte) (*Envelope, error)

func NewEnvelope

func NewEnvelope(prev types.Hash, txn T, args ...[]byte) *Envelope

func (*Envelope) Encode

func (e *Envelope) Encode() ([]byte, error)

func (*Envelope) Hash

func (e *Envelope) Hash() types.Hash

func (*Envelope) Sign

func (e *Envelope) Sign(privateKey *ecdsa.PrivateKey) error

func (*Envelope) String

func (e *Envelope) String() string

func (*Envelope) Verify

func (e *Envelope) Verify() (bool, error)

type NameAllocation

type NameAllocation struct {
	Version uint32
	Name    string
	Rand    []byte
}

func NewNameAllocation

func NewNameAllocation(name string, random []byte) (*NameAllocation, error)

func (*NameAllocation) Encode

func (txn *NameAllocation) Encode() ([]byte, error)

func (*NameAllocation) Hash

func (txn *NameAllocation) Hash() types.Hash

func (*NameAllocation) MarshalJSON

func (tx *NameAllocation) MarshalJSON() ([]byte, error)

func (*NameAllocation) String

func (txn *NameAllocation) String() string

func (*NameAllocation) Valid

func (txn *NameAllocation) Valid() bool

type NameDeallocation

type NameDeallocation struct {
	Version uint32
	Name    string
}

func NewNameDeallocation

func NewNameDeallocation(name string) (txn *NameDeallocation, err error)

func (*NameDeallocation) Encode

func (txn *NameDeallocation) Encode() ([]byte, error)

func (*NameDeallocation) Hash

func (txn *NameDeallocation) Hash() types.Hash

func (*NameDeallocation) MarshalJSON

func (tx *NameDeallocation) MarshalJSON() ([]byte, error)

func (*NameDeallocation) String

func (txn *NameDeallocation) String() string

func (*NameDeallocation) Valid

func (txn *NameDeallocation) Valid() bool

type NameReservation

type NameReservation struct {
	Version uint32
	Hashed  types.Hash
}

func NewNameReservation

func NewNameReservation(name string) (*NameReservation, []byte)

func (*NameReservation) Encode

func (txn *NameReservation) Encode() ([]byte, error)

func (*NameReservation) Hash

func (txn *NameReservation) Hash() types.Hash

func (*NameReservation) MarshalJSON

func (tx *NameReservation) MarshalJSON() ([]byte, error)

func (*NameReservation) String

func (txn *NameReservation) String() string

func (*NameReservation) Valid

func (txn *NameReservation) Valid() bool

type ReferenceUpdate

type ReferenceUpdate struct {
	Version    uint32
	Repository string
	Ref        string
	Old        repository.Ref
	New        repository.Ref
}

func NewReferenceUpdate

func NewReferenceUpdate(repository, ref string, old, new repository.Ref) *ReferenceUpdate

func (*ReferenceUpdate) Encode

func (txn *ReferenceUpdate) Encode() ([]byte, error)

func (*ReferenceUpdate) Hash

func (txn *ReferenceUpdate) Hash() types.Hash

func (*ReferenceUpdate) MarshalJSON

func (tx *ReferenceUpdate) MarshalJSON() ([]byte, error)

func (*ReferenceUpdate) String

func (txn *ReferenceUpdate) String() string

func (*ReferenceUpdate) Valid

func (txn *ReferenceUpdate) Valid() bool

type T

type T interface {
	Encode() ([]byte, error)
	Hash() types.Hash
	Valid() bool
}

func Decode

func Decode(b []byte) (T, error)

Jump to

Keyboard shortcuts

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