pub struct NumericalDescriptor {
pub payout_function: PayoutFunction,
pub rounding_intervals: RoundingIntervals,
pub difference_params: Option<DifferenceParams>,
pub oracle_numeric_infos: OracleNumericInfo,
}
Expand description
Contains information about a contract based on a numerical outcome.
Fields§
§payout_function: PayoutFunction
The function representing the set of payouts.
rounding_intervals: RoundingIntervals
Rounding intervals enabling reducing the precision of the payout values which in turns reduces the number of required adaptor signatures.
difference_params: Option<DifferenceParams>
Information about the allowed differences in outcome value between oracles. If None, a quorum of oracle needs to sign the same value for the contract to be closeable.
oracle_numeric_infos: OracleNumericInfo
Information about base and number of digits for each oracle.
Implementations§
Source§impl NumericalDescriptor
impl NumericalDescriptor
Sourcepub fn get_range_payouts(
&self,
total_collateral: Amount,
) -> Result<Vec<RangePayout>, Error>
pub fn get_range_payouts( &self, total_collateral: Amount, ) -> Result<Vec<RangePayout>, Error>
Returns the set of RangePayout for the descriptor generated from the payout function.
Sourcepub fn validate(&self, max_value: u64) -> Result<(), Error>
pub fn validate(&self, max_value: u64) -> Result<(), Error>
Validate that the descriptor covers all possible outcomes of the given digit decomposition event descriptor.
Sourcepub fn get_payouts(
&self,
total_collateral: Amount,
) -> Result<Vec<Payout>, Error>
pub fn get_payouts( &self, total_collateral: Amount, ) -> Result<Vec<Payout>, Error>
Returns the set of payouts for the descriptor generated from the payout function.
Sourcepub fn verify_and_get_adaptor_info(
&self,
secp: &Secp256k1<All>,
total_collateral: Amount,
fund_pubkey: &PublicKey,
funding_script_pubkey: &Script,
fund_output_value: Amount,
threshold: usize,
precomputed_points: &[Vec<Vec<PublicKey>>],
cets: &[Transaction],
adaptor_pairs: &[EcdsaAdaptorSignature],
adaptor_index_start: usize,
) -> Result<(AdaptorInfo, usize), Error>
pub fn verify_and_get_adaptor_info( &self, secp: &Secp256k1<All>, total_collateral: Amount, fund_pubkey: &PublicKey, funding_script_pubkey: &Script, fund_output_value: Amount, threshold: usize, precomputed_points: &[Vec<Vec<PublicKey>>], cets: &[Transaction], adaptor_pairs: &[EcdsaAdaptorSignature], adaptor_index_start: usize, ) -> Result<(AdaptorInfo, usize), Error>
Verify the given set of adaptor signatures and generate the adaptor info.
Sourcepub fn get_adaptor_info(
&self,
secp: &Secp256k1<All>,
total_collateral: Amount,
fund_priv_key: &SecretKey,
funding_script_pubkey: &Script,
fund_output_value: Amount,
threshold: usize,
precomputed_points: &[Vec<Vec<PublicKey>>],
cets: &[Transaction],
adaptor_index_start: usize,
) -> Result<(AdaptorInfo, Vec<EcdsaAdaptorSignature>), Error>
pub fn get_adaptor_info( &self, secp: &Secp256k1<All>, total_collateral: Amount, fund_priv_key: &SecretKey, funding_script_pubkey: &Script, fund_output_value: Amount, threshold: usize, precomputed_points: &[Vec<Vec<PublicKey>>], cets: &[Transaction], adaptor_index_start: usize, ) -> Result<(AdaptorInfo, Vec<EcdsaAdaptorSignature>), Error>
Generate the set of adaptor signatures and the adaptor info.
Trait Implementations§
Source§impl Clone for NumericalDescriptor
impl Clone for NumericalDescriptor
Source§fn clone(&self) -> NumericalDescriptor
fn clone(&self) -> NumericalDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more