Add the stateId when registering a new state
This commit is contained in:
parent
e563ae7cca
commit
d30a6e6310
@ -2,7 +2,9 @@ use std::str::FromStr;
|
||||
|
||||
use anyhow::{Error, Result};
|
||||
|
||||
use bitcoincore_rpc::bitcoin::hex::DisplayHex;
|
||||
use hex::FromHex;
|
||||
use sdk_common::pcd::Pcd;
|
||||
use sdk_common::silentpayments::create_transaction;
|
||||
use sdk_common::sp_client::spclient::Recipient;
|
||||
use sdk_common::network::CommitMessage;
|
||||
@ -63,11 +65,16 @@ fn handle_initial_transaction(tx: Transaction, commit_msg: &CommitMessage) -> Re
|
||||
// return Err(Error::msg("Role commitment mismatch"));
|
||||
// }
|
||||
|
||||
let pcd_commitment = &commit_msg.pcd_commitment;
|
||||
|
||||
let merkle_root_bin = pcd_commitment.create_merkle_tree()?.root().unwrap();
|
||||
|
||||
let mut new_process = Process::new(root_commitment);
|
||||
let init_state = ProcessState {
|
||||
commited_in: root_commitment,
|
||||
encrypted_pcd: roles_only_map,
|
||||
pcd_commitment: commit_msg.pcd_commitment.clone(),
|
||||
merkle_root: merkle_root_bin.to_lower_hex_string(),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user