aboutsummaryrefslogtreecommitdiffstats
path: root/pow/block.go
Commit message (Expand)AuthorAgeFilesLines
* all: fix license headers one more timeFelix Lange2015-07-241-1/+1
* all: update license headers to distiguish GPL/LGPLFelix Lange2015-07-231-4/+4
* all: update license informationFelix Lange2015-07-071-0/+16
* updated vm envobscuren2015-03-171-2/+3
* POW fixesobscuren2015-03-141-1/+0
* Changed nonce to a uint64obscuren2015-03-041-2/+3
* Introducing ethashMatthew Wampler-Doty2015-03-031-2/+10
* Exposing stuff for ethashMatthew Wampler-Doty2015-02-281-0/+2
* Introducign MixDigest and SeedHashMatthew Wampler-Doty2015-02-281-1/+1
* Merge branch 'develop' into minerobscuren2015-02-061-0/+1
* Refactored block & Transactionobscuren2014-12-231-1/+1
* Moved powobscuren2014-12-101-0/+9
truct { GasPrice *math.HexOrDecimal256 `json:"gasPrice"` Nonce math.HexOrDecimal64 `json:"nonce"` To string `json:"to"` Data []string `json:"data"` GasLimit []math.HexOrDecimal64 `json:"gasLimit"` Value []string `json:"value"` PrivateKey hexutil.Bytes `json:"secretKey"` } var enc stTransaction enc.GasPrice = (*math.HexOrDecimal256)(s.GasPrice) enc.Nonce = math.HexOrDecimal64(s.Nonce) enc.To = s.To enc.Data = s.Data if s.GasLimit != nil { enc.GasLimit = make([]math.HexOrDecimal64, len(s.GasLimit)) for k, v := range s.GasLimit { enc.GasLimit[k] = math.HexOrDecimal64(v) } } enc.Value = s.Value enc.PrivateKey = s.PrivateKey return json.Marshal(&enc) } func (s *stTransaction) UnmarshalJSON(input []byte) error { type stTransaction struct { GasPrice *math.HexOrDecimal256 `json:"gasPrice"` Nonce *math.HexOrDecimal64 `json:"nonce"` To *string `json:"to"` Data []string `json:"data"` GasLimit []math.HexOrDecimal64 `json:"gasLimit"` Value []string `json:"value"` PrivateKey hexutil.Bytes `json:"secretKey"` } var dec stTransaction if err := json.Unmarshal(input, &dec); err != nil { return err } if dec.GasPrice != nil { s.GasPrice = (*big.Int)(dec.GasPrice) } if dec.Nonce != nil { s.Nonce = uint64(*dec.Nonce) } if dec.To != nil { s.To = *dec.To } if dec.Data != nil { s.Data = dec.Data } if dec.GasLimit != nil { s.GasLimit = make([]uint64, len(dec.GasLimit)) for k, v := range dec.GasLimit { s.GasLimit[k] = uint64(v) } } if dec.Value != nil { s.Value = dec.Value } if dec.PrivateKey != nil { s.PrivateKey = dec.PrivateKey } return nil }