ons

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HEIGHT_INTERVAL = 1

Variables

View Source
var (
	ErrDomainNotFound = errors.New("Domain doesn't exist")
)

Functions

This section is empty.

Types

type Domain

type Domain struct {
	// addresses of the owner and the account the domain points to
	OwnerAddress   keys.Address `json:"ownerAddress"`
	AccountAddress keys.Address `json:"accountAddress"`

	// the domain name; this is als a unique identifier of
	// the domain object over the chain
	Name string `json:"name"`

	// block heights at which the domain was first created and updated
	CreationHeight   int64 `json:"creationHeight"`
	LastUpdateHeight int64 `json:"lastUpdateHeight"`

	// flag to denote whether send2Domain is active on this domain
	ActiveFlag bool `json:"activeFlag"`

	// denotes whether the domain is for sale
	OnSaleFlag bool `json:"onSaleFlag"`

	// the asking price in OLT set by the owner
	SalePrice balance.Coin `json:"salePrice"`
}

func NewDomain

func NewDomain(ownerAddress, accountAddress keys.Address,
	name string, height int64) *Domain

func (*Domain) Activate

func (d *Domain) Activate()

func (*Domain) CancelSale

func (d *Domain) CancelSale()

func (*Domain) ChangeOwner

func (d *Domain) ChangeOwner(addr keys.Address)

func (*Domain) Data

func (d *Domain) Data() serialize.Data

func (*Domain) Deactivate

func (d *Domain) Deactivate()

func (*Domain) IsChangeable

func (d *Domain) IsChangeable(currentHeight int64) bool

func (*Domain) NewDataInstance

func (d *Domain) NewDataInstance() serialize.Data

func (*Domain) PutOnSale

func (d *Domain) PutOnSale(price balance.Coin)

func (*Domain) SetAccountAddress

func (d *Domain) SetAccountAddress(addr keys.Address)

func (*Domain) SetData

func (d *Domain) SetData(a interface{}) error

func (*Domain) SetLastUpdatedHeight

func (d *Domain) SetLastUpdatedHeight(height int64)

type DomainStore

type DomainStore struct {
	State *storage.State
	// contains filtered or unexported fields
}

DomainStore wraps the persistent storage and the serializer giving handy methods to access Domain objects

func NewDomainStore

func NewDomainStore(prefix string, state *storage.State) *DomainStore

NewDomainStore creates a new storage object from filepath and other configurations

func (*DomainStore) Exists

func (ds *DomainStore) Exists(name string) bool

func (*DomainStore) Get

func (ds *DomainStore) Get(name string) (*Domain, error)

Get is used to retrieve the domain object from the domain name

func (*DomainStore) Iterate added in v0.12.0

func (ds *DomainStore) Iterate(fn func(name string, domain *Domain) bool) (stopped bool)

func (*DomainStore) Set

func (ds *DomainStore) Set(d *Domain) error

func (*DomainStore) WithState added in v0.12.0

func (ds *DomainStore) WithState(state *storage.State) *DomainStore

Jump to

Keyboard shortcuts

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