Skip to content

Commit bcea93b

Browse files
authored
[db-dump] Use cf name when describe table (#22105)
## Description Otherwise rename derive won't work in the unittest. ## Test plan CI --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
1 parent 272ac19 commit bcea93b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

crates/sui-tool/src/db_tool/db_dump.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ pub fn dump_table(
270270
page_number,
271271
)
272272
} else {
273+
let perpetual_tables = AuthorityPerpetualTables::describe_tables();
274+
assert!(perpetual_tables.contains_key(table_name));
273275
AuthorityPerpetualTables::open_readonly(&db_path).dump(
274276
table_name,
275277
page_size,

crates/typed-store-derive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn derive_dbmap_utils_general(input: TokenStream) -> TokenStream {
237237
/// Returns a list of the tables name and type pairs
238238
pub fn describe_tables() -> std::collections::BTreeMap<String, (String, String)> {
239239
vec![#(
240-
(stringify!(#field_names).to_owned(), (stringify!(#key_names).to_owned(), stringify!(#value_names).to_owned())),
240+
(stringify!(#cf_names).to_owned(), (stringify!(#key_names).to_owned(), stringify!(#value_names).to_owned())),
241241
)*].into_iter().collect()
242242
}
243243
}
@@ -328,7 +328,7 @@ pub fn derive_dbmap_utils_general(input: TokenStream) -> TokenStream {
328328

329329
pub fn describe_tables() -> std::collections::BTreeMap<String, (String, String)> {
330330
vec![#(
331-
(stringify!(#field_names).to_owned(), (stringify!(#key_names).to_owned(), stringify!(#value_names).to_owned())),
331+
(stringify!(#cf_names).to_owned(), (stringify!(#key_names).to_owned(), stringify!(#value_names).to_owned())),
332332
)*].into_iter().collect()
333333
}
334334

0 commit comments

Comments
 (0)