Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Dec 4, 2024
1 parent 3f0bb54 commit 8b4bd21
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion crates/chia-sdk-driver/src/spend_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl SpendContext {
where
T: Mod,
{
self.puzzle(T::HASH, T::REVEAL)
self.puzzle(T::MOD_HASH, T::MOD_REVEAL)
}

pub fn curry<T>(&mut self, args: T) -> Result<NodePtr, DriverError>
Expand Down
46 changes: 23 additions & 23 deletions crates/chia-sdk-types/src/puzzle_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ use clvm_traits::ToClvm;
use clvm_utils::{CurriedProgram, TreeHash, TreeHasher};

pub trait Mod {
const REVEAL: &[u8];
const HASH: TreeHash;
const MOD_REVEAL: &[u8];
const MOD_HASH: TreeHash;

fn curry_tree_hash(&self) -> TreeHash
where
Self: Sized + ToClvm<TreeHasher>,
{
CurriedProgram {
program: Self::HASH,
program: Self::MOD_HASH,
args: self,
}
.to_clvm(&mut TreeHasher)
Expand All @@ -36,51 +36,51 @@ pub trait Mod {
}

impl Mod for StandardArgs {
const REVEAL: &[u8] = &STANDARD_PUZZLE;
const HASH: TreeHash = STANDARD_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &STANDARD_PUZZLE;
const MOD_HASH: TreeHash = STANDARD_PUZZLE_HASH;
}

impl<I> Mod for CatArgs<I> {
const REVEAL: &[u8] = &CAT_PUZZLE;
const HASH: TreeHash = CAT_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &CAT_PUZZLE;
const MOD_HASH: TreeHash = CAT_PUZZLE_HASH;
}

impl<I, M> Mod for DidArgs<I, M> {
const REVEAL: &[u8] = &DID_INNER_PUZZLE;
const HASH: TreeHash = DID_INNER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &DID_INNER_PUZZLE;
const MOD_HASH: TreeHash = DID_INNER_PUZZLE_HASH;
}

impl Mod for NftIntermediateLauncherArgs {
const REVEAL: &[u8] = &NFT_INTERMEDIATE_LAUNCHER_PUZZLE;
const HASH: TreeHash = NFT_INTERMEDIATE_LAUNCHER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &NFT_INTERMEDIATE_LAUNCHER_PUZZLE;
const MOD_HASH: TreeHash = NFT_INTERMEDIATE_LAUNCHER_PUZZLE_HASH;
}

impl Mod for NftRoyaltyTransferPuzzleArgs {
const REVEAL: &[u8] = &NFT_ROYALTY_TRANSFER_PUZZLE;
const HASH: TreeHash = NFT_ROYALTY_TRANSFER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &NFT_ROYALTY_TRANSFER_PUZZLE;
const MOD_HASH: TreeHash = NFT_ROYALTY_TRANSFER_PUZZLE_HASH;
}

impl<I, P> Mod for NftOwnershipLayerArgs<I, P> {
const REVEAL: &[u8] = &NFT_OWNERSHIP_LAYER_PUZZLE;
const HASH: TreeHash = NFT_OWNERSHIP_LAYER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &NFT_OWNERSHIP_LAYER_PUZZLE;
const MOD_HASH: TreeHash = NFT_OWNERSHIP_LAYER_PUZZLE_HASH;
}

impl<I, M> Mod for NftStateLayerArgs<I, M> {
const REVEAL: &[u8] = &NFT_STATE_LAYER_PUZZLE;
const HASH: TreeHash = NFT_STATE_LAYER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &NFT_STATE_LAYER_PUZZLE;
const MOD_HASH: TreeHash = NFT_STATE_LAYER_PUZZLE_HASH;
}

impl<I> Mod for SingletonArgs<I> {
const REVEAL: &[u8] = &SINGLETON_TOP_LAYER_PUZZLE;
const HASH: TreeHash = SINGLETON_TOP_LAYER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &SINGLETON_TOP_LAYER_PUZZLE;
const MOD_HASH: TreeHash = SINGLETON_TOP_LAYER_PUZZLE_HASH;
}

impl Mod for EverythingWithSignatureTailArgs {
const REVEAL: &[u8] = &EVERYTHING_WITH_SIGNATURE_TAIL_PUZZLE;
const HASH: TreeHash = EVERYTHING_WITH_SIGNATURE_TAIL_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &EVERYTHING_WITH_SIGNATURE_TAIL_PUZZLE;
const MOD_HASH: TreeHash = EVERYTHING_WITH_SIGNATURE_TAIL_PUZZLE_HASH;
}

impl Mod for GenesisByCoinIdTailArgs {
const REVEAL: &[u8] = &GENESIS_BY_COIN_ID_TAIL_PUZZLE;
const HASH: TreeHash = GENESIS_BY_COIN_ID_TAIL_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &GENESIS_BY_COIN_ID_TAIL_PUZZLE;
const MOD_HASH: TreeHash = GENESIS_BY_COIN_ID_TAIL_PUZZLE_HASH;
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ pub struct DelegationLayerSolution<P, S> {
}

impl Mod for DelegationLayerArgs {
const REVEAL: &[u8] = &DELEGATION_LAYER_PUZZLE;
const HASH: TreeHash = DELEGATION_LAYER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &DELEGATION_LAYER_PUZZLE;
const MOD_HASH: TreeHash = DELEGATION_LAYER_PUZZLE_HASH;
}
4 changes: 2 additions & 2 deletions crates/chia-sdk-types/src/puzzles/datalayer/writer_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ pub struct WriterLayerSolution<I> {
}

impl<I> Mod for WriterLayerArgs<I> {
const REVEAL: &[u8] = &WRITER_LAYER_PUZZLE;
const HASH: TreeHash = WRITER_LAYER_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &WRITER_LAYER_PUZZLE;
const MOD_HASH: TreeHash = WRITER_LAYER_PUZZLE_HASH;
}
4 changes: 2 additions & 2 deletions crates/chia-sdk-types/src/puzzles/p2_delegated_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ impl P2DelegatedConditionsArgs {
}

impl Mod for P2DelegatedConditionsArgs {
const REVEAL: &[u8] = &P2_DELEGATED_CONDITIONS_PUZZLE;
const HASH: TreeHash = P2_DELEGATED_CONDITIONS_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &P2_DELEGATED_CONDITIONS_PUZZLE;
const MOD_HASH: TreeHash = P2_DELEGATED_CONDITIONS_PUZZLE_HASH;
}

#[derive(Debug, Clone, PartialEq, Eq, ToClvm, FromClvm)]
Expand Down
4 changes: 2 additions & 2 deletions crates/chia-sdk-types/src/puzzles/p2_delegated_singleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct P2DelegatedSingletonArgs {
}

impl Mod for P2DelegatedSingletonArgs {
const REVEAL: &[u8] = &P2_DELEGATED_SINGLETON_PUZZLE;
const HASH: TreeHash = P2_DELEGATED_SINGLETON_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &P2_DELEGATED_SINGLETON_PUZZLE;
const MOD_HASH: TreeHash = P2_DELEGATED_SINGLETON_PUZZLE_HASH;
}

impl P2DelegatedSingletonArgs {
Expand Down
4 changes: 2 additions & 2 deletions crates/chia-sdk-types/src/puzzles/p2_one_of_many.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ pub struct P2OneOfManyArgs {
}

impl Mod for P2OneOfManyArgs {
const REVEAL: &[u8] = &P2_ONE_OF_MANY_PUZZLE;
const HASH: TreeHash = P2_ONE_OF_MANY_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &P2_ONE_OF_MANY_PUZZLE;
const MOD_HASH: TreeHash = P2_ONE_OF_MANY_PUZZLE_HASH;
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, ToClvm, FromClvm)]
Expand Down
4 changes: 2 additions & 2 deletions crates/chia-sdk-types/src/puzzles/p2_singleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct P2SingletonArgs {
}

impl Mod for P2SingletonArgs {
const REVEAL: &[u8] = &P2_SINGLETON_PUZZLE;
const HASH: TreeHash = P2_SINGLETON_PUZZLE_HASH;
const MOD_REVEAL: &[u8] = &P2_SINGLETON_PUZZLE;
const MOD_HASH: TreeHash = P2_SINGLETON_PUZZLE_HASH;
}

impl P2SingletonArgs {
Expand Down

0 comments on commit 8b4bd21

Please sign in to comment.