pub enum PoEFunctionType {
GeometricMean {},
Sigmoid {
max_points: Uint64,
p: Decimal,
s: Decimal,
},
SigmoidSqrt {
max_points: Uint64,
s: Decimal,
},
AlgebraicSigmoid {
max_points: Uint64,
a: Decimal,
p: Decimal,
s: Decimal,
},
}Variants§
GeometricMean
GeometricMean returns the geometric mean of staked amount and engagement points
Sigmoid
Sigmoid returns a sigmoid-like value of staked amount times engagement points. See the Proof-of-Engagement white-paper for details.
SigmoidSqrt
SigmoidSqrt returns a sigmoid-like value of the geometric mean of staked amount and
engagement points.
It is equal to Sigmoid with p = 0.5, but implemented using integer sqrt instead of
fixed-point fractional power.
AlgebraicSigmoid
AlgebraicSigmoid returns a sigmoid-like value of staked amount times engagement points.
It is similar to Sigmoid, but uses integer sqrt instead of a fixed-point exponential.
Implementations§
Source§impl PoEFunctionType
impl PoEFunctionType
pub fn to_poe_fn(&self) -> Result<Box<dyn PoEFunction>, ContractError>
Trait Implementations§
Source§impl Clone for PoEFunctionType
impl Clone for PoEFunctionType
Source§fn clone(&self) -> PoEFunctionType
fn clone(&self) -> PoEFunctionType
Returns a duplicate 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 PoEFunctionType
impl Debug for PoEFunctionType
Source§impl<'de> Deserialize<'de> for PoEFunctionType
impl<'de> Deserialize<'de> for PoEFunctionType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for PoEFunctionType
impl JsonSchema for PoEFunctionType
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for PoEFunctionType
impl PartialEq for PoEFunctionType
Source§impl Serialize for PoEFunctionType
impl Serialize for PoEFunctionType
impl Eq for PoEFunctionType
impl StructuralPartialEq for PoEFunctionType
Auto Trait Implementations§
impl Freeze for PoEFunctionType
impl RefUnwindSafe for PoEFunctionType
impl Send for PoEFunctionType
impl Sync for PoEFunctionType
impl Unpin for PoEFunctionType
impl UnwindSafe for PoEFunctionType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more