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

feat: improvements api #45

Merged
merged 4 commits into from
Oct 31, 2023
Merged

feat: improvements api #45

merged 4 commits into from
Oct 31, 2023

Conversation

rllola
Copy link
Contributor

@rllola rllola commented Oct 30, 2023

closes #37

This PR had the tx_type info to the block answer and add wrapper_id info for decrypted tx.

@rllola rllola requested a review from neithanmo October 30, 2023 18:08
@neithanmo neithanmo mentioned this pull request Oct 30, 2023
@@ -1051,7 +1051,7 @@ impl Database {
/// Returns all the tx hashes for a block
pub async fn get_tx_hashes_block(&self, hash: &[u8]) -> Result<Vec<Row>, Error> {
// query for all tx hash that are in a block identified by the block_id
let str = format!("SELECT t.hash FROM {0}.{BLOCKS_TABLE_NAME} b JOIN {0}.{TX_TABLE_NAME} t ON b.block_id = t.block_id WHERE b.block_id =$1;", self.network);
let str = format!("SELECT t.hash, t.tx_type FROM {0}.{BLOCKS_TABLE_NAME} b JOIN {0}.{TX_TABLE_NAME} t ON b.block_id = t.block_id WHERE b.block_id = $1;", self.network);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rllola I made this change, maybe you have something different in mind, with this change the function returns a row with two columns, the tx_hash, and tx_type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good catch looks like I missed it.

This was referenced Oct 30, 2023
@neithanmo neithanmo merged commit 555d675 into main Oct 31, 2023
5 checks passed
@neithanmo neithanmo deleted the feat/improvements-api branch October 31, 2023 14:39
rllola pushed a commit that referenced this pull request Oct 31, 2023
This:
- fix benches(outdated code)
- improve our testing to ensure a fresh database is used, similar to
benches

to be merged after #45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split the txs into wrapper and inner for txs in a block.
2 participants