mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-04-28 03:00:18 -04:00
contract/money: Faucet cleanup
This removes clear inputs from Money::Transfer, and removes all faucet references in the code. Additionally, in src/validator/ we use the ValidatorConfig struct directly, rather than using the ValidatorConfig::new() function.
This commit is contained in:
@@ -223,14 +223,13 @@ async fn realmain(args: Args, ex: Arc<smol::Executor<'static>>) -> Result<()> {
|
||||
None
|
||||
};
|
||||
|
||||
let config = ValidatorConfig::new(
|
||||
blockchain_config.threshold,
|
||||
blockchain_config.pow_target,
|
||||
let config = ValidatorConfig {
|
||||
finalization_threshold: blockchain_config.threshold,
|
||||
pow_target: blockchain_config.pow_target,
|
||||
pow_fixed_difficulty,
|
||||
genesis_block,
|
||||
vec![],
|
||||
false, // TODO: Make configurable
|
||||
);
|
||||
verify_fees: false, // TODO: Make configurable
|
||||
};
|
||||
|
||||
// Initialize validator
|
||||
let validator = Validator::new(&sled_db, config).await?;
|
||||
|
||||
@@ -85,14 +85,13 @@ impl Harness {
|
||||
// Generate validators configuration
|
||||
// NOTE: we are not using consensus constants here so we
|
||||
// don't get circular dependencies.
|
||||
let validator_config = ValidatorConfig::new(
|
||||
3,
|
||||
config.pow_target,
|
||||
config.pow_fixed_difficulty.clone(),
|
||||
let validator_config = ValidatorConfig {
|
||||
finalization_threshold: 3,
|
||||
pow_target: config.pow_target,
|
||||
pow_fixed_difficulty: config.pow_fixed_difficulty.clone(),
|
||||
genesis_block,
|
||||
vec![],
|
||||
verify_fees,
|
||||
);
|
||||
};
|
||||
|
||||
// Generate validators using pregenerated vks
|
||||
let (_, vks) = vks::read_or_gen_vks_and_pks()?;
|
||||
@@ -141,18 +140,11 @@ impl Harness {
|
||||
let bob = &self.bob.validator;
|
||||
|
||||
alice
|
||||
.validate_blockchain(
|
||||
vec![],
|
||||
self.config.pow_target,
|
||||
self.config.pow_fixed_difficulty.clone(),
|
||||
)
|
||||
.validate_blockchain(self.config.pow_target, self.config.pow_fixed_difficulty.clone())
|
||||
.await?;
|
||||
|
||||
bob.validate_blockchain(self.config.pow_target, self.config.pow_fixed_difficulty.clone())
|
||||
.await?;
|
||||
bob.validate_blockchain(
|
||||
vec![],
|
||||
self.config.pow_target,
|
||||
self.config.pow_fixed_difficulty.clone(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
let alice_blockchain_len = alice.blockchain.len();
|
||||
assert_eq!(alice_blockchain_len, bob.blockchain.len());
|
||||
|
||||
@@ -73,7 +73,7 @@ async fn sync_blocks_real(ex: Arc<Executor<'static>>) -> Result<()> {
|
||||
// Verify node synced
|
||||
let alice = &th.alice.validator;
|
||||
let charlie = &charlie.validator;
|
||||
charlie.validate_blockchain(vec![], pow_target, pow_fixed_difficulty).await?;
|
||||
charlie.validate_blockchain(pow_target, pow_fixed_difficulty).await?;
|
||||
assert_eq!(alice.blockchain.len(), charlie.blockchain.len());
|
||||
|
||||
// Thanks for reading
|
||||
|
||||
@@ -245,7 +245,6 @@ impl Drk {
|
||||
let debris = builder.build()?;
|
||||
|
||||
let full_params = MoneyTransferParamsV1 {
|
||||
clear_inputs: vec![],
|
||||
inputs: vec![partial.params.inputs[0].clone(), debris.params.inputs[0].clone()],
|
||||
outputs: vec![partial.params.outputs[0].clone(), debris.params.outputs[0].clone()],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user