Struct near_vm_logic::profile::ProfileDataV2
source · pub struct ProfileDataV2 { /* private fields */ }
Expand description
Deprecated serialization format to store profiles in the database.
There is no ProfileDataV1 because meta data V1 did no have profiles. Counting thus starts with 2 to match the meta data version numbers.
This is not part of the protocol but archival nodes still rely on this not changing to answer old tx-status requests with a gas profile.
It used to store an array that manually mapped enum Cost
to gas
numbers. Now ProfileDataV2
and Cost
are deprecated. But to lookup
old gas profiles from the DB, we need to keep the code around.
Implementations§
source§impl ProfileDataV2
impl ProfileDataV2
pub fn get_ext_cost(&self, ext: ExtCosts) -> u64
pub fn get_wasm_cost(&self) -> u64
sourcepub fn legacy_action_costs(&self) -> Vec<(&'static str, u64), Global> ⓘ
pub fn legacy_action_costs(&self) -> Vec<(&'static str, u64), Global> ⓘ
List action cost in the old way, which conflated several action parameters into one.
This is used to display old gas profiles on the RPC API and in debug output.
pub fn action_gas(&self) -> u64
sourcepub fn test() -> ProfileDataV2
pub fn test() -> ProfileDataV2
Test instance with unique numbers in each field.
Trait Implementations§
source§impl BorshDeserialize for ProfileDataV2where
DataArray: BorshDeserialize,
impl BorshDeserialize for ProfileDataV2where DataArray: BorshDeserialize,
source§fn deserialize(buf: &mut &[u8]) -> Result<ProfileDataV2, Error>
fn deserialize(buf: &mut &[u8]) -> Result<ProfileDataV2, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
source§impl BorshSerialize for ProfileDataV2where
DataArray: BorshSerialize,
impl BorshSerialize for ProfileDataV2where DataArray: BorshSerialize,
source§impl Clone for ProfileDataV2
impl Clone for ProfileDataV2
source§fn clone(&self) -> ProfileDataV2
fn clone(&self) -> ProfileDataV2
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProfileDataV2
impl Debug for ProfileDataV2
source§impl Default for ProfileDataV2
impl Default for ProfileDataV2
source§fn default() -> ProfileDataV2
fn default() -> ProfileDataV2
Returns the “default value” for a type. Read more
source§impl Index<ActionCosts> for ProfileDataV2
impl Index<ActionCosts> for ProfileDataV2
source§fn index(
&self,
cost: ActionCosts
) -> &<ProfileDataV2 as Index<ActionCosts>>::Output
fn index( &self, cost: ActionCosts ) -> &<ProfileDataV2 as Index<ActionCosts>>::Output
Performs the indexing (
container[index]
) operation. Read moresource§impl Index<ExtCosts> for ProfileDataV2
impl Index<ExtCosts> for ProfileDataV2
source§impl PartialEq<ProfileDataV2> for ProfileDataV2
impl PartialEq<ProfileDataV2> for ProfileDataV2
source§fn eq(&self, other: &ProfileDataV2) -> bool
fn eq(&self, other: &ProfileDataV2) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ProfileDataV2
impl StructuralEq for ProfileDataV2
impl StructuralPartialEq for ProfileDataV2
Auto Trait Implementations§
impl RefUnwindSafe for ProfileDataV2
impl Send for ProfileDataV2
impl Sync for ProfileDataV2
impl Unpin for ProfileDataV2
impl UnwindSafe for ProfileDataV2
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request