block/state: gas price for block and tx

This commit is contained in:
Ethan Buchman
2015-03-18 02:12:03 -07:00
committed by Jae Kwon
parent 7a33aba6e5
commit f384d10a05
4 changed files with 30 additions and 15 deletions

View File

@@ -107,12 +107,16 @@ type Header struct {
Height uint
Time time.Time
Fees uint64
GasPrice uint64
NumTxs uint
LastBlockHash []byte
LastBlockParts PartSetHeader
StateHash []byte
}
// possible for actual gas price to be less than 1
var GasPriceDivisor = 1000000
func (h *Header) Hash() []byte {
buf := new(bytes.Buffer)
hasher, n, err := sha256.New(), new(int64), new(error)

View File

@@ -10,14 +10,15 @@ import (
)
var (
ErrTxInvalidAddress = errors.New("Error invalid address")
ErrTxDuplicateAddress = errors.New("Error duplicate address")
ErrTxInvalidAmount = errors.New("Error invalid amount")
ErrTxInsufficientFunds = errors.New("Error insufficient funds")
ErrTxUnknownPubKey = errors.New("Error unknown pubkey")
ErrTxInvalidPubKey = errors.New("Error invalid pubkey")
ErrTxInvalidSignature = errors.New("Error invalid signature")
ErrTxInvalidSequence = errors.New("Error invalid sequence")
ErrTxInvalidAddress = errors.New("Error invalid address")
ErrTxDuplicateAddress = errors.New("Error duplicate address")
ErrTxInvalidAmount = errors.New("Error invalid amount")
ErrTxInsufficientFunds = errors.New("Error insufficient funds")
ErrTxInsufficientGasPrice = errors.New("Error insufficient gas price")
ErrTxUnknownPubKey = errors.New("Error unknown pubkey")
ErrTxInvalidPubKey = errors.New("Error invalid pubkey")
ErrTxInvalidSignature = errors.New("Error invalid signature")
ErrTxInvalidSequence = errors.New("Error invalid sequence")
)
/*