1
0
Fork 0
forked from forks/go-ethereum

contracts/ens: add todo and decode multicodec stub

This commit is contained in:
Elad Nachmias 2019-02-20 21:32:01 +07:00
parent b6bdfba46c
commit c77795f546
2 changed files with 14 additions and 1 deletions

View file

@ -260,3 +260,16 @@ func (ens *ENS) SetContentHash(name string, hash []byte) (*types.Transaction, er
// END DEPRECATED CODE
return resolver.Contract.SetContenthash(&opts, node, hash)
}
func decodeMultiCodec(b []byte) (common.Hash, error) {
/* from the EIP documentation
storage system: Swarm (0xe4)
CID version: 1 (0x01)
content type: swarm-manifest (0x??)
hash function: keccak-256 (0x1B)
hash length: 32 bytes (0x20)
hash: 29f2d17be6139079dc48696d1f582a8530eb9805b561eda517e22a892c7e3f1f
*/
//<protoCode uvarint><cid-version><multicodec-content-type><multihash-content-address>
}

View file

@ -118,5 +118,5 @@ func TestENS(t *testing.T) {
if vhost != fallbackHash {
t.Fatalf("resolve error, expected %v, got %v", hash.Hex(), vhost.Hex())
}
t.Fatal("todo: try to set old contract with new multicodec stuff and assert fail, set new contract with multicodec stuff, encode, decode and assert returns correct hash")
}