Skip to content
This repository was archived by the owner on Dec 4, 2024. It is now read-only.

Commit 66a4294

Browse files
authored
fix: publish p2tr public key on stacks (#257)
1 parent 979a231 commit 66a4294

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

romeo/src/system.rs

+11-5
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@ async fn get_contract_block_height(
192192
.await
193193
.get_contract_block_height(config.contract_name.clone())
194194
.await
195-
.expect("Could not get block height");
195+
.expect("Could not get block height. Binary needs to be restarted after contract deployment.");
196196

197197
let bitcoin_block_height = client
198198
.lock()
199199
.await
200200
.get_bitcoin_block_height(block_height)
201201
.await
202-
.expect("Could not get burnchain block height");
202+
.expect("Could not get burnchain block height. Binary needs to be restarted after bitcoin node is online again.");
203203

204204
Event::ContractBlockHeight(block_height, bitcoin_block_height)
205205
}
@@ -217,9 +217,15 @@ async fn update_contract_public_key(
217217
TransactionSpendingCondition::new_singlesig_p2pkh(public_key).unwrap(),
218218
);
219219

220-
let function_args =
221-
vec![Value::buff_from(public_key.to_bytes_compressed())
222-
.expect("Cannot convert public key into a Clarity Value")];
220+
let function_args = vec![Value::buff_from(
221+
config
222+
.bitcoin_credentials
223+
.public_key_p2tr()
224+
.serialize()
225+
.try_into()
226+
.unwrap(),
227+
)
228+
.expect("Cannot convert public key into a Clarity Value")];
223229

224230
let addr = StacksAddress::consensus_deserialize(&mut Cursor::new(
225231
config.stacks_credentials.address().serialize_to_vec(),

0 commit comments

Comments
 (0)