Skip to content

Commit

Permalink
various changes
Browse files Browse the repository at this point in the history
  • Loading branch information
captainbuckkets committed Dec 19, 2023
1 parent d6fcfcb commit 2931007
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 92 deletions.
64 changes: 31 additions & 33 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions fuzz/fuzz_targets/transaction_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ fuzz_target!(|input: Input| {
);
}

let recipient = "bc1pdqrcrxa8vx6gy75mfdfj84puhxffh4fq46h3gkp6jxdd0vjcsdyspfxcv6"
let recipient = "pc1pdqrcrxa8vx6gy75mfdfj84puhxffh4fq46h3gkp6jxdd0vjcsdyspfxcv6"
.parse::<Address<NetworkUnchecked>>()
.unwrap()
.assume_checked();

let change = [
"bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k"
"pc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k"
.parse::<Address<NetworkUnchecked>>()
.unwrap()
.assume_checked(),
"bc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k"
"pc1pxwww0ct9ue7e8tdnlmug5m2tamfn7q06sahstg39ys4c9f3340qqxrdu9k"
.parse::<Address<NetworkUnchecked>>()
.unwrap()
.assume_checked(),
Expand Down
24 changes: 15 additions & 9 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ impl Index {
}),
);

println!("utxos: {:?}", utxos);

let locked_utxos: BTreeSet<OutPoint> = self.get_locked_outputs(wallet)?;
// Print locked_utxos
for outpoint in locked_utxos {
Expand All @@ -403,16 +405,20 @@ impl Index {
);
}

println!("locked utxos: {:?}", utxos);

let rtx = self.database.begin_read()?;
let outpoint_to_value = rtx.open_table(OUTPOINT_TO_VALUE)?;
for outpoint in utxos.keys() {
if outpoint_to_value.get(&outpoint.store())?.is_none() {
return Err(anyhow!(
"output in Peercoin Core wallet but not in ord index: {outpoint}"
));
}
}
// let rtx = self.database.begin_read()?;
// let outpoint_to_value = rtx.open_table(OUTPOINT_TO_VALUE)?;

// println!("outpoint_to_value: {:?}", outpoint_to_value);

// for outpoint in utxos.keys() {
// if outpoint_to_value.get(&outpoint.store())?.is_none() {
// return Err(anyhow!(
// "output in Peercoin Core wallet but not in ord index: {outpoint}"
// ));
// }
// }

Ok(utxos)
}
Expand Down
24 changes: 12 additions & 12 deletions src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,49 +117,49 @@ mod tests {
]),
);
case(
"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
"pc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
Object::Address(
"bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
"pc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"
.parse()
.unwrap(),
),
);
case(
"BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4",
"PC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4",
Object::Address(
"BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4"
"PC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4"
.parse()
.unwrap(),
),
);
case(
"tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy",
"tp1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy",
Object::Address(
"tb1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy"
"tp1qqqqqp399et2xygdj5xreqhjjvcmzhxw4aywxecjdzew6hylgvsesrxh6hy"
.parse()
.unwrap(),
),
);
case(
"TB1QQQQQP399ET2XYGDJ5XREQHJJVCMZHXW4AYWXECJDZEW6HYLGVSESRXH6HY",
"TP1QQQQQP399ET2XYGDJ5XREQHJJVCMZHXW4AYWXECJDZEW6HYLGVSESRXH6HY",
Object::Address(
"TB1QQQQQP399ET2XYGDJ5XREQHJJVCMZHXW4AYWXECJDZEW6HYLGVSESRXH6HY"
"TP1QQQQQP399ET2XYGDJ5XREQHJJVCMZHXW4AYWXECJDZEW6HYLGVSESRXH6HY"
.parse()
.unwrap(),
),
);
case(
"bcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw",
"pcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw",
Object::Address(
"bcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw"
"pcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw"
.parse()
.unwrap(),
),
);
case(
"BCRT1QS758URSH4Q9Z627KT3PP5YYSM78DDNY6TXAQGW",
"PCRT1QS758URSH4Q9Z627KT3PP5YYSM78DDNY6TXAQGW",
Object::Address(
"BCRT1QS758URSH4Q9Z627KT3PP5YYSM78DDNY6TXAQGW"
"PCRT1QS758URSH4Q9Z627KT3PP5YYSM78DDNY6TXAQGW"
.parse()
.unwrap(),
),
Expand Down
Loading

0 comments on commit 2931007

Please sign in to comment.