Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Programmatically track version number for web3_clientVersion #149

Merged
merged 2 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
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