Skip to content
This repository has been archived by the owner on Apr 27, 2021. It is now read-only.

fix the identity hasher bug when get storage #4

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def generate_storage_key(module_name, storage_name, params = nil, hasher = nil,

param_key = param.hex_to_bytes
param_hasher = "Twox128" if param_hasher.nil?
storage_key += Crypto.send param_hasher.underscore, param_key
if param_hasher.to_s.underscore == "identity"
storage_key += param
else
storage_key += Crypto.send param_hasher.underscore, param_key
end
end

"0x#{storage_key}"
Expand Down