wip - add example of stx op to md file

This commit is contained in:
Pavitthra Pandurangan
2023-01-25 16:19:05 -05:00
parent 441ad8fbc4
commit 3d2b3e56b2
2 changed files with 48 additions and 1 deletions

View File

@@ -30,6 +30,12 @@ and any events emitted from Stacks transactions during the block.
If the transaction originally comes from the parent microblock stream
preceding this block, the microblock related fields will be filled in.
If the `raw_tx` field for a particular transaction is "0x00", that indicates
that it is a burnchain operation. A burnchain operation is a transaction that
is executed on the Stacks network, but was sent through the Bitcoin network.
The Stacks network supports a few specific burnchain operations. You can read
more about them [here](https://github.com/stacksgov/sips/blob/main/sips/sip-007/sip-007-stacking-consensus.md#stx-operations-on-bitcoin).
Example:
```json
@@ -78,8 +84,46 @@ Example:
"microblock_sequence": "3",
"microblock_hash": "0x9304fcbcc6daf5ac3f264522e0df50eddb5be85df6ee8a9fc2384c54274daaac",
"microblock_parent_hash": "0x4893ab44636023efa08374033428e44eca490582bd39a6e61f3b6cf749b474bd"
},
{
"burnchain_op": {
"TransferStx": {
"block_height": 208,
"burn_header_hash": [
55, 174,104,155,73,251,142,121,133,74,19,169,209,44,210,112,95,13,83,91,39,16,212,142,211,91,
234,92,56,7,85,250],
"memo": [],
"recipient": {
"bytes": "455e5d8c309ff012c55882cf7f50a4b542739b9c",
"version": 26
},
"sender": {
"bytes": "9ffdc100acf4d475b71a042b76fb4447966102ab",
"version": 26
},
"transfered_ustx": 100000,
"txid": "85aa2106186723f3c4f1d8bb58e3a02746ca9be1be9f4be0c6557079e1f660e6",
"vtxindex": 2
}
},
"contract_abi": null,
"execution_cost": {
"read_count": 0,
"read_length": 0,
"runtime": 0,
"write_count": 0,
"write_length": 0
},
"microblock_hash": null,
"microblock_parent_hash": null,
"microblock_sequence": null,
"raw_result": "0x0703",
"raw_tx": "0x00",
"status": "success",
"tx_index": 0,
"txid": "0x85aa2106186723f3c4f1d8bb58e3a02746ca9be1be9f4be0c6557079e1f660e6"
}
],
],
"matured_miner_rewards": [
{
"recipient": "ST31DA6FTSJX2WGTZ69SFY11BH51NZMB0ZZ239N96",

View File

@@ -1701,6 +1701,8 @@ fn stx_transfer_btc_integration_test() {
for tx in transactions.iter() {
let raw_tx = tx.get("raw_tx").unwrap().as_str().unwrap();
if raw_tx == "0x00" {
let dbg = format!("{:#}", tx);
info!("TX-BTC {}", dbg);
let burnchain_op = tx.get("burnchain_op").unwrap().as_object().unwrap();
if !burnchain_op.contains_key("TransferStx") {
panic!("unexpected btc transaction type");
@@ -1710,6 +1712,7 @@ fn stx_transfer_btc_integration_test() {
}
}
assert!(found_btc_tx);
assert!(false);
channel.stop_chains_coordinator();
}