SHOWING: First 60
self.commit(wtx, value_cache)?;
value_cache = HashMap::new();
uncommitted = 0;
wtx = self.index.begin_write()?;
let height = wtx
.open_table(HEIGHT_TO_BLOCK_HASH)?
.range(0..)?
.next_back()
.and_then(|result| result.ok())
.map(|(height, _hash)| height.value() + 1)
.unwrap_or(0);
if height != self.height {
// another update has run between committing and beginning the new
// write transaction
break;
}
wtx
.open_table(WRITE_TRANSACTION_STARTING_BLOCK_COUNT_TO_TIMESTAMP)?
.insert(
&self.height,
&SystemTime::now()
.duration_since(SystemTime::UNIX_EPOCH)
.map(|duration| duration.as_millis())
.unwrap_or(0),
)?;
}
if SHUTTING_DOWN.load(atomic::Ordering::Relaxed) {
break;
}
}
if uncommitted > 0 {
self.commit(wtx, value_cache)?;
}
#45,022,450text ))
.rpc_server(&rpc_server)
.expected_exit_code(1)
.expected_stderr(format!(
"error: cannot send {output}:329 without also sending inscription {inscription} at {output}:0\n"
))
.run_and_extract_stdout();
}
#[test]
fn can_send_after_dust_limit_from_an_inscription() {
let rpc_server = test_bitcoincore_rpc::spawn();
create_wallet(&rpc_server);
let (_, reveal) = inscribe(&rpc_server);
rpc_server.mine_blocks(1);
let output = OutPoint {
txid: reveal,
vout: 0,
};
CommandBuilder::new(format!(
"wallet send --fee-rate 1 bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4 {output}:330"
))
.rpc_server(&rpc_server)
.run_and_deserialize_output::<Output>();
}
#[test]
fn splitting_merged_inscriptions_is_possible() {
let rpc_server = test_bitcoincore_rpc::spawn();
create_wallet(&rpc_server);
rpc_server.mine_blocks(3);
let inscription = envelope(&[b"ord", &[1], b"text/plain;charset=utf-8", &[], b"bar"]);
// merging 3 inscriptions into one utxo
let reveal_txid = rpc_server.broadcast_tx(TransactionTemplate {
#45,000,620text