Skip to content

Commit

Permalink
feat: Updated code to remove bundled Ripple RPC (#639)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsenth200 authored Sep 27, 2024
1 parent 3270c70 commit 30012b7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main", "1.13.rc" ]
branches: [ "main", "1.14.rc" ]

env:
CARGO_TERM_COLOR: always
Expand Down
19 changes: 2 additions & 17 deletions core/main/src/state/openrpc_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use ripple_sdk::{
fb_capabilities::FireboltPermission,
fb_openrpc::{
CapabilitySet, FireboltOpenRpc, FireboltOpenRpcMethod, FireboltSemanticVersion,
FireboltVersionManifest, OpenRPCParser,
FireboltVersionManifest,
},
provider::ProviderAttributes,
},
Expand Down Expand Up @@ -78,19 +78,6 @@ pub struct OpenRpcState {
}

impl OpenRpcState {
fn load_additional_rpc(rpc: &mut FireboltOpenRpc, file_contents: &'static str) {
match serde_json::from_str::<OpenRPCParser>(file_contents) {
Ok(addl_rpc) => {
for m in addl_rpc.methods {
rpc.methods.push(m.clone());
}
}
Err(_) => {
error!("Could not read additional RPC file");
}
}
}

fn load_open_rpc(path: &str) -> Option<FireboltOpenRpc> {
match std::fs::read_to_string(path) {
Ok(content) => {
Expand Down Expand Up @@ -134,9 +121,7 @@ impl OpenRpcState {
let version_manifest: FireboltVersionManifest = serde_json::from_str(&open_rpc_path)
.expect("Failed parsing FireboltVersionManifest from open RPC file");
let firebolt_open_rpc: FireboltOpenRpc = version_manifest.clone().into();
let ripple_rpc_file = std::include_str!("./ripple-rpc.json");
let mut ripple_open_rpc: FireboltOpenRpc = FireboltOpenRpc::default();
Self::load_additional_rpc(&mut ripple_open_rpc, ripple_rpc_file);
let ripple_open_rpc: FireboltOpenRpc = FireboltOpenRpc::default();
let openrpc_validator: FireboltOpenRpcValidator = serde_json::from_str(&open_rpc_path)
.expect("Failed parsing FireboltOpenRpcValidator from open RPC file");
let v = OpenRpcState {
Expand Down

0 comments on commit 30012b7

Please sign in to comment.