-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from anoma/tiago/rename-tx-notes-map
Rename notes map to index
- Loading branch information
Showing
27 changed files
with
137 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pub mod chain_state; | ||
pub mod commitment_tree; | ||
pub mod tx_note_map; | ||
pub mod tx_notes_index; | ||
pub mod witness_map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
DROP TABLE notes_map; | ||
DROP TABLE notes_index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
CREATE TABLE notes_map ( | ||
CREATE TABLE notes_index ( | ||
note_position INT PRIMARY KEY, | ||
block_index INT NOT NULL, | ||
is_fee_unshielding BOOLEAN NOT NULL, | ||
block_height INT NOT NULL, | ||
masp_tx_index INT NOT NULL | ||
); | ||
|
||
CREATE INDEX notes_map_block_height_asc ON notes_map (block_height ASC); | ||
CREATE INDEX notes_map_block_height_desc ON notes_map (block_height DESC); | ||
CREATE INDEX notes_index_block_height_asc ON notes_index (block_height ASC); | ||
CREATE INDEX notes_index_block_height_desc ON notes_index (block_height DESC); | ||
|
||
CREATE INDEX notes_map_block_height ON notes_map USING HASH (block_height); | ||
CREATE INDEX notes_index_block_height ON notes_index USING HASH (block_height); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pub mod notes_map; | ||
pub mod notes_index; | ||
pub mod tree; | ||
pub mod txs; | ||
pub mod witness; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
pub mod api; | ||
pub mod namada_state; | ||
pub mod notes_map; | ||
pub mod notes_index; | ||
pub mod tree; | ||
pub mod tx; | ||
pub mod witness_map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod namada_state; | ||
pub mod notes_map; | ||
pub mod notes_index; | ||
pub mod tree; | ||
pub mod tx; | ||
pub mod witness_map; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use axum::extract::{Query, State}; | ||
use axum::Json; | ||
use axum_macros::debug_handler; | ||
use axum_trace_id::TraceId; | ||
use shared::error::InspectWrap; | ||
|
||
use crate::dto::notes_index::NotesIndexQueryParams; | ||
use crate::error::notes_index::NotesIndexError; | ||
use crate::response::notes_index::NotesIndexResponse; | ||
use crate::state::common::CommonState; | ||
|
||
#[debug_handler] | ||
pub async fn get_notes_index( | ||
_trace_id: TraceId<String>, | ||
State(state): State<CommonState>, | ||
Query(query_params): Query<NotesIndexQueryParams>, | ||
) -> Result<Json<NotesIndexResponse>, NotesIndexError> { | ||
let from_block_height = query_params.height; | ||
|
||
let notes_index = state | ||
.notes_index_service | ||
.get_notes_index(from_block_height) | ||
.await | ||
.inspect_wrap("get_notes_index", |err| { | ||
NotesIndexError::Database(err.to_string()) | ||
})?; | ||
|
||
Ok(Json(NotesIndexResponse::new(notes_index))) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
pub mod namada_state; | ||
pub mod notes_map; | ||
pub mod notes_index; | ||
pub mod tree; | ||
pub mod tx; | ||
pub mod witness_map; |
Oops, something went wrong.