dpp/asset_lock/reduced_asset_lock_value/v0/
mod.rs1use crate::fee::Credits;
2#[cfg(feature = "json-conversion")]
3use crate::serialization::json_safe_fields;
4use bincode::{Decode, DecodeUntrusted, Encode};
5use platform_value::Bytes32;
6
7#[cfg_attr(feature = "json-conversion", json_safe_fields)]
11#[derive(
12 Debug, Clone, Encode, Decode, PartialEq, serde::Serialize, serde::Deserialize, DecodeUntrusted,
13)]
14pub struct AssetLockValueV0 {
15 pub(super) initial_credit_value: Credits,
16 pub(super) tx_out_script: Vec<u8>,
17 pub(super) remaining_credit_value: Credits,
18 pub(super) used_tags: Vec<Bytes32>,
22}
23
24pub trait AssetLockValueGettersV0 {
25 fn initial_credit_value(&self) -> Credits;
26 fn tx_out_script(&self) -> &Vec<u8>;
27
28 fn tx_out_script_owned(self) -> Vec<u8>;
29 fn remaining_credit_value(&self) -> Credits;
30
31 fn used_tags_ref(&self) -> &Vec<Bytes32>;
32}
33
34pub trait AssetLockValueSettersV0 {
35 fn set_initial_credit_value(&mut self, value: Credits);
36 fn set_tx_out_script(&mut self, value: Vec<u8>);
37 fn set_remaining_credit_value(&mut self, value: Credits);
38
39 fn set_used_tags(&mut self, tags: Vec<Bytes32>);
40 fn add_used_tag(&mut self, tag: Bytes32);
41}