Skip to content
This repository has been archived by the owner on Nov 3, 2024. It is now read-only.

Commit

Permalink
add trx_id to deposits
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisCarriere committed Dec 2, 2023
1 parent 9e04bef commit 563eec6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ $ ./test.sh
- `{name} from` - sender account (EOSN Login ID or EOS account)
- `{asset} quantity` - token quantity
- `{time_point_sec} timestamp` - timestamp
- `{checksum256} trx_id` - transaction ID

### example

Expand All @@ -178,7 +179,8 @@ $ ./test.sh
"id": 1,
"from": "1111234.eosn",
"quantity": "5.0000 USDT",
"timestamp": "2023-12-01T00:00:00"
"timestamp": "2023-12-01T00:00:00",
"trx_id": "33916e02c5fdc40c7c7d08598a606e51bcd93fc0003316fd85a335eedf58d26b"
}
```

Expand Down
2 changes: 2 additions & 0 deletions src/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ void pomelo::cleartable( const name table_name, const optional<name> scope, cons
pomelo::bounties_table _bounties( get_self(), value );
pomelo::tokens_table _tokens( get_self(), value );
pomelo::configs_table _configs( get_self(), value );
pomelo::deposits_table _deposits( get_self(), value );

if (table_name == "bounties"_n) clear_table( _bounties, rows_to_clear );
else if (table_name == "tokens"_n) clear_table( _tokens, rows_to_clear );
else if (table_name == "deposits"_n) clear_table( _deposits, rows_to_clear );
else if (table_name == "configs"_n) _configs.remove();
else check(false, "pomelo::cleartable: [table_name] unknown table to clear" );
}
1 change: 1 addition & 0 deletions src/notifiers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ void pomelo::deposit_bounty( const name bounty_id, const name user_id, const nam
row.from = from;
row.quantity = quantity;
row.timestamp = current_time_point();
row.trx_id = get_trx_id();
});

// deposit log
Expand Down
5 changes: 4 additions & 1 deletion work.pomelo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class [[eosio::contract("work.pomelo")]] pomelo : public eosio::contract {
* - `{name} from` - sender account (EOSN Login ID or EOS account)
* - `{asset} quantity` - token quantity
* - `{time_point_sec} timestamp` - timestamp
* - `{checksum256} trx_id` - transaction ID
*
* ### example
*
Expand All @@ -111,7 +112,8 @@ class [[eosio::contract("work.pomelo")]] pomelo : public eosio::contract {
* "id": 1,
* "from": "1111234.eosn",
* "quantity": "5.0000 USDT",
* "timestamp": "2023-12-01T00:00:00"
* "timestamp": "2023-12-01T00:00:00",
* "trx_id": "33916e02c5fdc40c7c7d08598a606e51bcd93fc0003316fd85a335eedf58d26b"
* }
* ```
*/
Expand All @@ -120,6 +122,7 @@ class [[eosio::contract("work.pomelo")]] pomelo : public eosio::contract {
name from;
asset quantity;
time_point_sec timestamp;
checksum256 trx_id;

uint64_t primary_key() const { return id; }
};
Expand Down

0 comments on commit 563eec6

Please sign in to comment.