From b972dfa0acd1be6e38518564e54bc19f42243201 Mon Sep 17 00:00:00 2001 From: Elad Date: Mon, 25 Mar 2019 11:27:38 +0900 Subject: [PATCH] contracts/ens: revert bmt to keccak256 --- contracts/ens/cid.go | 4 ++-- contracts/ens/cid_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/ens/cid.go b/contracts/ens/cid.go index fae9bfd0a1..0ac4c0cb08 100644 --- a/contracts/ens/cid.go +++ b/contracts/ens/cid.go @@ -31,7 +31,7 @@ const ( nsSwarm = 0xe4 swarmTypecode = 0xfa //swarm manifest, see https://github.com/multiformats/multicodec/blob/master/table.csv - swarmHashtype = 0xd6 // BMT, see https://github.com/multiformats/multicodec/blob/master/table.csv + swarmHashtype = 0x1b // BMT, see https://github.com/multiformats/multicodec/blob/master/table.csv hashLength = 32 ) @@ -106,7 +106,7 @@ func EncodeSwarmHash(hash common.Hash) ([]byte, error) { nsSwarm, //swarm namespace cidv1, // CIDv1 swarmTypecode, // swarm hash - swarmHashtype, // swarm bmt hash + swarmHashtype, // keccak256 hash hashLength, //hash length. 32 bytes } diff --git a/contracts/ens/cid_test.go b/contracts/ens/cid_test.go index f2f1880846..7d0e67851a 100644 --- a/contracts/ens/cid_test.go +++ b/contracts/ens/cid_test.go @@ -76,17 +76,17 @@ func TestManualCidDecode(t *testing.T) { }{ { name: "values correct, should not fail", - headerBytes: []byte{0xe4, 0x01, 0xfa, 0xd6, 0x20}, + headerBytes: []byte{0xe4, 0x01, 0xfa, 0x1b, 0x20}, wantErr: false, }, { name: "cid version wrong, should fail", - headerBytes: []byte{0xe4, 0x00, 0xfa, 0xd6, 0x20}, + headerBytes: []byte{0xe4, 0x00, 0xfa, 0x1b, 0x20}, wantErr: true, }, { name: "hash length wrong, should fail", - headerBytes: []byte{0xe4, 0x01, 0xfa, 0xd6, 0x1f}, + headerBytes: []byte{0xe4, 0x01, 0xfa, 0x1b, 0x1f}, wantErr: true, }, {