Skip to content

Commit 4e8f0b1

Browse files
committed
fix a bug
1 parent d9fdee3 commit 4e8f0b1

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

ibc.token/include/ibc.token/ibc.token.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ namespace eosio {
525525

526526
// code,scope(_self,_self.value)
527527
struct [[eosio::table]] hub_trx_info {
528-
uint64_t cash_seq_num; // set by seq_num in cash action
528+
uint64_t id; // set by seq_num in cash action
529529
uint64_t cash_time_slot;
530530
name from_chain;
531531
name from_account;
@@ -542,7 +542,7 @@ namespace eosio {
542542
uint8_t forward_times;
543543
uint8_t backward_times;
544544

545-
uint64_t primary_key()const { return cash_seq_num; }
545+
uint64_t primary_key()const { return id; }
546546
fixed_bytes<32> by_orig_trx_id()const { return fixed_bytes<32>(orig_trx_id.hash); }
547547
fixed_bytes<32> by_hub_trx_id()const { return fixed_bytes<32>(hub_trx_id.hash); }
548548
};

ibc.token/src/ibc.token.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1550,8 +1550,9 @@ namespace eosio {
15501550

15511551
/// record to hub table
15521552
auto _hubtrxs = hubtrxs_table( _self, _self.value );
1553+
auto p_id = _hubtrxs.available_primary_key();
15531554
_hubtrxs.emplace( _self, [&]( auto& r ) {
1554-
r.cash_seq_num = cash_seq_num;
1555+
r.id = p_id; /// can not use cash_seq_num,
15551556
r.cash_time_slot = get_block_time_slot();
15561557
r.from_chain = from_chain;
15571558
r.from_account = from_account;

0 commit comments

Comments
 (0)