[EOSIO/eos] wallet_api interface & soft_wallet refactor (#3784)

spoonincode commented on this pull request.

> @@ -90,6 +92,7 @@ namespace eosio { namespace chain {
vector context_free_data; ///< for each context-free action, there is an entry here const signature_type& sign(const private_key_type& key, const chain_id_type& chain_id); + const signature_type& sign(sign_digest_functor signature_request, const chain_id_type& chain_id); This can be done but it removes a fair bit of encapsulation of signed_transaction IMO 1) signed_transaction::sign knows that to compute the digest for signing it must take in to account the context_free_data of the signed_transaction 2) signed_transaction::sign will modify its signatures granted _in both cases these are public members_. So maybe should not worry about it. The resulting code would look something like ``` signed_transaction stx; chain_id_type cid; digest_type dst = sig_digest(cid, stx.context_free_data); stx.signatures.push_back(priv_key.sign(dst)); ```

Добавить комментарий