let txid = context.rpc_server.broadcast_tx(TransactionTemplate {
inputs: &[(
2,
1,
0,
Inscription {
content_type: Some("text/plain".into()),
body: Some("hello".into()),
parent: Some(parent_inscription_id.parent_value()),
..Default::default()
}
.to_witness(),
)],
..Default::default()
});
context.mine_blocks(1);
let inscription_id = InscriptionId { txid, index: 0 };
assert_eq!(
context.index.get_parent_by_inscription_id(inscription_id),
parent_inscription_id
);
assert_eq!(
context
.index
.get_children_by_inscription_id(parent_inscription_id)
.unwrap(),
vec![inscription_id]
);
}
}
#[test]
fn parents_can_be_in_preceding_input() {
for context in Context::configurations() {
context.mine_blocks(1);
let parent_txid = context.rpc_server.broadcast_tx(TransactionTemplate {