From c1370fcce833761e59179f447903f52dfc36ba6c Mon Sep 17 00:00:00 2001 From: Nick Gheorghita Date: Wed, 20 Oct 2021 11:14:24 -0400 Subject: [PATCH 1/2] Programatically track version number for web3_clientVersion --- trin-core/src/jsonrpc/service.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trin-core/src/jsonrpc/service.rs b/trin-core/src/jsonrpc/service.rs index b5e998272..bda84dd5a 100644 --- a/trin-core/src/jsonrpc/service.rs +++ b/trin-core/src/jsonrpc/service.rs @@ -24,6 +24,8 @@ lazy_static! { static ref IPC_PATH: Mutex = Mutex::new(String::new()); } +const VERSION: &str = env!("CARGO_PKG_VERSION"); + pub fn launch_jsonrpc_server( trin_config: TrinConfig, infura_project_id: String, @@ -256,8 +258,7 @@ fn dispatch_trin_request( TrinEndpoint::PortalEndpoint(_) => Ok(json!({ "jsonrpc": "2.0", "id": obj.id, - // todo: this should be updated programatically - "result": "trin 0.0.1-alpha", + "result": format!("trin v{}", VERSION), }) .to_string()), TrinEndpoint::InfuraEndpoint(_) => dispatch_infura_request(obj, infura_url), From b41655713c81a651a60380fb82d5126261f74792 Mon Sep 17 00:00:00 2001 From: Nick Gheorghita Date: Thu, 21 Oct 2021 10:42:44 -0400 Subject: [PATCH 2/2] Add note to contributing guidelines about release versions --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06b6cc761..4b7562331 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -167,6 +167,10 @@ want to contribute back to the PR (and the author has this enabled), we would still need to add their remote explicitly. +## Releases +- When cutting a new release, the versions of every crate in this repo should be updated simultaneously to the new version. + + ## Tests Testing is essential to the production of software with minimal flaws. The default should always be writing tests for the code you produce.