Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason committed Oct 8, 2023
1 parent 1516853 commit ec70653
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 105 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ library MetadataType {
uint64 tx_num_limit;
uint64 max_tx_size;
uint64 gas_limit;
uint64 gas_price;
uint64 interval;
}

Expand Down
1 change: 1 addition & 0 deletions core/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ common-crypto = { path = "../../common/crypto" }
core-rpc-client = { path = "../rpc-client" }
core-storage = { path = "../storage" }
criterion = "0.5"
env_logger = "0.10"
ethabi = "18.0"
ethabi-contract = { git = "https://github.com/rust-ethereum/ethabi.git", rev = "7edf185" }
ethabi-derive = { git = "https://github.com/rust-ethereum/ethabi.git", rev = "7edf185" }
Expand Down
75 changes: 0 additions & 75 deletions core/executor/src/precompiles/metadata.rs

This file was deleted.

1 change: 0 additions & 1 deletion core/executor/src/precompiles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod ecrecover;
mod get_cell;
mod get_header;
mod identity;
mod metadata;
mod modexp;
mod ripemd160;
mod rsa;
Expand Down
10 changes: 0 additions & 10 deletions core/executor/src/system_contract/metadata/abi/metadata_abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@
"name": "gas_limit",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "gas_price",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "interval",
Expand Down Expand Up @@ -221,11 +216,6 @@
"name": "gas_limit",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "gas_price",
"type": "uint64"
},
{
"internalType": "uint64",
"name": "interval",
Expand Down
23 changes: 11 additions & 12 deletions core/executor/src/system_contract/metadata/abi/metadata_abi.rs

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions core/executor/src/system_contract/metadata/abi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ impl From<ConsensusConfig> for metadata_abi::ConsensusConfig {
tx_num_limit: value.tx_num_limit,
max_tx_size: value.max_tx_size,
gas_limit: value.gas_limit,
gas_price: value.gas_price,
interval: value.interval,
}
}
Expand All @@ -58,7 +57,6 @@ impl From<metadata_abi::ConsensusConfig> for ConsensusConfig {
tx_num_limit: value.tx_num_limit,
max_tx_size: value.max_tx_size,
gas_limit: value.gas_limit,
gas_price: value.gas_price,
interval: value.interval,
}
}
Expand Down
3 changes: 2 additions & 1 deletion core/executor/src/tests/system_script/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static ROCKSDB_PATH: &str = "./free-space/system-contract/metadata";

#[test]
fn test_write_functions() {
env_logger::init();
let vicinity = gen_vicinity();
let mut backend = MemoryBackend::new(&vicinity, BTreeMap::new());

Expand All @@ -47,6 +48,7 @@ fn test_init<'a>(backend: &mut MemoryBackend<'a>, executor: &MetadataContract<Me
let addr = H160::from_str("0xf000000000000000000000000000000000000000").unwrap();
let tx = prepare_tx_1(&addr);
let r = executor.exec_(backend, &tx);
println!("{:?}", r);
assert!(r.exit_reason.is_succeed());
}

Expand Down Expand Up @@ -185,7 +187,6 @@ fn prepare_metadata() -> Metadata {
propose_counter: vec![],
consensus_config: ConsensusConfig {
gas_limit: 1u64,
gas_price: 0u64,
interval: 0u64,
propose_ratio: 1u64,
prevote_ratio: 1u64,
Expand Down
1 change: 0 additions & 1 deletion protocol/src/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ mod tests {
}],
consensus_config: ConsensusConfig {
gas_limit: 4294967295,
gas_price: 1,
interval: 3000,
propose_ratio: 15,
prevote_ratio: 10,
Expand Down
2 changes: 0 additions & 2 deletions protocol/src/types/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ pub struct ConsensusConfig {
#[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))]
pub gas_limit: u64,
#[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))]
pub gas_price: u64,
#[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))]
pub interval: u64,
#[cfg_attr(feature = "hex-serialize", serde(serialize_with = "serialize_uint"))]
pub propose_ratio: u64,
Expand Down

0 comments on commit ec70653

Please sign in to comment.