models

package
v0.0.0-...-d65e639 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDBConnection

func GetDBConnection(setting common.GalileoSetting) *gorm.DB

func Migrate

func Migrate(db *gorm.DB)

Types

type Address

type Address struct {
	gorm.Model
	Address string `gorm:"type:varchar(50);unique_index:address"`
	Type    AddressType
}

func NewAddress

func NewAddress(address string) *Address

func (*Address) AddressType

func (a *Address) AddressType() string

func (*Address) GetAddressDetails

func (a *Address) GetAddressDetails(db *gorm.DB)

func (*Address) IsValid

func (a *Address) IsValid() bool

func (*Address) MarshalJSON

func (a *Address) MarshalJSON() ([]byte, error)

func (*Address) Save

func (a *Address) Save(db *gorm.DB)

type AddressType

type AddressType uint8
const (
	NormalAddress   AddressType = 1
	ContractAddress AddressType = 2
)

type Block

type Block struct {
	gorm.Model
	Hash            common.Hash `gorm:"unique_index:hash_block"`
	ParentHash      common.Hash
	Miner           common.Address
	TransactionRoot common.Hash
	Difficulty      uint
	Number          uint
	GasLimit        uint
	GasUsed         uint
	Timestamp       time.Time
	ExtraData       string
	Nonce           uint
}

type Transaction

type Transaction struct {
}

Jump to

Keyboard shortcuts

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