Move SLOTS_PER_SEGMENT to genesis (#4992)

automerge
This commit is contained in:
Sagar Dhawan
2019-07-09 16:48:40 -07:00
committed by Grimes
parent 32b55e6703
commit b8e7736af2
19 changed files with 315 additions and 162 deletions

View File

@@ -143,6 +143,10 @@ impl JsonRpcRequestProcessor {
Ok(self.storage_state.get_slot())
}
fn get_slots_per_segment(&self) -> Result<u64> {
Ok(self.bank().slots_per_segment())
}
fn get_storage_pubkeys_for_slot(&self, slot: u64) -> Result<Vec<Pubkey>> {
Ok(self
.storage_state
@@ -265,6 +269,9 @@ pub trait RpcSol {
#[rpc(meta, name = "getStorageSlot")]
fn get_storage_slot(&self, _: Self::Metadata) -> Result<u64>;
#[rpc(meta, name = "getSlotsPerSegment")]
fn get_slots_per_segment(&self, _: Self::Metadata) -> Result<u64>;
#[rpc(meta, name = "getStoragePubkeysForSlot")]
fn get_storage_pubkeys_for_slot(&self, _: Self::Metadata, _: u64) -> Result<Vec<Pubkey>>;
@@ -531,6 +538,13 @@ impl RpcSol for RpcSolImpl {
meta.request_processor.read().unwrap().get_storage_slot()
}
fn get_slots_per_segment(&self, meta: Self::Metadata) -> Result<u64> {
meta.request_processor
.read()
.unwrap()
.get_slots_per_segment()
}
fn get_storage_pubkeys_for_slot(&self, meta: Self::Metadata, slot: u64) -> Result<Vec<Pubkey>> {
meta.request_processor
.read()