aboutsummaryrefslogtreecommitdiffstats
path: root/common/registrar
diff options
context:
space:
mode:
authorRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 02:40:27 +0800
committerRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:34:34 +0800
commit436fc8d76a4871d67a61dc86c1a635e20594a0e6 (patch)
tree5fad9f69b068f43ca606e2887f5522188e7f9ddd /common/registrar
parentc20d6e5e4ed8eff6d26cd849f90ca42dd5a7040c (diff)
downloadgo-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.gz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.bz2
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.lz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.xz
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.tar.zst
go-tangerine-436fc8d76a4871d67a61dc86c1a635e20594a0e6.zip
all: Rename crypto.Sha3{,Hash}() to crypto.Keccak256{,Hash}()
As we aren't really using the standarized SHA-3
Diffstat (limited to 'common/registrar')
-rw-r--r--common/registrar/ethreg/api.go2
-rw-r--r--common/registrar/registrar.go4
-rw-r--r--common/registrar/registrar_test.go2
3 files changed, 4 insertions, 4 deletions
diff --git a/common/registrar/ethreg/api.go b/common/registrar/ethreg/api.go
index 1ba422c4d..79a6c2191 100644
--- a/common/registrar/ethreg/api.go
+++ b/common/registrar/ethreg/api.go
@@ -86,7 +86,7 @@ func (api *PrivateRegistarAPI) Register(sender common.Address, addr common.Addre
}
codeb := state.GetCode(addr)
- codeHash := common.BytesToHash(crypto.Sha3(codeb))
+ codeHash := common.BytesToHash(crypto.Keccak256(codeb))
contentHash := common.HexToHash(contentHashHex)
_, err = registrar.New(api.be).SetHashToHash(sender, codeHash, contentHash)
diff --git a/common/registrar/registrar.go b/common/registrar/registrar.go
index 24e45edb3..0606f6985 100644
--- a/common/registrar/registrar.go
+++ b/common/registrar/registrar.go
@@ -68,7 +68,7 @@ const (
)
func abiSignature(s string) string {
- return common.ToHex(crypto.Sha3([]byte(s))[:4])
+ return common.ToHex(crypto.Keccak256([]byte(s))[:4])
}
var (
@@ -401,7 +401,7 @@ func storageMapping(addr, key []byte) []byte {
data := make([]byte, 64)
copy(data[0:32], key[0:32])
copy(data[32:64], addr[0:32])
- sha := crypto.Sha3(data)
+ sha := crypto.Keccak256(data)
return sha
}
diff --git a/common/registrar/registrar_test.go b/common/registrar/registrar_test.go
index 68ee65ab4..b2287803c 100644
--- a/common/registrar/registrar_test.go
+++ b/common/registrar/registrar_test.go
@@ -31,7 +31,7 @@ type testBackend struct {
var (
text = "test"
codehash = common.StringToHash("1234")
- hash = common.BytesToHash(crypto.Sha3([]byte(text)))
+ hash = common.BytesToHash(crypto.Keccak256([]byte(text)))
url = "bzz://bzzhash/my/path/contr.act"
)