@@ -599,11 +599,10 @@ void elasticsearch_plugin_impl::upsert_account(
599
599
void elasticsearch_plugin_impl::_process_applied_transaction ( chain::transaction_trace_ptr t ) {
600
600
601
601
std::unordered_map<uint64_t , std::pair<std::string, fc::mutable_variant_object>> account_upsert_actions;
602
- std::vector<std::pair< uint64_t , std:: reference_wrapper<chain::base_action_trace> >> base_action_traces; // without inline action traces
602
+ std::vector<std::reference_wrapper<chain::base_action_trace>> base_action_traces; // without inline action traces
603
603
604
604
bool executed = t->receipt .valid () && t->receipt ->status == chain::transaction_receipt_header::executed;
605
605
606
- uint64_t action_count = 0 ;
607
606
std::stack<std::reference_wrapper<chain::action_trace>> stack;
608
607
for ( auto & atrace : t->action_traces ) {
609
608
stack.emplace (atrace);
@@ -619,9 +618,8 @@ void elasticsearch_plugin_impl::_process_applied_transaction( chain::transaction
619
618
620
619
if ( start_block_reached && store_action_traces
621
620
&& filter_include ( atrace.receipt .receiver , atrace.act .name , atrace.act .authorization ) ) {
622
- base_action_traces.emplace_back (std::make_pair (action_count, std::ref ( atrace)) );
621
+ base_action_traces.emplace_back ( atrace );
623
622
}
624
- action_count++;
625
623
626
624
auto &inline_traces = atrace.inline_traces ;
627
625
for ( auto it = inline_traces.rbegin (); it != inline_traces.rend (); ++it ) {
@@ -686,9 +684,9 @@ void elasticsearch_plugin_impl::_process_applied_transaction( chain::transaction
686
684
auto now = std::chrono::duration_cast<std::chrono::milliseconds>(
687
685
std::chrono::microseconds{fc::time_point::now ().time_since_epoch ().count ()});
688
686
689
- for (auto & p : base_action_traces) {
687
+ for (auto & atrace : base_action_traces) {
690
688
fc::mutable_variant_object action_traces_doc;
691
- chain::base_action_trace &base = p. second .get ();
689
+ chain::base_action_trace &base = atrace .get ();
692
690
fc::from_variant ( abi_deserializer->to_variant_with_abi ( base ), action_traces_doc );
693
691
694
692
fc::mutable_variant_object act_doc;
@@ -698,12 +696,10 @@ void elasticsearch_plugin_impl::_process_applied_transaction( chain::transaction
698
696
action_traces_doc[" act" ] = act_doc;
699
697
action_traces_doc (" createAt" , now.count ());
700
698
701
- auto id = boost::str (boost::format (" %1%-%2%" ) % trx_id_str % p.first );
702
-
703
699
fc::mutable_variant_object action_doc;
704
700
action_doc (" _index" , action_traces_index);
705
701
action_doc (" _type" , " _doc" );
706
- action_doc (" _id" , id );
702
+ action_doc (" _id" , action_traces_doc[ " receipt " ][ " global_sequence " ] );
707
703
action_doc (" retry_on_conflict" , 100 );
708
704
709
705
auto action = fc::json::to_string ( fc::variant_object (" index" , action_doc) );
0 commit comments