@@ -236,7 +236,7 @@ enum struct command_te {
236
236
null = 0 ,
237
237
about,
238
238
version,
239
- sign_hex ,
239
+ sign_trx ,
240
240
sign_hash,
241
241
// create,
242
242
select_key,
@@ -328,14 +328,13 @@ struct keychain_command<command_te::select_key>: keychain_command_base
328
328
};
329
329
330
330
template <>
331
- struct keychain_command <command_te::sign_hex > : keychain_command_base
331
+ struct keychain_command <command_te::sign_trx > : keychain_command_base
332
332
{
333
- keychain_command ():keychain_command_base(command_te::sign_hex ) {}
333
+ keychain_command ():keychain_command_base(command_te::sign_trx ) {}
334
334
virtual ~keychain_command (){}
335
335
struct params
336
336
{
337
337
params ():unlock_time(0 ){};
338
- std::string chainid;
339
338
std::string transaction;
340
339
blockchain_te blockchain_type;
341
340
dev::Public public_key;
@@ -354,15 +353,11 @@ struct keychain_command<command_te::sign_hex> : keychain_command_base
354
353
355
354
unit_list_t unit_list;
356
355
dev::Signature signature;
357
- std::vector<unsigned char > chain (32 );
358
356
std::vector<unsigned char > raw (params.transaction .length ());
359
357
fc_light::variant json;
360
358
dev::Secret private_key;
361
359
auto & keyfiles = keyfile_singleton::instance ();
362
360
363
- if (!params.chainid .empty ())
364
- auto chain_len = keychain_app::from_hex (params.chainid , chain.data (), chain.size ());
365
-
366
361
// NOTE: using vector instead array because move semantic is implemented in the vector
367
362
auto trans_len = keychain_app::from_hex (params.transaction , raw.data (), raw.size ());
368
363
raw.resize (trans_len);
@@ -410,7 +405,7 @@ struct keychain_command<command_te::sign_hex> : keychain_command_base
410
405
411
406
auto reply = [&keyfiles, ¶ms, &id](auto & message, const dev::bytes& transaction){
412
407
keyfiles.add_log_record (params.public_key ,
413
- keyfile_format::log_record (transaction, fc_light::time_point::now (), params.blockchain_type , params. chainid ));
408
+ keyfile_format::log_record (transaction, fc_light::time_point::now (), params.blockchain_type ));
414
409
json_response response (fc_light::variant (message), id);
415
410
fc_light::variant res (response);
416
411
return fc_light::json::to_string (res);
@@ -420,8 +415,6 @@ struct keychain_command<command_te::sign_hex> : keychain_command_base
420
415
{
421
416
case blockchain_te::bitshares:
422
417
{
423
- if (chain.size ())
424
- unit_list.push_back (chain);
425
418
unit_list.push_back (raw);
426
419
427
420
std::array<unsigned char , 65 > signature_;
@@ -432,8 +425,6 @@ struct keychain_command<command_te::sign_hex> : keychain_command_base
432
425
}
433
426
case blockchain_te::array:
434
427
{
435
- if (chain.size ())
436
- unit_list.push_back (chain);
437
428
unit_list.push_back (raw);
438
429
439
430
signature = dev::sign (private_key,dev::FixedHash<32 >(((byte const *) get_hash (unit_list, dev::openssl::sha3_256_encoder ()).data ()),
@@ -659,7 +650,7 @@ struct keychain_command<command_te::sign_hash> : keychain_command_base
659
650
dev::bytes hash_vec;
660
651
std::copy (params.hash .begin (), params.hash .end (), std::back_inserter (hash_vec));
661
652
keyfiles.add_log_record (params.public_key ,
662
- keyfile_format::log_record (hash_vec, fc_light::time_point::now (), blockchain_te::rawhash, " " ));
653
+ keyfile_format::log_record (hash_vec, fc_light::time_point::now (), blockchain_te::rawhash));
663
654
json_response response (fc_light::variant (signature), id);
664
655
fc_light::variant res (response);
665
656
return fc_light::json::to_string (res);
@@ -899,7 +890,7 @@ FC_LIGHT_REFLECT_ENUM(
899
890
(null)
900
891
(about)
901
892
(version)
902
- (sign_hex )
893
+ (sign_trx )
903
894
(sign_hash)
904
895
// (create)
905
896
(select_key)
@@ -915,7 +906,7 @@ FC_LIGHT_REFLECT_ENUM(
915
906
(last)
916
907
)
917
908
918
- FC_LIGHT_REFLECT(keychain_app::keychain_command<keychain_app::command_te::sign_hex >::params_t , (chainid) (transaction)(blockchain_type)(public_key)(unlock_time))
909
+ FC_LIGHT_REFLECT(keychain_app::keychain_command<keychain_app::command_te::sign_trx >::params_t , (transaction)(blockchain_type)(public_key)(unlock_time))
919
910
FC_LIGHT_REFLECT(keychain_app::keychain_command<keychain_app::command_te::sign_hash>::params_t , (hash)(sign_type)(public_key))
920
911
// FC_LIGHT_REFLECT(keychain_app::keychain_command<keychain_app::command_te::create>::params_t, (keyname)(description)(encrypted)(cipher)(curve))
921
912
FC_LIGHT_REFLECT(keychain_app::keychain_command<keychain_app::command_te::public_key>::params_t , (keyname))
0 commit comments