Skip to content

Commit ac0abff

Browse files
committed
use new multiple arg hash()
1 parent 4d10cf2 commit ac0abff

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

libraries/chain/include/eosio/chain/action.hpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -96,20 +96,9 @@ namespace eosio { namespace chain {
9696
};
9797

9898
inline digest_type generate_action_digest(const action& act, const vector<char>& action_output) {
99-
std::array<digest_type,2> hashes;
10099
const action_base& base = act;
101-
102-
fc::sha256::encoder enc;
103-
fc::raw::pack(enc, base);
104-
hashes[0] = enc.result();
105-
106-
enc.reset();
107-
fc::raw::pack(enc, act.data, action_output);
108-
hashes[1] = enc.result();
109-
110-
enc.reset();
111-
fc::raw::pack(enc, hashes);
112-
return enc.result();
100+
const std::array<digest_type,2> hashes = {fc::sha256::hash(base), fc::sha256::hash(act.data, action_output)};
101+
return fc::sha256::hash(hashes);
113102
}
114103

115104
} } /// namespace eosio::chain

0 commit comments

Comments
 (0)