diff options
author | zsfelfoldi <zsfelfoldi@gmail.com> | 2015-04-07 17:50:17 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-04-20 03:57:49 +0800 |
commit | b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6 (patch) | |
tree | 81d44673f4510e13f85f9aa9d5e0009b6638eacd /common/resolver/resolver_test.go | |
parent | 94489b2269133c545aa3e9580737b2bd93f3ead0 (diff) | |
download | go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar.gz go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar.bz2 go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar.lz go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar.xz go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.tar.zst go-tangerine-b635cad9fe127e6b0ca6d993ce9a3b6c61ce79c6.zip |
NatSpec passing end to end test
Diffstat (limited to 'common/resolver/resolver_test.go')
-rw-r--r-- | common/resolver/resolver_test.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/common/resolver/resolver_test.go b/common/resolver/resolver_test.go index 5652213f6..17a1c4f94 100644 --- a/common/resolver/resolver_test.go +++ b/common/resolver/resolver_test.go @@ -23,12 +23,12 @@ func NewTestBackend() *testBackend { self := &testBackend{} self.contracts = make(map[string](map[string]string)) - self.contracts[NameRegContractAddress] = make(map[string]string) - key := storageAddress(0, common.Hex2Bytes(codehash)) - self.contracts[NameRegContractAddress][key] = hash + self.contracts[HashRegContractAddress] = make(map[string]string) + key := storageAddress(1, common.Hex2Bytes(codehash)) + self.contracts[HashRegContractAddress][key] = hash self.contracts[URLHintContractAddress] = make(map[string]string) - key = storageAddress(0, common.Hex2Bytes(hash)) + key = storageAddress(1, common.Hex2Bytes(hash)) self.contracts[URLHintContractAddress][key] = url return self @@ -43,10 +43,12 @@ func (self *testBackend) StorageAt(ca, sa string) (res string) { return } -func TestNameToContentHash(t *testing.T) { +func TestKeyToContentHash(t *testing.T) { b := NewTestBackend() - res := New(b, URLHintContractAddress, NameRegContractAddress) - got, err := res.NameToContentHash(codehash) + res := New(b, URLHintContractAddress, HashRegContractAddress) + chash := common.Hash{} + copy(chash[:], common.Hex2BytesFixed(codehash, 32)) + got, err := res.KeyToContentHash(chash) if err != nil { t.Errorf("expected no error, got %v", err) } else { @@ -58,7 +60,7 @@ func TestNameToContentHash(t *testing.T) { func TestContentHashToUrl(t *testing.T) { b := NewTestBackend() - res := New(b, URLHintContractAddress, NameRegContractAddress) + res := New(b, URLHintContractAddress, HashRegContractAddress) chash := common.Hash{} copy(chash[:], common.Hex2Bytes(hash)) got, err := res.ContentHashToUrl(chash) @@ -71,5 +73,5 @@ func TestContentHashToUrl(t *testing.T) { } } -func TestNameToUrl(t *testing.T) { +func TestKeyToUrl(t *testing.T) { } |