1
1
use std:: collections:: HashMap ;
2
- use std:: str:: FromStr ;
3
2
use std:: time:: { SystemTime , UNIX_EPOCH } ;
4
3
5
4
use chia:: bls:: { sign, verify, PublicKey , SecretKey , Signature } ;
@@ -28,13 +27,14 @@ use chia_wallet_sdk::client::{ClientError, Peer};
28
27
use chia_wallet_sdk:: driver:: {
29
28
get_merkle_tree, DataStore , DataStoreMetadata , DelegatedPuzzle , Did , DidInfo , DriverError ,
30
29
IntermediateLauncher , Launcher , Layer , NftMint , OracleLayer ,
31
- Puzzle , SpendContext , SpendWithConditions , StandardLayer , WriterLayer ,
30
+ SpendContext , SpendWithConditions , StandardLayer , WriterLayer ,
32
31
} ;
33
- use chia_wallet_sdk:: prelude:: { EveProof , LineageProof , Proof } ;
32
+ // Import proof types from our own crate's rust module
33
+ use crate :: rust:: { EveProof , LineageProof , Proof } ;
34
34
use chia_wallet_sdk:: signer:: { AggSigConstants , RequiredSignature , SignerError } ;
35
35
use chia_wallet_sdk:: types:: {
36
36
announcement_id,
37
- conditions:: { CreateCoin , MeltSingleton , Memos , TransferNft , UpdateDataStoreMerkleRoot } ,
37
+ conditions:: { CreateCoin , MeltSingleton , Memos , UpdateDataStoreMerkleRoot } ,
38
38
Condition , Conditions , MAINNET_CONSTANTS , TESTNET11_CONSTANTS ,
39
39
} ;
40
40
use chia_wallet_sdk:: utils:: { self , CoinSelectionError } ;
@@ -1287,7 +1287,7 @@ pub async fn mint_nft(
1287
1287
} ;
1288
1288
1289
1289
// Create the DID singleton info (simplified DID structure)
1290
- let did_info = DidInfo :: new ( did_coin. coin_id ( ) , None , 1 , vec ! [ ] , synthetic_key. derive_synthetic ( ) ) ;
1290
+ let did_info = DidInfo :: new ( did_coin. coin_id ( ) , None , 1 , vec ! [ ] , synthetic_key. derive_synthetic ( ) . to_bytes ( ) . into ( ) ) ;
1291
1291
1292
1292
let did = Did :: new ( did_coin, did_proof, did_info) ;
1293
1293
@@ -1308,7 +1308,7 @@ pub async fn mint_nft(
1308
1308
// Use IntermediateLauncher to mint the NFT
1309
1309
let ( mint_conditions, _nft) = IntermediateLauncher :: new ( did_coin. coin_id ( ) , 0 , 1 )
1310
1310
. create ( & mut ctx) ?
1311
- . mint_nft ( & mut ctx, & nft_mint) ?;
1311
+ . mint_nft ( & mut ctx, nft_mint) ?;
1312
1312
1313
1313
// Update the DID with the mint conditions
1314
1314
let _updated_did = did. update ( & mut ctx, & p2, mint_conditions) ?;
@@ -1439,12 +1439,12 @@ pub async fn generate_did_proof_from_chain(
1439
1439
. spent_height
1440
1440
. ok_or ( WalletError :: UnknownCoin ) ?;
1441
1441
1442
- let parent_spend = peer
1442
+ let _parent_spend = peer
1443
1443
. request_puzzle_and_solution ( parent_coin_state. coin . coin_id ( ) , parent_spend_height as u32 )
1444
1444
. await ?
1445
1445
. map_err ( |_| WalletError :: RejectPuzzleSolution ) ?;
1446
1446
1447
- let mut allocator = Allocator :: new ( ) ;
1447
+ let _allocator = Allocator :: new ( ) ;
1448
1448
1449
1449
// For now, create a basic lineage proof
1450
1450
// This is a simplified approach - in production you'd want to properly parse the parent DID
@@ -1549,7 +1549,7 @@ pub async fn resolve_did_string_and_generate_proof(
1549
1549
use chia_wallet_sdk:: utils:: Address ;
1550
1550
let address = Address :: decode ( bech32_part) . map_err ( |_| WalletError :: Parse ) ?;
1551
1551
1552
- let did_id = address. puzzle_hash ( ) ;
1552
+ let did_id = address. puzzle_hash ;
1553
1553
1554
1554
// First, get the launcher coin state to find the first DID coin
1555
1555
let launcher_states = peer
@@ -1589,7 +1589,7 @@ pub async fn resolve_did_string_and_generate_proof(
1589
1589
let launcher_puzzle = launcher_spend. puzzle . to_clvm ( & mut allocator) ?;
1590
1590
let launcher_solution = launcher_spend. solution . to_clvm ( & mut allocator) ?;
1591
1591
1592
- let output = clvmr:: run_program ( & mut allocator, launcher_puzzle, launcher_solution, u64:: MAX , None )
1592
+ let output = clvmr:: run_program ( & mut allocator, & clvmr :: ChiaDialect :: new ( 0 ) , launcher_puzzle, launcher_solution, u64:: MAX )
1593
1593
. map_err ( |_| WalletError :: Clvm ) ?;
1594
1594
1595
1595
let conditions =
@@ -1650,7 +1650,7 @@ pub async fn resolve_did_string_and_generate_proof(
1650
1650
let spend_puzzle = spend. puzzle . to_clvm ( & mut allocator) ?;
1651
1651
let spend_solution = spend. solution . to_clvm ( & mut allocator) ?;
1652
1652
1653
- let spend_output = clvmr:: run_program ( & mut allocator, spend_puzzle, spend_solution, u64:: MAX , None )
1653
+ let spend_output = clvmr:: run_program ( & mut allocator, & clvmr :: ChiaDialect :: new ( 0 ) , spend_puzzle, spend_solution, u64:: MAX )
1654
1654
. map_err ( |_| WalletError :: Clvm ) ?;
1655
1655
1656
1656
let spend_conditions = Vec :: < Condition > :: from_clvm ( & allocator, spend_output. 1 )
0 commit comments