pub struct Parameters<Pk, Qk, Rk, Sk, Addr, Ti, F, Pr> {
Show 15 fields pub buy: Pk, pub cancel: Pk, pub refund: Pk, pub punish: Option<Pk>, pub adaptor: Pk, pub extra_arbitrating_keys: Vec<TaggedElement<u16, Pk>>, pub arbitrating_shared_keys: Vec<TaggedElement<SharedKeyId, Rk>>, pub spend: Qk, pub extra_accordant_keys: Vec<TaggedElement<u16, Qk>>, pub accordant_shared_keys: Vec<TaggedElement<SharedKeyId, Sk>>, pub proof: Option<Pr>, pub destination_address: Addr, pub cancel_timelock: Option<Ti>, pub punish_timelock: Option<Ti>, pub fee_strategy: Option<FeeStrategy<F>>,
}
Expand description

One has to produce a set of parameters at the start of a swap and receive a mostly equivalent set from counter-party during the reveal procedure. Container for all the parameters a participant needs to execture a swap.

The proof is optional because one receives the proof after receiving the parameters in the receal process, the option allows to create the struct at the first step and add the swap if needed later.

Timelocks and fee strategy are only present in the local set of parameters and not part of the reveal process, thus they are optional too.

Fields§

§buy: Pk§cancel: Pk§refund: Pk§punish: Option<Pk>§adaptor: Pk§extra_arbitrating_keys: Vec<TaggedElement<u16, Pk>>§arbitrating_shared_keys: Vec<TaggedElement<SharedKeyId, Rk>>§spend: Qk§extra_accordant_keys: Vec<TaggedElement<u16, Qk>>§accordant_shared_keys: Vec<TaggedElement<SharedKeyId, Sk>>§proof: Option<Pr>§destination_address: Addr§cancel_timelock: Option<Ti>§punish_timelock: Option<Ti>§fee_strategy: Option<FeeStrategy<F>>

Implementations§

Generates protocol message that commits to Alice’s parameters.

Create the reveal protocol message based on the set of parameters.

Generates protocol message that commits to Bob’s parameters.

Create the reveal protocol message based on the set of parameters.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Decode an object with a well-defined format
Deserialize this value from the given Serde deserializer. Read more
Encode an object with a well-defined format, should only ever error if the underlying encoder errors. If successful, returns size of the encoded object in bytes. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
Serialize this value into the given Serde serializer. Read more
Decode with the given std::io::Read instance; must either construct an instance or return implementation-specific error type.
Tries to deserialize byte array into the current type using StrictDecode::strict_decode. If there are some data remains in the buffer once deserialization is completed, fails with Error::DataNotEntirelyConsumed. Use io::Cursor over the buffer and StrictDecode::strict_decode to avoid such failures.
Reads data from file at path and reconstructs object from it. Fails with Error::DataNotEntirelyConsumed if file contains remaining data after the object reconstruction.
Encode with the given std::io::Write instance; must return result with either amount of bytes encoded – or implementation-specific error type.
Serializes data as a byte array using StrictEncode::strict_encode function
Saves data to a file at a given path. If the file does not exists, attempts to create the file. If the file already exists, it gets truncated.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Converts self into T using Into<T>. Read more
Causes self to use its Binary implementation when Debug-formatted.
Causes self to use its Display implementation when Debug-formatted.
Causes self to use its LowerExp implementation when Debug-formatted.
Causes self to use its LowerHex implementation when Debug-formatted.
Causes self to use its Octal implementation when Debug-formatted.
Causes self to use its Pointer implementation when Debug-formatted.
Causes self to use its UpperExp implementation when Debug-formatted.
Causes self to use its UpperHex implementation when Debug-formatted.
Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Returns a new instance of the invocant that will be marked with M. Read more
Pipes by value. This is generally the method you want to use. Read more
Borrows self and passes that borrow into the pipe function. Read more
Mutably borrows self and passes that borrow into the pipe function. Read more
Borrows self, then passes self.borrow() into the pipe function. Read more
Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Borrows self, then passes self.as_ref() into the pipe function.
Mutably borrows self, then passes self.as_mut() into the pipe function.
Borrows self, then passes self.deref() into the pipe function.
Mutably borrows self, then passes self.deref_mut() into the pipe function.
Should always be Self
Immutable access to a value. Read more
Mutable access to a value. Read more
Immutable access to the Borrow<B> of a value. Read more
Mutable access to the BorrowMut<B> of a value. Read more
Immutable access to the AsRef<R> view of a value. Read more
Mutable access to the AsMut<R> view of a value. Read more
Immutable access to the Deref::Target of a value. Read more
Mutable access to the Deref::Target of a value. Read more
Calls .tap() only in debug builds, and is erased in release builds.
Calls .tap_mut() only in debug builds, and is erased in release builds.
Calls .tap_borrow() only in debug builds, and is erased in release builds.
Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Calls .tap_ref() only in debug builds, and is erased in release builds.
Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Calls .tap_deref() only in debug builds, and is erased in release builds.
Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Attempts to convert self into T using TryInto<T>. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.