forked from forks/go-ethereum
contracts/ens: add todo and decode multicodec stub
This commit is contained in:
parent
b6bdfba46c
commit
c77795f546
2 changed files with 14 additions and 1 deletions
|
|
@ -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>
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue