Skip to content

Commit daf062f

Browse files
authored
refactor: rename _hash -> _addr (#168)
1 parent 854263e commit daf062f

20 files changed

+66
-66
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
CREATE TABLE IF NOT EXISTS solution_set (
22
id INTEGER PRIMARY KEY,
3-
content_hash BLOB NOT NULL UNIQUE
3+
content_addr BLOB NOT NULL UNIQUE
44
);

crates/node-db-sql/sql/insert/block_solution_set.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ INSERT OR IGNORE INTO
33
VALUES
44
(
55
(SELECT id FROM block WHERE block.block_address = :block_address LIMIT 1),
6-
(SELECT id FROM solution_set WHERE solution_set.content_hash = :solution_set_hash LIMIT 1),
6+
(SELECT id FROM solution_set WHERE solution_set.content_addr = :solution_set_addr LIMIT 1),
77
:solution_set_index
88
);

crates/node-db-sql/sql/insert/failed_block.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ INSERT
33
VALUES
44
(
55
(SELECT id FROM block WHERE block.block_address = :block_address LIMIT 1),
6-
(SELECT id FROM solution_set WHERE solution_set.content_hash = :solution_set_hash LIMIT 1)
6+
(SELECT id FROM solution_set WHERE solution_set.content_addr = :solution_set_addr LIMIT 1)
77
);

crates/node-db-sql/sql/insert/mutation.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ VALUES
1414
solution
1515
JOIN solution_set ON solution_set.id = solution.solution_set_id
1616
WHERE
17-
solution_set.content_hash = :solution_set_hash AND solution.solution_index = :solution_index
17+
solution_set.content_addr = :solution_set_addr AND solution.solution_index = :solution_index
1818
LIMIT
1919
1
2020
), :mutation_index, :key, :value

crates/node-db-sql/sql/insert/pred_data.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ VALUES
1313
solution
1414
JOIN solution_set ON solution_set.id = solution.solution_set_id
1515
WHERE
16-
solution_set.content_hash = :solution_set_hash AND solution.solution_index = :solution_index
16+
solution_set.content_addr = :solution_set_addr AND solution.solution_index = :solution_index
1717
LIMIT
1818
1
1919
), :pred_data_index, :value

crates/node-db-sql/sql/insert/solution.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ VALUES
88
FROM
99
solution_set
1010
WHERE
11-
content_hash = :solution_set_hash
11+
content_addr = :solution_set_addr
1212
LIMIT
1313
1
1414
), :solution_index, :contract_addr, :predicate_addr
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
INSERT
2-
OR IGNORE INTO solution_set (content_hash)
2+
OR IGNORE INTO solution_set (content_addr)
33
VALUES
4-
(:content_hash)
4+
(:content_addr)

crates/node-db-sql/sql/query/get_block.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
SELECT
2-
solution_set.content_hash
2+
solution_set.content_addr
33
FROM
44
block
55
LEFT JOIN block_solution_set ON block.id = block_solution_set.block_id

crates/node-db-sql/sql/query/get_solution.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ FROM
55
solution_set
66
JOIN solution ON solution.solution_set_id = solution_set.id
77
WHERE
8-
solution_set.content_hash = ?
8+
solution_set.content_addr = ?
99
ORDER BY
1010
solution.solution_index ASC;

crates/node-db-sql/sql/query/get_solution_mutations.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ FROM
66
JOIN solution ON solution.solution_set_id = solution_set.id
77
JOIN mutation ON mutation.solution_id = solution.id
88
WHERE
9-
solution_set.content_hash = :content_hash AND solution.solution_index = :solution_index;
9+
solution_set.content_addr = :content_addr AND solution.solution_index = :solution_index;
1010
ORDER BY
1111
mutation.mutation_index ASC

0 commit comments

Comments
 (0)