Skip to content

Commit fcd3b27

Browse files
Remove dead Diem code from PoS types: resources, constants, and unused crate
Remove standalone dead code: - effects.rs from move-core-types (unused module) - fallible/ crate (unused, no dependents) Remove all 15 Diem financial resource files (account_config/resources/): AccountResource, BalanceResource, ChainIdResource, CurrencyInfoResource, DesignatedDealer, Credential, FreezingBit, KeyRotationCapabilityResource, PreburnResource, PreburnQueueResource, PreburnWithMetadata, AccountRole, RoleId, ParentVASP/ChildVASP, WithdrawCapabilityResource — none are used in production (the PoS executor never reads or writes these types). Remove unused constants (event.rs, partial diem.rs cleanup) and 13 unused getters from account_state.rs. Update proptest code to not depend on removed types. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3dac3c1 commit fcd3b27

31 files changed

+30
-1503
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ members = [
6969
"crates/rpc/rpc-cfx-impl",
7070
"crates/pos/common/bounded-executor",
7171
"crates/pos/common/crash-handler",
72-
"crates/pos/common/fallible",
7372
"crates/pos/common/infallible",
7473
"crates/pos/common/logger",
7574
"crates/pos/common/metrics",
@@ -209,7 +208,6 @@ bounded-executor = { path = "./crates/pos/common/bounded-executor" }
209208
#diem-channel = { path = "./crates/pos/common/channel", package = "channel" }
210209
channel = { path = "./crates/pos/common/channel" }
211210
crash-handler = { path = "./crates/pos/common/crash-handler" }
212-
fallible = { path = "./crates/pos/common/fallible" }
213211
diem-infallible = { path = "./crates/pos/common/infallible" }
214212
diem-logger = { path = "./crates/pos/common/logger" }
215213
diem-metrics = { path = "./crates/pos/common/metrics" }

crates/pos/common/fallible/Cargo.toml

Lines changed: 0 additions & 13 deletions
This file was deleted.

crates/pos/common/fallible/src/copy_from_slice.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

crates/pos/common/fallible/src/lib.rs

Lines changed: 0 additions & 8 deletions
This file was deleted.

crates/pos/storage/pos-ledger-db/src/diemdb_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use diem_temppath::TempPath;
1818
#[allow(unused_imports)]
1919
use diem_types::{
2020
account_address::{AccountAddress, HashAccountAddress},
21-
account_config::AccountResource,
2221
contract_event::ContractEvent,
2322
event::EventKey,
2423
ledger_info::LedgerInfo,

crates/pos/types/move-core-types/src/effects.rs

Lines changed: 0 additions & 250 deletions
This file was deleted.

crates/pos/types/move-core-types/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
//! Core types for Move.
99
1010
pub mod account_address;
11-
pub mod effects;
1211
pub mod gas_schedule;
1312
pub mod identifier;
1413
pub mod language_storage;

crates/pos/types/types/src/account_config/constants/diem.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,8 @@
55
// Conflux is free software and distributed under GNU General Public License.
66
// See http://www.gnu.org/licenses/
77

8-
use crate::account_config::constants::CORE_CODE_ADDRESS;
98
use anyhow::{bail, Result};
10-
use move_core_types::{
11-
identifier::Identifier,
12-
language_storage::{ModuleId, StructTag, TypeTag},
13-
};
14-
use once_cell::sync::Lazy;
15-
16-
pub const DIEM_MODULE_NAME: &str = "Diem";
17-
static COIN_MODULE_NAME: Lazy<Identifier> =
18-
Lazy::new(|| Identifier::new("Diem").unwrap());
19-
pub static COIN_MODULE: Lazy<ModuleId> =
20-
Lazy::new(|| ModuleId::new(CORE_CODE_ADDRESS, COIN_MODULE_NAME.clone()));
21-
22-
// TODO: This imposes a few implied restrictions:
23-
// 1) The currency module must be published under the core code address.
24-
// 2) The module name must be the same as the gas specifier.
25-
// 3) The struct name must be the same as the module name
26-
// We need to consider whether we want to switch to a more or fully qualified
27-
// name.
28-
pub fn type_tag_for_currency_code(currency_code: Identifier) -> TypeTag {
29-
TypeTag::Struct(StructTag {
30-
address: CORE_CODE_ADDRESS,
31-
module: currency_code.clone(),
32-
name: currency_code,
33-
type_params: vec![],
34-
})
35-
}
9+
use move_core_types::identifier::Identifier;
3610

3711
/// In addition to the constraints for valid Move identifiers, currency codes
3812
/// should consist entirely of uppercase alphanumeric characters (e.g., no

0 commit comments

Comments
 (0)