diff --git a/core/src/client/client.rs b/core/src/client/client.rs
index 2e3e9c6bb1..11bc8a2657 100644
--- a/core/src/client/client.rs
+++ b/core/src/client/client.rs
@@ -33,7 +33,6 @@ use crate::transaction::{
LocalizedTransaction, PendingVerifiedTransactions, UnverifiedTransaction, VerifiedTransaction,
};
use crate::types::{BlockId, BlockStatus, TransactionId, VerificationQueueInfo as BlockQueueInfo};
-use crate::MemPoolMinFees;
use cdb::{new_journaldb, Algorithm, AsHashDB};
use cio::IoChannel;
use ckey::{Address, NetworkId, PlatformAddress};
@@ -699,10 +698,6 @@ impl MiningBlockChainClient for Client {
fn register_immune_users(&self, immune_user_vec: Vec
) {
self.importer.miner.register_immune_users(immune_user_vec)
}
-
- fn mem_pool_min_fees(&self) -> MemPoolMinFees {
- self.importer.miner.get_options().mem_pool_min_fees
- }
}
impl FindDoubleVoteHandler for Client {
diff --git a/core/src/client/mod.rs b/core/src/client/mod.rs
index 6da6d4cd02..ea5e11be34 100644
--- a/core/src/client/mod.rs
+++ b/core/src/client/mod.rs
@@ -33,7 +33,6 @@ use crate::blockchain_info::BlockChainInfo;
use crate::consensus::EngineError;
use crate::encoded;
use crate::error::{BlockImportError, Error as GenericError};
-use crate::miner::MemPoolMinFees;
use crate::transaction::{LocalizedTransaction, PendingVerifiedTransactions, VerifiedTransaction};
use crate::types::{BlockId, BlockStatus, TransactionId, VerificationQueueInfo as BlockQueueInfo};
use cdb::DatabaseError;
@@ -262,8 +261,6 @@ pub trait MiningBlockChainClient: BlockChainClient + BlockProducer + FindDoubleV
/// Append designated users to the immune user list.
fn register_immune_users(&self, immune_user_vec: Vec);
-
- fn mem_pool_min_fees(&self) -> MemPoolMinFees;
}
/// Provides methods to access database.
diff --git a/core/src/client/test_client.rs b/core/src/client/test_client.rs
index 2cd54dd9f3..d1e123e439 100644
--- a/core/src/client/test_client.rs
+++ b/core/src/client/test_client.rs
@@ -40,7 +40,7 @@ use crate::consensus::EngineError;
use crate::db::{COL_STATE, NUM_COLUMNS};
use crate::encoded;
use crate::error::{BlockImportError, Error as GenericError};
-use crate::miner::{MemPoolMinFees, Miner, MinerService, TransactionImportResult};
+use crate::miner::{Miner, MinerService, TransactionImportResult};
use crate::scheme::Scheme;
use crate::transaction::{LocalizedTransaction, PendingVerifiedTransactions, VerifiedTransaction};
use crate::types::{BlockId, TransactionId, VerificationQueueInfo as QueueInfo};
@@ -362,10 +362,6 @@ impl MiningBlockChainClient for TestBlockChainClient {
fn register_immune_users(&self, immune_user_vec: Vec) {
self.miner.register_immune_users(immune_user_vec)
}
-
- fn mem_pool_min_fees(&self) -> MemPoolMinFees {
- self.miner.get_options().mem_pool_min_fees
- }
}
impl AccountData for TestBlockChainClient {
diff --git a/core/src/codechain_machine.rs b/core/src/codechain_machine.rs
index 8a6bba2209..9b2b740664 100644
--- a/core/src/codechain_machine.rs
+++ b/core/src/codechain_machine.rs
@@ -21,8 +21,6 @@ use crate::error::Error;
use crate::transaction::{UnverifiedTransaction, VerifiedTransaction};
use ckey::Address;
use cstate::{StateError, TopState, TopStateView};
-use ctypes::errors::SyntaxError;
-use ctypes::transaction::Action;
use ctypes::{CommonParams, Header};
use std::convert::TryInto;
@@ -42,25 +40,6 @@ impl CodeChainMachine {
&self.params
}
- /// Does basic verification of the transaction.
- pub fn verify_transaction_with_params(
- &self,
- tx: &UnverifiedTransaction,
- common_params: &CommonParams,
- ) -> Result<(), Error> {
- let min_cost = Self::min_cost(common_params, &tx.transaction().action);
- if tx.transaction().fee < min_cost {
- return Err(SyntaxError::InsufficientFee {
- minimal: min_cost,
- got: tx.transaction().fee,
- }
- .into())
- }
- tx.verify_with_params(common_params)?;
-
- Ok(())
- }
-
/// Verify a particular transaction's seal is valid.
pub fn verify_transaction_seal(p: UnverifiedTransaction, _header: &Header) -> Result {
Ok(p.try_into()?)
@@ -78,32 +57,6 @@ impl CodeChainMachine {
Ok(())
}
- pub fn min_cost(params: &CommonParams, action: &Action) -> u64 {
- match action {
- Action::Pay {
- ..
- } => params.min_pay_transaction_cost(),
- Action::CreateShard {
- ..
- } => params.min_create_shard_transaction_cost(),
- Action::SetShardOwners {
- ..
- } => params.min_set_shard_owners_transaction_cost(),
- Action::SetShardUsers {
- ..
- } => params.min_set_shard_users_transaction_cost(),
- Action::Custom {
- ..
- } => params.min_custom_transaction_cost(),
- Action::ShardStore {
- ..
- } => {
- // FIXME
- 0
- }
- }
- }
-
pub fn balance(&self, live: &ExecutedBlock, address: &Address) -> Result {
Ok(live.state().balance(address).map_err(StateError::from)?)
}
diff --git a/core/src/consensus/mod.rs b/core/src/consensus/mod.rs
index 351b18e6a1..a95c84cb3a 100644
--- a/core/src/consensus/mod.rs
+++ b/core/src/consensus/mod.rs
@@ -341,7 +341,8 @@ pub trait CodeChainEngine: ConsensusEngine {
action.verify(common_params)?;
}
- self.machine().verify_transaction_with_params(tx, common_params)
+ tx.verify_with_params(common_params)?;
+ Ok(())
}
}
diff --git a/core/src/lib.rs b/core/src/lib.rs
index 07b39efa95..11a3ae5d88 100644
--- a/core/src/lib.rs
+++ b/core/src/lib.rs
@@ -61,7 +61,7 @@ pub use crate::consensus::stake;
pub use crate::consensus::{EngineType, TimeGapParams};
pub use crate::db::{COL_STATE, NUM_COLUMNS};
pub use crate::error::{BlockImportError, Error, ImportError};
-pub use crate::miner::{MemPoolMinFees, Miner, MinerOptions, MinerService};
+pub use crate::miner::{Miner, MinerOptions, MinerService};
pub use crate::peer_db::PeerDb;
pub use crate::scheme::Scheme;
pub use crate::service::ClientService;
diff --git a/core/src/miner/mem_pool.rs b/core/src/miner/mem_pool.rs
index 55e7f2dc43..07e1e086c5 100644
--- a/core/src/miner/mem_pool.rs
+++ b/core/src/miner/mem_pool.rs
@@ -16,8 +16,8 @@
use super::backup;
use super::mem_pool_types::{
- AccountDetails, CurrentQueue, FutureQueue, MemPoolInput, MemPoolItem, MemPoolMinFees, MemPoolStatus,
- PoolingInstant, QueueTag, TransactionOrder, TransactionOrderWithTag, TxOrigin,
+ AccountDetails, CurrentQueue, FutureQueue, MemPoolInput, MemPoolItem, MemPoolStatus, PoolingInstant, QueueTag,
+ TransactionOrder, TransactionOrderWithTag, TxOrigin,
};
use super::TransactionImportResult;
use crate::client::{AccountData, BlockChainTrait};
@@ -72,8 +72,6 @@ impl From for Error {
}
pub struct MemPool {
- /// Fee threshold for transactions that can be imported to this pool
- minimum_fees: MemPoolMinFees,
/// A value which is used to check whether a new transaciton can replace a transaction in the memory pool with the same signer and seq.
/// If the fee of the new transaction is `new_fee` and the fee of the transaction in the memory pool is `old_fee`,
/// then `new_fee > old_fee + old_fee >> mem_pool_fee_bump_shift` should be satisfied to replace.
@@ -113,15 +111,8 @@ pub struct MemPool {
impl MemPool {
/// Create new instance of this Queue with specified limits
- pub fn with_limits(
- limit: usize,
- memory_limit: usize,
- fee_bump_shift: usize,
- db: Arc,
- minimum_fees: MemPoolMinFees,
- ) -> Self {
+ pub fn with_limits(limit: usize, memory_limit: usize, fee_bump_shift: usize, db: Arc) -> Self {
MemPool {
- minimum_fees,
fee_bump_shift,
max_block_number_period_in_pool: DEFAULT_POOLING_PERIOD,
current: CurrentQueue::new(),
@@ -700,23 +691,6 @@ impl MemPool {
origin: TxOrigin,
client_account: &AccountDetails,
) -> Result<(), Error> {
- let action_min_fee = self.minimum_fees.min_cost(&tx.transaction().action);
- if origin != TxOrigin::Local && tx.transaction().fee < action_min_fee {
- ctrace!(
- MEM_POOL,
- "Dropping transaction below mempool defined minimum fee: {:?} (gp: {} < {})",
- tx.hash(),
- tx.transaction().fee,
- action_min_fee
- );
-
- return Err(SyntaxError::InsufficientFee {
- minimal: action_min_fee,
- got: tx.transaction().fee,
- }
- .into())
- }
-
let full_pools_lowest = self.effective_minimum_fee();
if origin != TxOrigin::Local && tx.transaction().fee < full_pools_lowest {
ctrace!(
@@ -1042,7 +1016,7 @@ pub mod test {
test_client.set_balance(default_addr, u64::max_value());
let db = Arc::new(kvdb_memorydb::create(crate::db::NUM_COLUMNS.unwrap_or(0)));
- let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db.clone(), Default::default());
+ let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db.clone());
let fetch_account = fetch_account_creator(&test_client);
@@ -1076,7 +1050,7 @@ pub mod test {
inputs.push(create_mempool_input_with_pay(7u64, &keypair));
mem_pool.add(inputs, inserted_block_number, inserted_timestamp, &fetch_account);
- let mut mem_pool_recovered = MemPool::with_limits(8192, usize::max_value(), 3, db, Default::default());
+ let mut mem_pool_recovered = MemPool::with_limits(8192, usize::max_value(), 3, db);
mem_pool_recovered.recover_from_db(&test_client);
assert_eq!(mem_pool_recovered.first_seqs, mem_pool.first_seqs);
@@ -1105,131 +1079,18 @@ pub mod test {
VerifiedTransaction::new_with_sign(tx, keypair.private())
}
- fn create_signed_pay_with_fee(seq: u64, fee: u64, keypair: &KeyPair) -> VerifiedTransaction {
- let receiver = 1u64.into();
- let tx = Transaction {
- seq,
- fee,
- network_id: "tc".into(),
- action: Action::Pay {
- receiver,
- quantity: 100_000,
- },
- };
- VerifiedTransaction::new_with_sign(tx, keypair.private())
- }
-
fn create_mempool_input_with_pay(seq: u64, keypair: &KeyPair) -> MemPoolInput {
let signed = create_signed_pay(seq, &keypair);
MemPoolInput::new(signed, TxOrigin::Local)
}
- fn abbreviated_mempool_add(
- test_client: &TestBlockChainClient,
- mem_pool: &mut MemPool,
- txs: Vec,
- origin: TxOrigin,
- ) -> Vec> {
- let fetch_account = fetch_account_creator(test_client);
-
- let inserted_block_number = 1;
- let inserted_timestamp = 100;
- let inputs: Vec = txs.into_iter().map(|tx| MemPoolInput::new(tx, origin)).collect();
- mem_pool.add(inputs, inserted_block_number, inserted_timestamp, &fetch_account)
- }
-
- #[test]
- fn local_transactions_whose_fees_are_under_the_mem_pool_min_fee_should_not_be_rejected() {
- let test_client = TestBlockChainClient::new();
-
- // Set the pay transaction minimum fee
- let fees = MemPoolMinFees::create_from_options(Some(150), None, None, None, None);
-
- let db = Arc::new(kvdb_memorydb::create(crate::db::NUM_COLUMNS.unwrap_or(0)));
- let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db, fees);
- let keypair: KeyPair = Random.generate().unwrap();
- let address = public_to_address(keypair.public());
-
- test_client.set_balance(address, 1_000_000_000_000);
-
- let txs = vec![
- create_signed_pay_with_fee(0, 200, &keypair),
- create_signed_pay_with_fee(1, 140, &keypair),
- create_signed_pay_with_fee(2, 160, &keypair),
- ];
- let result = abbreviated_mempool_add(&test_client, &mut mem_pool, txs, TxOrigin::Local);
- assert_eq!(
- vec![
- Ok(TransactionImportResult::Current),
- Ok(TransactionImportResult::Current),
- Ok(TransactionImportResult::Current)
- ],
- result
- );
-
- assert_eq!(
- vec![
- create_signed_pay_with_fee(0, 200, &keypair),
- create_signed_pay_with_fee(1, 140, &keypair),
- create_signed_pay_with_fee(2, 160, &keypair)
- ],
- mem_pool.top_transactions(std::usize::MAX, 0..std::u64::MAX).transactions
- );
-
- assert_eq!(Vec::::default(), mem_pool.future_transactions());
- }
-
- #[test]
- fn external_transactions_whose_fees_are_under_the_mem_pool_min_fee_are_rejected() {
- let test_client = TestBlockChainClient::new();
- // Set the pay transaction minimum fee
- let fees = MemPoolMinFees::create_from_options(Some(150), None, None, None, None);
-
- let db = Arc::new(kvdb_memorydb::create(crate::db::NUM_COLUMNS.unwrap_or(0)));
- let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db, fees);
- let keypair: KeyPair = Random.generate().unwrap();
- let address = public_to_address(keypair.public());
-
- test_client.set_balance(address, 1_000_000_000_000);
-
- let txs = vec![
- create_signed_pay_with_fee(0, 200, &keypair),
- create_signed_pay_with_fee(1, 140, &keypair),
- create_signed_pay_with_fee(1, 160, &keypair),
- create_signed_pay_with_fee(2, 149, &keypair),
- ];
- let result = abbreviated_mempool_add(&test_client, &mut mem_pool, txs, TxOrigin::External);
- assert_eq!(
- vec![
- Ok(TransactionImportResult::Current),
- Err(Error::Syntax(SyntaxError::InsufficientFee {
- minimal: 150,
- got: 140,
- })),
- Ok(TransactionImportResult::Current),
- Err(Error::Syntax(SyntaxError::InsufficientFee {
- minimal: 150,
- got: 149,
- })),
- ],
- result
- );
-
- assert_eq!(
- vec![create_signed_pay_with_fee(0, 200, &keypair), create_signed_pay_with_fee(1, 160, &keypair)],
- mem_pool.top_transactions(std::usize::MAX, 0..std::u64::MAX).transactions
- );
-
- assert_eq!(Vec::::default(), mem_pool.future_transactions());
- }
-
#[test]
fn transactions_are_moved_to_future_queue_if_the_preceding_one_removed() {
//setup test_client
let test_client = TestBlockChainClient::new();
let db = Arc::new(kvdb_memorydb::create(crate::db::NUM_COLUMNS.unwrap_or(0)));
- let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db, Default::default());
+ let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db);
let fetch_account = fetch_account_creator(&test_client);
let keypair: KeyPair = Random.generate().unwrap();
diff --git a/core/src/miner/mem_pool_types.rs b/core/src/miner/mem_pool_types.rs
index 7fb99770c2..c7a523ccdd 100644
--- a/core/src/miner/mem_pool_types.rs
+++ b/core/src/miner/mem_pool_types.rs
@@ -391,57 +391,3 @@ pub struct AccountDetails {
/// Current account balance
pub balance: u64,
}
-
-#[derive(Default, Clone, Copy, Debug, PartialEq)]
-/// Minimum fee thresholds defined not by network but by Mempool
-pub struct MemPoolMinFees {
- pub min_pay_transaction_cost: u64,
- pub min_create_shard_transaction_cost: u64,
- pub min_set_shard_owners_transaction_cost: u64,
- pub min_set_shard_users_transaction_cost: u64,
- pub min_custom_transaction_cost: u64,
-}
-
-impl MemPoolMinFees {
- #[allow(clippy::too_many_arguments)]
- pub fn create_from_options(
- min_pay_cost_option: Option,
- min_create_shard_cost_option: Option,
- min_set_shard_owners_cost_option: Option,
- min_set_shard_users_cost_option: Option,
- min_custom_cost_option: Option,
- ) -> Self {
- MemPoolMinFees {
- min_pay_transaction_cost: min_pay_cost_option.unwrap_or_default(),
- min_create_shard_transaction_cost: min_create_shard_cost_option.unwrap_or_default(),
- min_set_shard_owners_transaction_cost: min_set_shard_owners_cost_option.unwrap_or_default(),
- min_set_shard_users_transaction_cost: min_set_shard_users_cost_option.unwrap_or_default(),
- min_custom_transaction_cost: min_custom_cost_option.unwrap_or_default(),
- }
- }
- pub fn min_cost(&self, action: &Action) -> u64 {
- match action {
- Action::Pay {
- ..
- } => self.min_pay_transaction_cost,
- Action::CreateShard {
- ..
- } => self.min_create_shard_transaction_cost,
- Action::SetShardOwners {
- ..
- } => self.min_set_shard_owners_transaction_cost,
- Action::SetShardUsers {
- ..
- } => self.min_set_shard_users_transaction_cost,
- Action::Custom {
- ..
- } => self.min_custom_transaction_cost,
- Action::ShardStore {
- ..
- } => {
- // FIXME
- 0
- }
- }
- }
-}
diff --git a/core/src/miner/miner.rs b/core/src/miner/miner.rs
index af9e74389a..fd4d8535f6 100644
--- a/core/src/miner/miner.rs
+++ b/core/src/miner/miner.rs
@@ -15,7 +15,6 @@
// along with this program. If not, see .
use super::mem_pool::{Error as MemPoolError, MemPool};
-pub use super::mem_pool_types::MemPoolMinFees;
use super::mem_pool_types::{MemPoolInput, TxOrigin};
use super::{fetch_account_creator, MinerService, MinerStatus, TransactionImportResult};
use crate::account_provider::{AccountProvider, Error as AccountProviderError};
@@ -67,8 +66,6 @@ pub struct MinerOptions {
/// Local transactions ignore this option.
pub mem_pool_fee_bump_shift: usize,
pub allow_create_shard: bool,
- /// Minimum fees configured by the machine.
- pub mem_pool_min_fees: MemPoolMinFees,
}
impl Default for MinerOptions {
@@ -82,7 +79,6 @@ impl Default for MinerOptions {
mem_pool_memory_limit: Some(2 * 1024 * 1024),
mem_pool_fee_bump_shift: 3,
allow_create_shard: false,
- mem_pool_min_fees: Default::default(),
}
}
}
@@ -136,7 +132,6 @@ impl Miner {
mem_limit,
options.mem_pool_fee_bump_shift,
db,
- options.mem_pool_min_fees,
)));
Self {
@@ -762,7 +757,7 @@ pub mod test {
let scheme = Scheme::new_test();
let miner = Arc::new(Miner::with_scheme(&scheme, db.clone()));
- let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db.clone(), Default::default());
+ let mut mem_pool = MemPool::with_limits(8192, usize::max_value(), 3, db.clone());
let client = generate_test_client(db, Arc::clone(&miner), &scheme).unwrap();
let private = Private::random();
diff --git a/core/src/miner/mod.rs b/core/src/miner/mod.rs
index 331c62fb5f..ae8bc784a5 100644
--- a/core/src/miner/mod.rs
+++ b/core/src/miner/mod.rs
@@ -28,7 +28,6 @@ use primitives::Bytes;
use std::ops::Range;
use self::mem_pool_types::AccountDetails;
-pub use self::mem_pool_types::MemPoolMinFees;
pub use self::miner::{AuthoringParams, Miner, MinerOptions};
use crate::account_provider::{AccountProvider, Error as AccountProviderError};
use crate::client::{
diff --git a/foundry/config/mod.rs b/foundry/config/mod.rs
index ff1d247919..cc5aa7c454 100644
--- a/foundry/config/mod.rs
+++ b/foundry/config/mod.rs
@@ -16,7 +16,7 @@
mod chain_type;
-use ccore::{MemPoolMinFees, MinerOptions, TimeGapParams};
+use ccore::{MinerOptions, TimeGapParams};
use cidr::IpCidr;
use cinformer::InformerConfig;
use ckey::PlatformAddress;
@@ -73,14 +73,6 @@ impl Config {
None => unreachable!(),
};
- let mem_pool_min_fees = MemPoolMinFees::create_from_options(
- self.mining.min_pay_transaction_cost,
- self.mining.min_create_shard_transaction_cost,
- self.mining.min_set_shard_owners_transaction_cost,
- self.mining.min_set_shard_users_transaction_cost,
- self.mining.min_custom_transaction_cost,
- );
-
Ok(MinerOptions {
mem_pool_size: self.mining.mem_pool_size.unwrap(),
mem_pool_memory_limit: match self.mining.mem_pool_mem_limit.unwrap() {
@@ -93,7 +85,6 @@ impl Config {
reseal_on_external_transaction,
reseal_min_period: Duration::from_millis(self.mining.reseal_min_period.unwrap()),
no_reseal_timer: self.mining.no_reseal_timer.unwrap(),
- mem_pool_min_fees,
})
}
@@ -232,11 +223,6 @@ pub struct Mining {
pub no_reseal_timer: Option,
pub allowed_past_gap: Option,
pub allowed_future_gap: Option,
- pub min_pay_transaction_cost: Option,
- pub min_create_shard_transaction_cost: Option,
- pub min_set_shard_owners_transaction_cost: Option,
- pub min_set_shard_users_transaction_cost: Option,
- pub min_custom_transaction_cost: Option,
}
#[derive(Deserialize)]
@@ -419,21 +405,6 @@ impl Mining {
if other.no_reseal_timer.is_some() {
self.no_reseal_timer = other.no_reseal_timer;
}
- if other.min_pay_transaction_cost.is_some() {
- self.min_pay_transaction_cost = other.min_pay_transaction_cost;
- }
- if other.min_create_shard_transaction_cost.is_some() {
- self.min_create_shard_transaction_cost = other.min_create_shard_transaction_cost;
- }
- if other.min_set_shard_owners_transaction_cost.is_some() {
- self.min_set_shard_owners_transaction_cost = other.min_set_shard_owners_transaction_cost;
- }
- if other.min_set_shard_users_transaction_cost.is_some() {
- self.min_set_shard_users_transaction_cost = other.min_set_shard_users_transaction_cost;
- }
- if other.min_custom_transaction_cost.is_some() {
- self.min_custom_transaction_cost = other.min_custom_transaction_cost;
- }
}
pub fn overwrite_with(&mut self, matches: &clap::ArgMatches<'_>) -> Result<(), String> {
diff --git a/json/src/scheme/params.rs b/json/src/scheme/params.rs
index 484243d29f..dbb669389a 100644
--- a/json/src/scheme/params.rs
+++ b/json/src/scheme/params.rs
@@ -27,13 +27,6 @@ pub struct Params {
#[serde(rename = "networkID")]
pub network_id: NetworkId,
- /// Minimum transaction cost.
- pub min_pay_cost: Uint,
- pub min_create_shard_cost: Uint,
- pub min_set_shard_owners_cost: Uint,
- pub min_set_shard_users_cost: Uint,
- pub min_custom_cost: Uint,
-
/// Maximum size of block body.
pub max_body_size: Uint,
/// Snapshot creation period in unit of block numbers.
@@ -64,11 +57,6 @@ mod tests {
let s = r#"{
"maxExtraDataSize": "0x20",
"networkID" : "tc",
- "minPayCost" : 10,
- "minCreateShardCost" : 12,
- "minSetShardOwnersCost" : 13,
- "minSetShardUsersCost" : 14,
- "minCustomCost" : 16,
"maxBodySize" : 4194304,
"snapshotPeriod": 16384,
"termSeconds": 3600,
@@ -85,11 +73,6 @@ mod tests {
let deserialized: Params = serde_json::from_str(s).unwrap();
assert_eq!(deserialized.max_extra_data_size, 0x20.into());
assert_eq!(deserialized.network_id, "tc".into());
- assert_eq!(deserialized.min_pay_cost, 10.into());
- assert_eq!(deserialized.min_create_shard_cost, 12.into());
- assert_eq!(deserialized.min_set_shard_owners_cost, 13.into());
- assert_eq!(deserialized.min_set_shard_users_cost, 14.into());
- assert_eq!(deserialized.min_custom_cost, 16.into());
assert_eq!(deserialized.max_body_size, 4_194_304.into());
assert_eq!(deserialized.snapshot_period, 16_384.into());
assert_eq!(deserialized.term_seconds, 3600.into());
@@ -110,11 +93,6 @@ mod tests {
let s = r#"{
"maxExtraDataSize": "0x20",
"networkID" : "tc",
- "minPayCost" : 10,
- "minCreateShardCost" : 12,
- "minSetShardOwnersCost" : 13,
- "minSetShardUsersCost" : 14,
- "minCustomCost" : 16,
"maxBodySize" : 4194304,
"snapshotPeriod": 16384,
"termSeconds": 3600,
@@ -132,11 +110,6 @@ mod tests {
let deserialized: Params = serde_json::from_str(s).unwrap();
assert_eq!(deserialized.max_extra_data_size, 0x20.into());
assert_eq!(deserialized.network_id, "tc".into());
- assert_eq!(deserialized.min_pay_cost, 10.into());
- assert_eq!(deserialized.min_create_shard_cost, 12.into());
- assert_eq!(deserialized.min_set_shard_owners_cost, 13.into());
- assert_eq!(deserialized.min_set_shard_users_cost, 14.into());
- assert_eq!(deserialized.min_custom_cost, 16.into());
assert_eq!(deserialized.max_body_size, 4_194_304.into());
assert_eq!(deserialized.snapshot_period, 16_384.into());
assert_eq!(deserialized.term_seconds, 3600.into());
diff --git a/json/src/scheme/scheme.rs b/json/src/scheme/scheme.rs
index 42b447df56..144db21d5f 100644
--- a/json/src/scheme/scheme.rs
+++ b/json/src/scheme/scheme.rs
@@ -95,11 +95,6 @@ mod tests {
"maxTransferMetadataSize": "0x0100",
"maxTextContentSize": "0x0200",
"networkID" : "tc",
- "minPayCost" : 10,
- "minCreateShardCost" : 12,
- "minSetShardOwnersCost" : 13,
- "minSetShardUsersCost" : 14,
- "minCustomCost" : 16,
"maxBodySize": 4194304,
"snapshotPeriod": 16384,
"termSeconds": 3600,
diff --git a/rpc/src/v1/impls/chain.rs b/rpc/src/v1/impls/chain.rs
index 10778ea5dd..b3836af1ad 100644
--- a/rpc/src/v1/impls/chain.rs
+++ b/rpc/src/v1/impls/chain.rs
@@ -158,27 +158,6 @@ where
Ok(self.client.block(&BlockId::Hash(block_hash)).map(|block| block.transactions_count()))
}
- fn get_min_transaction_fee(&self, action_type: String, block_number: Option) -> Result