diff options
author | obscuren <geffobscura@gmail.com> | 2014-10-08 18:06:39 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-10-08 18:06:39 +0800 |
commit | 9d86a49a7327199c01977f3372c8adf748252c32 (patch) | |
tree | a07141b5910df83e6284713149f9173c31ce247b /ethchain | |
parent | f3196c915a6f8ddde1d2e178ad419a114b608b91 (diff) | |
download | go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.gz go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.tar.zst go-tangerine-9d86a49a7327199c01977f3372c8adf748252c32.zip |
Renamed Sha3Bin to Sha3
Diffstat (limited to 'ethchain')
-rw-r--r-- | ethchain/block.go | 8 | ||||
-rw-r--r-- | ethchain/dagger.go | 2 | ||||
-rw-r--r-- | ethchain/genesis.go | 6 | ||||
-rw-r--r-- | ethchain/transaction.go | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 5e8aca33a..d6ff5ef7e 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -144,12 +144,12 @@ func CreateBlock(root interface{}, // Returns a hash of the block func (block *Block) Hash() ethutil.Bytes { - return ethcrypto.Sha3Bin(ethutil.NewValue(block.header()).Encode()) - //return ethcrypto.Sha3Bin(block.Value().Encode()) + return ethcrypto.Sha3(ethutil.NewValue(block.header()).Encode()) + //return ethcrypto.Sha3(block.Value().Encode()) } func (block *Block) HashNoNonce() []byte { - return ethcrypto.Sha3Bin(ethutil.Encode([]interface{}{block.PrevHash, + return ethcrypto.Sha3(ethutil.Encode([]interface{}{block.PrevHash, block.UncleSha, block.Coinbase, block.state.Trie.Root, block.TxSha, block.Difficulty, block.Number, block.MinGasPrice, block.GasLimit, block.GasUsed, block.Time, block.Extra})) @@ -237,7 +237,7 @@ func (block *Block) SetUncles(uncles []*Block) { block.Uncles = uncles // Sha of the concatenated uncles - block.UncleSha = ethcrypto.Sha3Bin(ethutil.Encode(block.rlpUncles())) + block.UncleSha = ethcrypto.Sha3(ethutil.Encode(block.rlpUncles())) } func (self *Block) SetReceipts(receipts []*Receipt, txs []*Transaction) { diff --git a/ethchain/dagger.go b/ethchain/dagger.go index 478b7e877..916d7e9c8 100644 --- a/ethchain/dagger.go +++ b/ethchain/dagger.go @@ -61,7 +61,7 @@ func (pow *EasyPow) Search(block *Block, reactChan chan ethreact.Event) []byte { t = time.Now() } - sha := ethcrypto.Sha3Bin(big.NewInt(r.Int63()).Bytes()) + sha := ethcrypto.Sha3(big.NewInt(r.Int63()).Bytes()) if pow.Verify(hash, diff, sha) { return sha } diff --git a/ethchain/genesis.go b/ethchain/genesis.go index 8a1219acb..3edbf32de 100644 --- a/ethchain/genesis.go +++ b/ethchain/genesis.go @@ -13,13 +13,13 @@ import ( var ZeroHash256 = make([]byte, 32) var ZeroHash160 = make([]byte, 20) -var EmptyShaList = ethcrypto.Sha3Bin(ethutil.Encode([]interface{}{})) +var EmptyShaList = ethcrypto.Sha3(ethutil.Encode([]interface{}{})) var GenesisHeader = []interface{}{ // Previous hash (none) ZeroHash256, // Sha of uncles - ethcrypto.Sha3Bin(ethutil.Encode([]interface{}{})), + ethcrypto.Sha3(ethutil.Encode([]interface{}{})), // Coinbase ZeroHash160, // Root state @@ -42,7 +42,7 @@ var GenesisHeader = []interface{}{ // Extra nil, // Nonce - ethcrypto.Sha3Bin(big.NewInt(42).Bytes()), + ethcrypto.Sha3(big.NewInt(42).Bytes()), } var Genesis = []interface{}{GenesisHeader, []interface{}{}, []interface{}{}} diff --git a/ethchain/transaction.go b/ethchain/transaction.go index ae77ee58d..fe11be3bb 100644 --- a/ethchain/transaction.go +++ b/ethchain/transaction.go @@ -66,7 +66,7 @@ func (self *Transaction) TotalValue() *big.Int { func (tx *Transaction) Hash() []byte { data := []interface{}{tx.Nonce, tx.GasPrice, tx.Gas, tx.Recipient, tx.Value, tx.Data} - return ethcrypto.Sha3Bin(ethutil.NewValue(data).Encode()) + return ethcrypto.Sha3(ethutil.NewValue(data).Encode()) } func (tx *Transaction) CreatesContract() bool { @@ -80,9 +80,9 @@ func (tx *Transaction) IsContract() bool { func (tx *Transaction) CreationAddress(state *ethstate.State) []byte { // Generate a new address - addr := ethcrypto.Sha3Bin(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:] + addr := ethcrypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce}).Encode())[12:] //for i := uint64(0); state.GetStateObject(addr) != nil; i++ { - // addr = ethcrypto.Sha3Bin(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:] + // addr = ethcrypto.Sha3(ethutil.NewValue([]interface{}{tx.Sender(), tx.Nonce + i}).Encode())[12:] //} return addr @@ -120,7 +120,7 @@ func (tx *Transaction) Sender() []byte { return nil } - return ethcrypto.Sha3Bin(pubkey[1:])[12:] + return ethcrypto.Sha3(pubkey[1:])[12:] } func (tx *Transaction) Sign(privk []byte) error { |