Skip to content

Commit 2a661c9

Browse files
committed
needed this as well
1 parent 0149788 commit 2a661c9

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

bindings/reward_distributor.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,14 @@
413413
"locked_nft": "Nft"
414414
},
415415
"return": "RewardDistributorUnstakeResult"
416+
},
417+
"locked_nft_hint": {
418+
"type": "static",
419+
"args": {
420+
"distributor_launcher_id": "Bytes32",
421+
"custody_puzzle_hash": "Bytes32"
422+
},
423+
"return": "Bytes32"
416424
}
417425
}
418426
}

crates/chia-sdk-bindings/src/action_layer/reward_distributor.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ use chia_sdk_driver::{
1414
RewardDistributorWithdrawIncentivesAction, RoundRewardInfo, RoundTimeInfo, SpendContext,
1515
};
1616
use chia_sdk_types::{
17-
puzzles::{IntermediaryCoinProof, NftLauncherProof, RewardDistributorSlotNonce},
18-
Conditions,
17+
puzzles::{
18+
IntermediaryCoinProof, NftLauncherProof, NonceWrapperArgs, RewardDistributorSlotNonce,
19+
},
20+
Conditions, Mod,
1921
};
2022
use clvm_utils::{ToTreeHash, TreeHash};
2123

@@ -574,4 +576,17 @@ impl RewardDistributor {
574576
payment_amount,
575577
})
576578
}
579+
580+
pub fn locked_nft_hint(
581+
distributor_launcher_id: Bytes32,
582+
custody_puzzle_hash: Bytes32,
583+
) -> Result<Bytes32> {
584+
Ok(NonceWrapperArgs::<Bytes32, TreeHash> {
585+
nonce: custody_puzzle_hash,
586+
inner_puzzle: RewardDistributorStakeAction::my_p2_puzzle_hash(distributor_launcher_id)
587+
.into(),
588+
}
589+
.curry_tree_hash()
590+
.into())
591+
}
577592
}

0 commit comments

Comments
 (0)