Skip to content

Commit

Permalink
Rename utxo_by_outpoint to utxo_by_out_loc in finalized state
Browse files Browse the repository at this point in the history
  • Loading branch information
upbqdn committed Jun 17, 2022
1 parent 9edfb33 commit 8bd8457
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 9 deletions.
3 changes: 1 addition & 2 deletions zebra-state/src/service/finalized_state/disk_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ impl DiskDb {
rocksdb::ColumnFamilyDescriptor::new("balance_by_transparent_addr", db_options.clone()),
// TODO: #3951
//rocksdb::ColumnFamilyDescriptor::new("tx_by_transparent_addr_loc", db_options.clone()),
// TODO: rename to utxo_by_out_loc (#3952)
rocksdb::ColumnFamilyDescriptor::new("utxo_by_outpoint", db_options.clone()),
rocksdb::ColumnFamilyDescriptor::new("utxo_by_out_loc", db_options.clone()),
rocksdb::ColumnFamilyDescriptor::new(
"utxo_loc_by_transparent_addr_loc",
db_options.clone(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ expression: cf_names
"tx_by_loc",
"tx_loc_by_hash",
"tx_loc_by_transparent_addr_loc",
"utxo_by_outpoint",
"utxo_by_out_loc",
"utxo_loc_by_transparent_addr_loc",
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 154
expression: empty_column_families
---
[
Expand All @@ -13,6 +14,6 @@ expression: empty_column_families
"sprout_nullifiers: no entries",
"tip_chain_value_pool: no entries",
"tx_loc_by_transparent_addr_loc: no entries",
"utxo_by_outpoint: no entries",
"utxo_by_out_loc: no entries",
"utxo_loc_by_transparent_addr_loc: no entries",
]
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ expression: empty_column_families
"tx_by_loc: no entries",
"tx_loc_by_hash: no entries",
"tx_loc_by_transparent_addr_loc: no entries",
"utxo_by_outpoint: no entries",
"utxo_by_out_loc: no entries",
"utxo_loc_by_transparent_addr_loc: no entries",
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 154
expression: empty_column_families
---
[
Expand All @@ -13,6 +14,6 @@ expression: empty_column_families
"sprout_nullifiers: no entries",
"tip_chain_value_pool: no entries",
"tx_loc_by_transparent_addr_loc: no entries",
"utxo_by_outpoint: no entries",
"utxo_by_out_loc: no entries",
"utxo_loc_by_transparent_addr_loc: no entries",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 144
expression: cf_data
---
[
KV(
k: "0000010000000000",
v: "50c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "0000010000000001",
v: "d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 144
expression: cf_data
---
[
KV(
k: "0000010000000000",
v: "50c30000000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "0000010000000001",
v: "d43000000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
KV(
k: "0000020000000000",
v: "a0860100000000002321027a46eb513588b01b37ea24303f4b628afd12cc20df789fede0921e43cad3e875ac",
),
KV(
k: "0000020000000001",
v: "a86100000000000017a9147d46a730d31f97b1930d3368a967c309bd4d136a87",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 144
expression: cf_data
---
[
KV(
k: "0000010000000000",
v: "50c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
),
KV(
k: "0000010000000001",
v: "d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
source: zebra-state/src/service/finalized_state/disk_format/tests/snapshot.rs
assertion_line: 144
expression: cf_data
---
[
KV(
k: "0000010000000000",
v: "50c30000000000002321025229e1240a21004cf8338db05679fa34753706e84f6aebba086ba04317fd8f99ac",
),
KV(
k: "0000010000000001",
v: "d43000000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
KV(
k: "0000020000000000",
v: "a086010000000000232102acce9f6c16986c525fd34759d851ef5b4b85b5019a57bd59747be0ef1ba62523ac",
),
KV(
k: "0000020000000001",
v: "a86100000000000017a914ef775f1f997f122a062fff1a2d7443abd1f9c64287",
),
]
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl ZebraDb {
&self,
output_location: OutputLocation,
) -> Option<transparent::OrderedUtxo> {
let utxo_by_out_loc = self.db.cf_handle("utxo_by_outpoint").unwrap();
let utxo_by_out_loc = self.db.cf_handle("utxo_by_out_loc").unwrap();

let output = self.db.zs_get(&utxo_by_out_loc, &output_location)?;

Expand Down Expand Up @@ -421,7 +421,7 @@ impl DiskWriteBatch {
new_outputs_by_out_loc: &BTreeMap<OutputLocation, transparent::Utxo>,
address_balances: &mut HashMap<transparent::Address, AddressBalanceLocation>,
) -> Result<(), BoxError> {
let utxo_by_out_loc = db.cf_handle("utxo_by_outpoint").unwrap();
let utxo_by_out_loc = db.cf_handle("utxo_by_out_loc").unwrap();
let utxo_loc_by_transparent_addr_loc =
db.cf_handle("utxo_loc_by_transparent_addr_loc").unwrap();
let tx_loc_by_transparent_addr_loc =
Expand Down Expand Up @@ -496,7 +496,7 @@ impl DiskWriteBatch {
spent_utxos_by_out_loc: &BTreeMap<OutputLocation, transparent::Utxo>,
address_balances: &mut HashMap<transparent::Address, AddressBalanceLocation>,
) -> Result<(), BoxError> {
let utxo_by_out_loc = db.cf_handle("utxo_by_outpoint").unwrap();
let utxo_by_out_loc = db.cf_handle("utxo_by_out_loc").unwrap();
let utxo_loc_by_transparent_addr_loc =
db.cf_handle("utxo_loc_by_transparent_addr_loc").unwrap();

Expand Down

0 comments on commit 8bd8457

Please sign in to comment.