Skip to content

Commit

Permalink
fix a bug
Browse files Browse the repository at this point in the history
  • Loading branch information
justfortest2 committed Jul 22, 2020
1 parent d9fdee3 commit 4e8f0b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ibc.token/include/ibc.token/ibc.token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ namespace eosio {

// code,scope(_self,_self.value)
struct [[eosio::table]] hub_trx_info {
uint64_t cash_seq_num; // set by seq_num in cash action
uint64_t id; // set by seq_num in cash action
uint64_t cash_time_slot;
name from_chain;
name from_account;
Expand All @@ -542,7 +542,7 @@ namespace eosio {
uint8_t forward_times;
uint8_t backward_times;

uint64_t primary_key()const { return cash_seq_num; }
uint64_t primary_key()const { return id; }
fixed_bytes<32> by_orig_trx_id()const { return fixed_bytes<32>(orig_trx_id.hash); }
fixed_bytes<32> by_hub_trx_id()const { return fixed_bytes<32>(hub_trx_id.hash); }
};
Expand Down
3 changes: 2 additions & 1 deletion ibc.token/src/ibc.token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1550,8 +1550,9 @@ namespace eosio {

/// record to hub table
auto _hubtrxs = hubtrxs_table( _self, _self.value );
auto p_id = _hubtrxs.available_primary_key();
_hubtrxs.emplace( _self, [&]( auto& r ) {
r.cash_seq_num = cash_seq_num;
r.id = p_id; /// can not use cash_seq_num,
r.cash_time_slot = get_block_time_slot();
r.from_chain = from_chain;
r.from_account = from_account;
Expand Down

0 comments on commit 4e8f0b1

Please sign in to comment.