Skip to content

Commit

Permalink
Programatically track version number for web3_clientVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
njgheorghita committed Oct 20, 2021
1 parent dbf430f commit c1370fc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions trin-core/src/jsonrpc/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ lazy_static! {
static ref IPC_PATH: Mutex<String> = Mutex::new(String::new());
}

const VERSION: &str = env!("CARGO_PKG_VERSION");

pub fn launch_jsonrpc_server(
trin_config: TrinConfig,
infura_project_id: String,
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit c1370fc

Please # to comment.