diff --git a/testgen/README.md b/testgen/README.md index ba8d659c..34fe221a 100644 --- a/testgen/README.md +++ b/testgen/README.md @@ -6,7 +6,7 @@ [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -`cometbft-testgen` is a small utility for producing CometBFT data +`cometbft-testgen` is a small utility for producing Tendermint data structures from minimal input (for testing purposes only). ## Requirements @@ -23,8 +23,8 @@ cargo run -- --help cargo run -- --help CMD ``` -As an example, a CometBFT validator can be produced only from an identifier, -or a CometBFT header only from a set of validators. +As an example, a Tendermint validator can be produced only from an identifier, +or a Tendermint header only from a set of validators. The parameters can be supplied in two ways: - via STDIN: in that case they are expected to be a valid JSON object, diff --git a/testgen/bin/cometbft-testgen.rs b/testgen/bin/cometbft-testgen.rs index 3c4c3dc6..8a995730 100644 --- a/testgen/bin/cometbft-testgen.rs +++ b/testgen/bin/cometbft-testgen.rs @@ -3,11 +3,11 @@ use gumdrop::Options; use simple_error::SimpleError; const USAGE: &str = r#" -This is a small utility for producing cometbft datastructures +This is a small utility for producing Tendermint datastructures from minimal input (for testing purposes only). -For example, a cometbft validator can be produced only from an identifier, -or a cometbft header only from a set of validators. +For example, a Tendermint validator can be produced only from an identifier, +or a Tendermint header only from a set of validators. To get an idea which input is needed for each datastructure, try '--help CMD': it will list the required and optional parameters. @@ -113,7 +113,7 @@ fn main() { } match opts.command { None => { - eprintln!("Produce CometBFT datastructures for testing from minimal input\n"); + eprintln!("Produce Tendermint datastructures for testing from minimal input\n"); eprintln!("Please specify a command:"); eprintln!("{}\n", CliOptions::command_list().unwrap()); eprintln!("{}\n", CliOptions::usage()); diff --git a/testgen/jsonatr-lib/apalache-cometbft.json b/testgen/jsonatr-lib/apalache-tendermint.json similarity index 89% rename from testgen/jsonatr-lib/apalache-cometbft.json rename to testgen/jsonatr-lib/apalache-tendermint.json index 2e8fdc7e..bb856583 100644 --- a/testgen/jsonatr-lib/apalache-cometbft.json +++ b/testgen/jsonatr-lib/apalache-tendermint.json @@ -1,7 +1,7 @@ { - "description": "Transformers for Apalache counterexamples (CEs) with CometBFT blockchains", + "description": "Transformers for Apalache counterexamples (CEs) with Tendermint blockchains", "use": [ - "cometbft.json" + "tendermint.json" ], "input": [ { @@ -101,13 +101,13 @@ }, { "name": "ids_to_validators", - "description": "transform a non-empty array of identifiers into CometBFT validators", + "description": "transform a non-empty array of identifiers into Tendermint validators", "kind": "INLINE", - "source": "$ | map(id_to_validator) | map(cometbft_validator)" + "source": "$ | map(id_to_validator) | map(tendermint_validator)" }, { "name": "ids_to_testgen_validators", - "description": "transform a non-empty array of identifiers into `CometBFT-testgen validators`", + "description": "transform a non-empty array of identifiers into `cometbft-testgen validators`", "kind": "INLINE", "source": "$ | map(id_to_validator)" }, @@ -121,7 +121,7 @@ "name": "first_validator", "description": "extract first validator from a non-empty array of identifiers", "kind": "INLINE", - "source": "$[0] | unwrap | id_to_validator | cometbft_validator" + "source": "$[0] | unwrap | id_to_validator | tendermint_validator" }, { "name": "const_id", @@ -133,11 +133,11 @@ "name": "fixed_validator", "description": "extract first validator from a non-empty array of identifiers", "kind": "INLINE", - "source": "$const_id | id_to_validator | cometbft_validator" + "source": "$const_id | id_to_validator | tendermint_validator" }, { "name": "ids_to_validator_set", - "description": "transform an array of identifiers into a JSON-encoded CometBFT validator set", + "description": "transform an array of identifiers into a JSON-encoded Tendermint validator set", "kind": "INLINE", "source": { "validators": "$ | ifelse(ids_to_validators,empty_array)", @@ -147,11 +147,11 @@ }, { "name": "block_to_signed_header", - "description": "transform a block from Apalache CE into a JSON-encoded CometBFT signed header", + "description": "transform a block from Apalache CE into a JSON-encoded Tendermint signed header", "kind": "INLINE", "source": { - "header": "$ | block_to_header | cometbft_header", - "commit": "$ | block_to_commit | cometbft_commit" + "header": "$ | block_to_header | tendermint_header", + "commit": "$ | block_to_commit | tendermint_commit" } } ] diff --git a/testgen/jsonatr-lib/apalache_to_lite_test.json b/testgen/jsonatr-lib/apalache_to_lite_test.json index f848b9e3..04e9c0cb 100644 --- a/testgen/jsonatr-lib/apalache_to_lite_test.json +++ b/testgen/jsonatr-lib/apalache_to_lite_test.json @@ -1,13 +1,13 @@ { - "description": "Transform an Apalache counterexample into a CometBFT LightClient test", + "description": "Transform an Apalache counterexample into a Tendermint LightClient test", "use": [ "unix.json", - "apalache-cometbft.json" + "apalache-tendermint.json" ], "input": [ { "name": "block_to_initial_block", - "description": "transforms a block from Apalache CE into a JSON-encoded CometBFT initial light block", + "description": "transforms a block from Apalache CE into a JSON-encoded Tendermint initial light block", "kind": "INLINE", "source": { "signed_header": "$ | block_to_signed_header", @@ -18,7 +18,7 @@ }, { "name": "state_to_lite_block_verdict", - "description": "transforms a block from Apalache CE into a JSON-encoded CometBFT light block", + "description": "transforms a block from Apalache CE into a JSON-encoded Tendermint light block", "kind": "INLINE", "let": { "block": "$..[?(@.key.str == 'current')].value" @@ -35,7 +35,7 @@ "validators": "$block | block_validators | ids_to_testgen_validators", "next_validators": "$block | block_next_validators | ids_to_testgen_validators" }, - "now": "$..[?(@.key.str == 'now')].value | unwrap | cometbft_time", + "now": "$..[?(@.key.str == 'now')].value | unwrap | tendermint_time", "verdict": "$..[?(@.key.str == 'verdict')].value.str | unwrap" } } diff --git a/testgen/jsonatr-lib/cometbft.json b/testgen/jsonatr-lib/tendermint.json similarity index 67% rename from testgen/jsonatr-lib/cometbft.json rename to testgen/jsonatr-lib/tendermint.json index 390ba4f6..330aea3f 100644 --- a/testgen/jsonatr-lib/cometbft.json +++ b/testgen/jsonatr-lib/tendermint.json @@ -1,29 +1,29 @@ { - "description": "Transformers for generating CometBFT datastructures", + "description": "Transformers for generating Tendermint datastructures", "prerequisites": "add cometbft-testgen to your $PATH", "input": [ { - "name": "cometbft_validator", + "name": "tendermint_validator", "kind": "COMMAND", "source": "cometbft-testgen --stdin validator" }, { - "name": "cometbft_header", + "name": "tendermint_header", "kind": "COMMAND", "source": "cometbft-testgen --stdin header" }, { - "name": "cometbft_commit", + "name": "tendermint_commit", "kind": "COMMAND", "source": "cometbft-testgen --stdin commit" }, { - "name": "cometbft_vote", + "name": "tendermint_vote", "kind": "COMMAND", "source": "cometbft-testgen --stdin vote" }, { - "name": "cometbft_time", + "name": "tendermint_time", "kind": "COMMAND", "source": "cometbft-testgen --stdin time" } diff --git a/testgen/src/lib.rs b/testgen/src/lib.rs index 0beb73a7..b157d17b 100644 --- a/testgen/src/lib.rs +++ b/testgen/src/lib.rs @@ -1,4 +1,4 @@ -//! `cometbft-testgen` is a small utility for producing CometBFT data +//! `cometbft-testgen` is a small utility for producing Tendermint data //! structures from minimal input (for testing purposes only). //! //! See the [repository] for details. @@ -8,7 +8,7 @@ #[macro_use] pub mod helpers; -/// Helper types for generating CometBFT datastructures +/// Helper types for generating Tendermint datastructures pub mod commit; pub mod consensus; pub mod generator; diff --git a/testgen/src/validator.rs b/testgen/src/validator.rs index 28e4a40d..663852bf 100644 --- a/testgen/src/validator.rs +++ b/testgen/src/validator.rs @@ -127,7 +127,7 @@ pub fn generate_validators(vals: &[Validator]) -> Result, S .collect::, SimpleError>>() } -/// A helper function to sort validators according to the CometBFT specs. +/// A helper function to sort validators according to the Tendermint specs. pub fn sort_validators(vals: &[Validator]) -> Vec { let mut sorted = vals.to_owned(); sorted.sort_by_key(|v| {