Changed sha3 to official one

This commit is contained in:
obscuren 2014-07-12 11:10:47 +02:00
parent 9010857677
commit 54715586ab
2 changed files with 4 additions and 3 deletions

View File

@ -690,14 +690,15 @@ func (vm *Vm) RunClosure(closure *Closure) (ret []byte, err error) {
contract.AddAmount(value) contract.AddAmount(value)
// Set the init script // Set the init script
contract.initScript = mem.Get(offset.Int64(), size.Int64()) initCode := mem.Get(offset.Int64(), size.Int64())
//fmt.Printf("%x\n", initCode)
// Transfer all remaining gas to the new // Transfer all remaining gas to the new
// contract so it may run the init script // contract so it may run the init script
gas := new(big.Int).Set(closure.Gas) gas := new(big.Int).Set(closure.Gas)
closure.UseGas(closure.Gas) closure.UseGas(closure.Gas)
// Create the closure // Create the closure
c := NewClosure(closure, contract, contract.initScript, vm.state, gas, closure.Price) c := NewClosure(closure, contract, initCode, vm.state, gas, closure.Price)
// Call the closure and set the return value as // Call the closure and set the return value as
// main script. // main script.
contract.script, err = Call(vm, c, nil) contract.script, err = Call(vm, c, nil)

View File

@ -2,9 +2,9 @@ package ethcrypto
import ( import (
"code.google.com/p/go.crypto/ripemd160" "code.google.com/p/go.crypto/ripemd160"
"code.google.com/p/go.crypto/sha3"
"crypto/sha256" "crypto/sha256"
"github.com/ethereum/eth-go/ethutil" "github.com/ethereum/eth-go/ethutil"
"github.com/obscuren/sha3"
) )
func Sha256Bin(data []byte) []byte { func Sha256Bin(data []byte) []byte {