Struct noah_api::anon_xfr::structs::OpenAnonAssetRecordBuilder
source · pub struct OpenAnonAssetRecordBuilder { /* private fields */ }Expand description
The builder for an opened anonymous asset record.
Implementations§
source§impl OpenAnonAssetRecordBuilder
impl OpenAnonAssetRecordBuilder
sourcepub fn asset_type(self, asset_type: AssetType) -> Self
pub fn asset_type(self, asset_type: AssetType) -> Self
Specify asset_type
sourcepub fn mt_leaf_info(self, mt_leaf_info: MTLeafInfo) -> Self
pub fn mt_leaf_info(self, mt_leaf_info: MTLeafInfo) -> Self
Update mt_leaf_info
sourcepub fn finalize<R: CryptoRng + RngCore>(self, prng: &mut R) -> Result<Self>
pub fn finalize<R: CryptoRng + RngCore>(self, prng: &mut R) -> Result<Self>
Finalize builder:
If built via constructor + builder methods, it samples commitment blinding and key randomization factor and
creates associated owner memo.
If built via Self::from_abar(...), return Err(NoahError::InconsistentStructureError)
sourcepub fn build(self) -> Result<OpenAnonAssetRecord>
pub fn build(self) -> Result<OpenAnonAssetRecord>
Run a sanity check and if ok, return Ok(OpenBlindAssetRecord)
source§impl OpenAnonAssetRecordBuilder
impl OpenAnonAssetRecordBuilder
sourcepub fn from_abar(
record: &AnonAssetRecord,
owner_memo: AxfrOwnerMemo,
key_pair: &KeyPair
) -> Result<Self>
pub fn from_abar(
record: &AnonAssetRecord,
owner_memo: AxfrOwnerMemo,
key_pair: &KeyPair
) -> Result<Self>
Build an OpenAssetRecord from an BlindAssetRecord, opening keys, owner memo and decryption keys
Return error if decrypted owner_memo is inconsistent with record
Trait Implementations§
source§impl Default for OpenAnonAssetRecordBuilder
impl Default for OpenAnonAssetRecordBuilder
source§fn default() -> OpenAnonAssetRecordBuilder
fn default() -> OpenAnonAssetRecordBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for OpenAnonAssetRecordBuilder
impl Send for OpenAnonAssetRecordBuilder
impl Sync for OpenAnonAssetRecordBuilder
impl Unpin for OpenAnonAssetRecordBuilder
impl UnwindSafe for OpenAnonAssetRecordBuilder
Blanket Implementations§
§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
Called to initialize a place to a valid value, after it is set
to all-bits-zero. Read more