From 3ac2286c76b4db816104afbeca03416003d20619 Mon Sep 17 00:00:00 2001
From: Xiliang Chen <xlchen1291@gmail.com>
Date: Tue, 25 Feb 2020 15:26:55 +1300
Subject: [PATCH] update hasher (#101)

---
 auction/src/lib.rs | 4 ++--
 oracle/src/lib.rs  | 6 +++---
 tokens/src/lib.rs  | 4 ++--
 vesting/src/lib.rs | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/auction/src/lib.rs b/auction/src/lib.rs
index e9c20c0..5d9dba5 100644
--- a/auction/src/lib.rs
+++ b/auction/src/lib.rs
@@ -37,9 +37,9 @@ type AuctionIdLinkedItem<T> = LinkedItem<<T as Trait>::AuctionId>;
 
 decl_storage! {
 	trait Store for Module<T: Trait> as Auction {
-		pub Auctions get(fn auctions): map hasher(blake2_256) T::AuctionId => Option<AuctionInfo<T::AccountId, T::Balance, T::BlockNumber>>;
+		pub Auctions get(fn auctions): map hasher(twox_64_concat) T::AuctionId => Option<AuctionInfo<T::AccountId, T::Balance, T::BlockNumber>>;
 		pub AuctionsIndex get(fn auctions_index): T::AuctionId;
-		pub AuctionEndTime get(fn auction_end_time): map hasher(blake2_256) (T::BlockNumber, Option<T::AuctionId>) => Option<AuctionIdLinkedItem<T>>;
+		pub AuctionEndTime get(fn auction_end_time): map hasher(twox_64_concat) (T::BlockNumber, Option<T::AuctionId>) => Option<AuctionIdLinkedItem<T>>;
 	}
 }
 
diff --git a/oracle/src/lib.rs b/oracle/src/lib.rs
index f9c9e9e..5308b31 100644
--- a/oracle/src/lib.rs
+++ b/oracle/src/lib.rs
@@ -49,9 +49,9 @@ pub trait Trait: frame_system::Trait {
 
 decl_storage! {
 	trait Store for Module<T: Trait> as Oracle {
-		pub RawValues get(raw_values): double_map hasher(blake2_256) T::OracleKey, hasher(blake2_256) T::AccountId => Option<TimestampedValueOf<T>>;
-		pub HasUpdate get(has_update): map hasher(blake2_256) T::OracleKey => bool;
-		pub Values get(values): map hasher(blake2_256) T::OracleKey => Option<TimestampedValueOf<T>>;
+		pub RawValues get(raw_values): double_map hasher(twox_64_concat) T::OracleKey, hasher(twox_64_concat) T::AccountId => Option<TimestampedValueOf<T>>;
+		pub HasUpdate get(has_update): map hasher(twox_64_concat) T::OracleKey => bool;
+		pub Values get(values): map hasher(twox_64_concat) T::OracleKey => Option<TimestampedValueOf<T>>;
 		HasDispatched: Vec<T::AccountId>;
 	}
 }
diff --git a/tokens/src/lib.rs b/tokens/src/lib.rs
index 88e1478..35d8e53 100644
--- a/tokens/src/lib.rs
+++ b/tokens/src/lib.rs
@@ -57,10 +57,10 @@ decl_storage! {
 				})
 				.into_iter()
 				.collect::<Vec<_>>()
-		}): map hasher(blake2_256) T::CurrencyId => T::Balance;
+		}): map hasher(twox_64_concat) T::CurrencyId => T::Balance;
 
 		/// The balance of a token type under an account.
-		pub Balance get(fn balance): double_map hasher(blake2_256) T::CurrencyId, hasher(blake2_256) T::AccountId => T::Balance;
+		pub Balance get(fn balance): double_map hasher(twox_64_concat) T::CurrencyId, hasher(blake2_128_concat) T::AccountId => T::Balance;
 	}
 	add_extra_genesis {
 		config(endowed_accounts): Vec<(T::AccountId, T::CurrencyId, T::Balance)>;
diff --git a/vesting/src/lib.rs b/vesting/src/lib.rs
index 0a4bc69..c080592 100644
--- a/vesting/src/lib.rs
+++ b/vesting/src/lib.rs
@@ -80,7 +80,7 @@ decl_storage! {
 					(who.clone(), vec![VestingSchedule {start, period, period_count, per_period}])
 				)
 				.collect::<Vec<_>>()
-		}): map hasher(blake2_256) T::AccountId => Vec<VestingScheduleOf<T>>;
+		}): map hasher(blake2_128_concat) T::AccountId => Vec<VestingScheduleOf<T>>;
 	}
 
 	add_extra_genesis {
-- 
GitLab