Skip to content

Commit

Permalink
refactor: stop scenarios executor from failing on already bootstrappe…
Browse files Browse the repository at this point in the history
…d databases.
  • Loading branch information
0xOmarA committed May 2, 2024
1 parent 8102af8 commit e2d602f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions radix-transaction-scenarios/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,20 @@ where
trigger: ScenarioTrigger,
filter: ScenarioFilter,
) -> Result<(), ScenarioExecutorError> {
Bootstrapper::new(
self.network_definition.clone(),
&mut self.database,
VmInit::new(&self.scrypto_vm, self.native_vm_extension.clone()),
false,
)
.bootstrap_test_default()
.ok_or(ScenarioExecutorError::BootstrapFailed)?;
// TODO: Remove me once genesis/babylon is a protocol update.
//
// Bootstrapping fails if the database has already been bootstrapped, if the error from that
// is bubbled up then execution of scenarios on an already bootstrapped database would fail.
// Therefore, we attempt to bootstrap and ignore whatever the outcome of the bootstrap is.
drop(
Bootstrapper::new(
self.network_definition.clone(),
&mut self.database,
VmInit::new(&self.scrypto_vm, self.native_vm_extension.clone()),
false,
)
.bootstrap_test_default(),
);

let mut current_protocol_version = ProtocolVersion::Genesis;

Expand Down

0 comments on commit e2d602f

Please sign in to comment.