Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(genesis)!: remove _id and _file suffix from genesis fields #4724

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,6 @@ impl Iroha {

#[cfg(debug_assertions)]
let freeze_status = FreezeStatus::new(config.common.peer.clone());
Arc::new(AtomicBool::new(false));

let notify_shutdown = Arc::new(Notify::new());

NetworkRelay {
Expand Down
4 changes: 2 additions & 2 deletions configs/swarm/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,6 @@
}
}
],
"executor_file": "./executor.wasm",
"chain_id": "00000000-0000-0000-0000-000000000000"
"executor": "./executor.wasm",
"chain": "00000000-0000-0000-0000-000000000000"
}
16 changes: 8 additions & 8 deletions genesis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ pub struct GenesisTransaction(pub SignedTransaction);
pub struct RawGenesisTransaction {
instructions: Vec<InstructionBox>,
/// Path to the [`Executor`] file
executor_file: PathBuf,
executor: PathBuf,
/// Unique id of blockchain
chain_id: ChainId,
chain: ChainId,
}

impl RawGenesisTransaction {
Expand Down Expand Up @@ -61,11 +61,11 @@ impl RawGenesisTransaction {
path.as_ref().display()
)
})?;
value.executor_file = path
value.executor = path
.as_ref()
.parent()
.expect("genesis must be a file in some directory")
.join(value.executor_file);
.join(value.executor);
Ok(value)
}

Expand All @@ -79,9 +79,9 @@ impl RawGenesisTransaction {
/// # Errors
/// If executor couldn't be read from provided path
pub fn build_and_sign(self, genesis_key_pair: &KeyPair) -> Result<GenesisTransaction> {
let executor = get_executor(&self.executor_file)?;
let executor = get_executor(&self.executor)?;
let genesis =
build_and_sign_genesis(self.instructions, executor, self.chain_id, genesis_key_pair);
build_and_sign_genesis(self.instructions, executor, self.chain, genesis_key_pair);
Ok(genesis)
}
}
Expand Down Expand Up @@ -181,8 +181,8 @@ impl GenesisTransactionBuilder {
pub fn build_raw(self, executor_file: PathBuf, chain_id: ChainId) -> RawGenesisTransaction {
RawGenesisTransaction {
instructions: self.instructions,
executor_file,
chain_id,
executor: executor_file,
chain: chain_id,
}
}
}
Expand Down
Loading