Skip to content

Commit

Permalink
Fix passing of CLI params, add test config params.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Aug 22, 2024
1 parent 406b3fc commit 619eea4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/rosetta/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ VERSION:
}

cliFlagActivationEpochSirius = cli.UintFlag{
Name: "activation-epoch-spica",
Name: "activation-epoch-sirius",
Usage: "Specifies the activation epoch for Sirius release.",
Required: false,
Value: 1265,
Expand Down
2 changes: 1 addition & 1 deletion cmd/rosetta/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func startRosetta(ctx *cli.Context) error {
FirstHistoricalEpoch: cliFlags.firstHistoricalEpoch,
NumHistoricalEpochs: cliFlags.numHistoricalEpochs,
ShouldHandleContracts: cliFlags.shouldHandleContracts,
ActivationEpochSirius: cliFlags.activationEpochSpica,
ActivationEpochSirius: cliFlags.activationEpochSirius,
ActivationEpochSpica: cliFlags.activationEpochSpica,
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion server/provider/networkProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func (provider *networkProvider) ComputeTransactionFeeForMoveBalance(tx *transac

// IsReleaseSiriusActive returns whether the Sirius release is active in the provided epoch
func (provider *networkProvider) IsReleaseSiriusActive(epoch uint32) bool {
return epoch < provider.activationEpochSpica
return epoch >= provider.activationEpochSirius
}

// IsReleaseSpicaActive returns whether the Spica release is active in the provided epoch
Expand Down
2 changes: 2 additions & 0 deletions systemtests/check_with_mesh_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def run_rosetta(configuration: Configuration):
f"--config-custom-currencies={configuration.config_file_custom_currencies}",
f"--first-historical-epoch={current_epoch}",
f"--num-historical-epochs={configuration.num_historical_epochs}",
f"--activation-epoch-sirius={configuration.activation_epoch_sirius}",
f"--activation-epoch-spica={configuration.activation_epoch_spica}",
]

return subprocess.Popen(command)
Expand Down
10 changes: 10 additions & 0 deletions systemtests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ class Configuration:
num_historical_epochs: int
observer_url: str
proxy_url: str
activation_epoch_sirius: int
activation_epoch_spica: int
check_construction_native_configuration_file: str
check_construction_custom_configuration_file: str
check_data_configuration_file: str
Expand All @@ -33,6 +35,8 @@ class Configuration:
num_historical_epochs=2,
observer_url="",
proxy_url="https://gateway.multiversx.com",
activation_epoch_sirius=1265,
activation_epoch_spica=4294967295,
check_construction_native_configuration_file="",
check_construction_custom_configuration_file="",
check_data_configuration_file="systemtests/mesh_cli_config/check-data.json",
Expand All @@ -50,6 +54,8 @@ class Configuration:
num_historical_epochs=2,
observer_url="",
proxy_url="https://devnet-gateway.multiversx.com",
activation_epoch_sirius=629,
activation_epoch_spica=4294967295,
check_construction_native_configuration_file="systemtests/mesh_cli_config/devnet-construction-native.json",
check_construction_custom_configuration_file="systemtests/mesh_cli_config/devnet-construction-custom.json",
check_data_configuration_file="systemtests/mesh_cli_config/check-data.json",
Expand All @@ -70,6 +76,8 @@ class Configuration:
num_historical_epochs=1,
observer_url="",
proxy_url="https://testnet-gateway.multiversx.com",
activation_epoch_sirius=1,
activation_epoch_spica=4294967295,
check_construction_native_configuration_file="systemtests/mesh_cli_config/testnet-construction-native.json",
check_construction_custom_configuration_file="systemtests/mesh_cli_config/testnet-construction-custom.json",
check_data_configuration_file="systemtests/mesh_cli_config/check-data.json",
Expand All @@ -90,6 +98,8 @@ class Configuration:
num_historical_epochs=2,
observer_url="",
proxy_url="http://localhost:7950",
activation_epoch_sirius=1,
activation_epoch_spica=4294967295,
check_construction_native_configuration_file="systemtests/mesh_cli_config/localnet-construction-native.json",
check_construction_custom_configuration_file="systemtests/mesh_cli_config/localnet-construction-custom.json",
check_data_configuration_file="systemtests/mesh_cli_config/check-data.json",
Expand Down

0 comments on commit 619eea4

Please sign in to comment.