Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Statemachine #4

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cargo: pin bitflags to respect 1.43 MSRV
  • Loading branch information
darosior committed Sep 28, 2021
commit 346eafd7d1e9f1470d050f09da1d411410d6855d
6 changes: 2 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions src/database/mod.rs
Original file line number Diff line number Diff line change
@@ -683,36 +683,36 @@ mod tests {
.unwrap();
let deriv_a = bip32::ChildNumber::from(32);
let amount_a = Amount::from_sat(i64::MAX as u64 - 100_000);
let emer_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
let emer_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("304402200b4025e855ac108cf4f5114c3a8af9f8122023ffa971c5de8a8bc3f67d18749902202cc9b7d36f57dbe70f8826fac13838c6757fe18fb4572328c76dd5b55e452528").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("3045022100cc110b2dc66b9a116f50c61548d33f589d00ef57fb2fa784100ffb84e1577faf02206eec4e600f76f347b2014752a3619df8b2406fa61a34f0ec01ce4900f0b22083").unwrap())
]).collect();
let unemer_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
].iter().copied().collect();
let unemer_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("30450221008f4abfaa7c22adbf621e46f520fea81779b4fce81c22889354f8044336a542ff02205b5bf7c7a677414fdf20f5192c51f0fd34a8447b709a5d0f7df6e6c8d5dfbeff").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("3045022100a1da27080b26a6a328a26dfe0c076931ea5e22ad06e31b867a2ccd11d57e912102203ccb9388e104e13a81bc02c700d214278541ff8da67f27359b7bbb0e6eea6a41").unwrap())
]).collect();
let cancel_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
].iter().copied().collect();
let cancel_sigs_a: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("304502210089a1b4a09cafb8f26d6355c5ad51c686d8796d3a833945de35687085b1cd048e022068f6ac3fd4d3909f5d3cf93b0cf6538edfbafdd0b36d858c073e4b9b4137a027").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("3044022009334cec178a66aef6a473fc9d7608cc2b53495d433920262ba50e8a2947bba202207a0eb002ebe2fc0774adbe9b28885d00758d3043497aae414884bbc8cf7c84dc").unwrap()),
]).collect();
].iter().copied().collect();
let outpoint_b = OutPoint::from_str(
"69a747cd1ea7ce4904e6173b06a4a83e0df173661046e70f5128b3c9bef8241d:18",
)
.unwrap();
let deriv_b = bip32::ChildNumber::from((1 << 31) - 1);
let amount_b = Amount::from_sat(1298766);
let emer_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
let emer_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("304402207d1d99b6164597cee75baa0de60d4988f298fbc1857ca67102996287d8ccc76402207d9a2997a79c895d34d9bc450219b988d40cc2054f25a9a4e582666b96dc2444").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("3044022031c4547c4f3688b02ff749c6830579318d4ba24bb832dffff5156b2bb751480c022060f6745664612b70e8acb3db3e00af60952bda853891edc6d98a83825e92aeb6").unwrap())
]).collect();
let unemer_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
].iter().copied().collect();
let unemer_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("30450221009c93c095d2d8cb7f7918bc6b43de451f146eec07d8569a77eed2d14d25fafee50220656328e7e74953c82c4af62fd809bea903de1d9b92de8f4d02450f5d9a2d02ab").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("3045022100ca96469270b45e4be24c70115de4545b975c27b60c007b4668cc6edb97944ee302203a078a1cd7d36c6293635dc9604bb7ced31d5a98c8a01a2f7fb2da533245d074").unwrap())
]).collect();
let cancel_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = std::array::IntoIter::new([
].iter().copied().collect();
let cancel_sigs_b: collections::BTreeMap<secp256k1::PublicKey, secp256k1::Signature> = [
dummy_sig!(secp256k1::Signature::from_str("304402207e17f075edacc44be94263caa38e0b94dcffd65f2e76159def578d61dd82cbbe02202f300241721dfa8334cc8835d422e8928a7a87301be094e8c296ecdf945c9d71").unwrap()),
dummy_sig!(secp256k1::Signature::from_str("30440220398b5d0a75911f69c37c71e929727d16bf48a6b6cc46b1db0d6097f91eb7ecfa0220379c43fc3db9b70b2d3d5d945f8d51ae2660bdedd94b8468abb92c7f2c1989a8").unwrap()),
]).collect();
].iter().copied().collect();

// We can insert and query no-yet-delegated vaults
db_new_vault(&db_path, &outpoint_a, deriv_a, amount_a, &emer_sigs_a).unwrap();