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

Implement correct address indexing for outputs containing CashTokens (BCH) + Code cleanup #135

Merged
merged 22 commits into from
Sep 14, 2022

Conversation

cculianu
Copy link
Owner

  • (BCH only) This PR implements correct parsing of "cashtokens" which get embedded into Txn outputs where the scriptPubKey appears. See: https://github.com/bitjson/cashtokens
    • Without this PR, when the next May 2023 network upgrade occurs, Fulcrum would not be able to index address "scripthashes" correctly on BCH for outputs and inputs containing cashtokens.
  • (BCH only) Support cash addresses that have type = 2 or type = 3 (CashToken-aware cashaddresses)
  • (BCH only) Support addresses that have a 256-bit hash payload (P2SH32)
  • Also this PR cleans up the code a little bit, removes some dead code, and adds a bunch of unit tests for existing code.

- token stuff
- updated serialize.h
- misc other updates
- ScriptHashID (replaces CScriptID) for p2sh32 support
- Added cashaddr p2sh32 support.
- Added "streams" unit test from BCHN
- Imported more useful code from BCHN
- Updated bitcoin/test.cpp
Incorporated into the "streams" test for Fulcrum
Just paranoia to catch regressions where this flag stops working.
This is to differentiate this from the non-cashtokens master. Also when
we merge this branch into master we will use this version for the
upcoming release.
This is to catch regressions, since the coin should never be "Unknown"
(it defaults to BCH anyway if we cannot parse daemon version string).
Also added a test to check this if it ever regresses.
- Removal of dead/unused code
- Removed the never-used BTC_unused.*
- Changed all include guards to #pragma once
- Removal of unused feerate.*
Use lex compare rather than memcmp for the _hash, since it's more
readable.
Specifically for some of their c'tors. This helps with STL containers.
@cculianu cculianu added enhancement New feature or request correctness Improvements to correctness labels Sep 14, 2022
@cculianu cculianu merged commit 15a67c6 into master Sep 14, 2022
@cculianu cculianu deleted the cashtokens branch September 14, 2022 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
correctness Improvements to correctness enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant