Skip to content

Commit

Permalink
feat!: Bump grpc-interfaces and emulator defines
Browse files Browse the repository at this point in the history
Also add --version option and bump the version for the next release.
  • Loading branch information
vfusco committed Oct 10, 2023
1 parent 22d2504 commit 8c9655b
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- Updated libboost version to 1.81
- Updated grpc-interfaces
- Updated machine-emulator-defines
- Bumped version to 0.9.0

### Added
- Added \-\-version command line option

## [0.8.2] - 2023-08-21
### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/grpc-interfaces
15 changes: 13 additions & 2 deletions src/server-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ constexpr const uint64_t ROLLUP_ADVANCE_STATE = 0;
constexpr const uint64_t ROLLUP_INSPECT_STATE = 1;

static constexpr uint32_t manager_version_major = 0;
static constexpr uint32_t manager_version_minor = 8;
static constexpr uint32_t manager_version_patch = 2;
static constexpr uint32_t manager_version_minor = 9;
static constexpr uint32_t manager_version_patch = 0;
static constexpr const char *manager_version_pre_release = "";
static constexpr const char *manager_version_build = "";

Expand Down Expand Up @@ -3282,13 +3282,21 @@ where
passed to the spawned remote cartesi machine
default: localhost:0
--version
prints the server version number
--help
prints this message and exits
)",
name);
}

/// \brief Prints server_manager version
static void print_version() {
(void) fprintf(stderr, "%d.%d.%d\n", manager_version_major, manager_version_minor, manager_version_patch);
}

/// \brief Checks if string matches prefix and captures remaninder
/// \param pre Prefix to match in str.
/// \param str Input string
Expand Down Expand Up @@ -3345,6 +3353,9 @@ int main(int argc, char *argv[]) try {
;
} else if (stringval("--server-address=", argv[i], &server_address)) {
;
} else if (strcmp(argv[i], "--version") == 0) {
print_version();
exit(0);
} else if (strcmp(argv[i], "--help") == 0) {
help(argv[0]);
exit(0);
Expand Down
4 changes: 2 additions & 2 deletions src/test-server-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,12 @@ void assert_bool(bool value, const std::string &msg, const std::string &file, in
#define ASSERT_STATUS_CODE(s, f, v) assert_status_code(s, f, v, __FILE__, __LINE__)

static void test_get_version(const std::function<void(const std::string &title, test_function f)> &test) {
test("The server-manager server version should be 0.8.x", [](ServerManagerClient &manager) {
test("The server-manager server version should be 0.9.x", [](ServerManagerClient &manager) {
Versioning::GetVersionResponse response;
Status status = manager.get_version(response);
ASSERT_STATUS(status, "GetVersion", true);
ASSERT((response.version().major() == 0), "Version Major should be 0");
ASSERT((response.version().minor() == 8), "Version Minor should be 8");
ASSERT((response.version().minor() == 9), "Version Minor should be 9");
});
}

Expand Down

0 comments on commit 8c9655b

Please sign in to comment.