BP-WG / bp-std

Modern & lightweight implementation of bitcoin standards without rust-bitcoin/miniscript dependencies
Apache License 2.0
16 stars 17 forks source link

fix: underflow when parsing `DerivationSeg` #21

Closed whfuyn closed 6 months ago

whfuyn commented 6 months ago
$ ./rgb create test1 --tapret-key-only "[9ae0796a/86h/1h/0h]tpubDDGrVg19xRy5D9x8i1ai9on1Dzn7
Pg4nTTPJw7EkPcS9rQC6w3dxHSQHH3LCfApqovuJxtzyFrAVDY86STx1eh8aERV75FRcu7wY7wH9QWp/0/*"
thread 'main' panicked at /home/_/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bp-derive-0.11.0-beta.3/src/path.rs:136:23:
attempt to subtract with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

--tapret-key-only is obtained from bitcoin-cli. Not sure if it's the correct way to create a wallet, but after fixing this panic, the wallet is created successfully.

dr-orlovsky commented 6 months ago

Very good catch, thank you!