-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wallet Updates, Fixed clvm parsing issue, added condition utility fun…
…ctions
- Loading branch information
Showing
5 changed files
with
276 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,23 @@ | ||
use crate::blockchain::condition_opcode::ConditionOpcode; | ||
use crate::blockchain::condition_with_args::ConditionWithArgs; | ||
use crate::blockchain::sized_bytes::Bytes32; | ||
use dg_xch_macros::ChiaSerial; | ||
use dg_xch_serialize::{ChiaProtocolVersion, ChiaSerialize}; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(ChiaSerial, Clone, PartialEq, Eq, Serialize, Deserialize, Debug)] | ||
pub struct PendingPayment { | ||
pub puzzle_hash: Bytes32, | ||
pub amount: u64, | ||
} | ||
impl PendingPayment { | ||
pub fn to_create_coin_condition(&self) -> ConditionWithArgs { | ||
ConditionWithArgs { | ||
opcode: ConditionOpcode::CreateCoin, | ||
vars: vec![ | ||
self.puzzle_hash.to_bytes(ChiaProtocolVersion::default()), | ||
self.amount.to_bytes(ChiaProtocolVersion::default()), | ||
], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters