fix natspec test

* registar url string retrieval chop leading zeros now
* rewrite test using test mining
* remove temporary applyTxs from xeth
This commit is contained in:
zelig
2015-07-05 19:19:42 +01:00
committed by Jeffrey Wilcke
parent aa22cf323e
commit 1208ac83d5
6 changed files with 99 additions and 81 deletions

View File

@@ -339,22 +339,15 @@ func (self *Registrar) HashToUrl(chash common.Hash) (uri string, err error) {
key := storageAddress(storageFixedArray(mapaddr, storageIdx2Addr(idx)))
hex := self.backend.StorageAt(UrlHintAddr[2:], key)
str = string(common.Hex2Bytes(hex[2:]))
l := len(str)
for (l > 0) && (str[l-1] == 0) {
l--
l := 0
for (l < len(str)) && (str[l] == 0) {
l++
}
str = str[:l]
str = str[l:]
uri = uri + str
idx++
}
l := 0
for (l < len(uri)) && (uri[l] == 0) {
l++
}
uri = uri[l:]
if len(uri) == 0 {
err = fmt.Errorf("GetURLhint: URL hint not found for '%v'", chash.Hex())
}