Commit Graph

7 Commits

Author SHA1 Message Date
Dave Collins
70b399c9e4
build: Add dupword linter.
This adds the dupword linter to the list of linters and addresses a few
false positives it complains about.
2023-08-25 12:35:55 -05:00
Dave Collins
cc74183435
stdscript: Reject multisig neg thresholds.
This modifies the MultiSigScriptV0 convenience func for creating a
multisig script to return an error if the caller improperly calls it
with a negative threshold.
2022-01-01 01:22:07 -06:00
Dave Collins
b1b9a86da0
stdscript: Add extract v0 stake-tagged p2sh bench.
BenchmarkExtractStakeScriptHashV0
---------------------------------
v0_complex_non_standard       226793582   5.253 ns/op
v0_stake_submission_p2sh      372232682   3.233 ns/op
v0_stake_gen_p2sh             305602378   3.979 ns/op
v0_stake_revoke_p2sh          201691552   5.064 ns/op
v0_stake_change_p2sh          209401243   5.687 ns/op
v0_treasury_generation_p2sh   221794405   5.419 ns/op
2021-11-18 23:02:42 -06:00
Dave Collins
2e09c16c56
stdscript: Add v0 stake-tagged p2sh extract.
This adds support for directly extracting the script hash from standard
version 0 stake-tagged pay-to-script-hash scripts along with full test
coverage.

While all of this data can be extracted from each individual type, it
can be more convenient for callers who treat all script hashes as the
same entity which is the case for many applications.
2021-11-18 23:02:33 -06:00
Dave Collins
a81014df3c
stdscript: Add extract v0 stake-tagged p2pkh bench.
BenchmarkExtractStakePubKeyHashV0
---------------------------------
v0_complex_non_standard-16                        229676676   5.139 ns/op
v0_stake_submission_p2pkh-ecdsa-secp256k1-16      335241789   3.531 ns/op
v0_stake_gen_p2pkh-ecdsa-secp256k1-16             268142942   4.517 ns/op
v0_stake_revoke_p2pkh-ecdsa-secp256k1-16          244045095   4.908 ns/op
v0_stake_change_p2pkh-ecdsa-secp256k1-16          220275314   5.441 ns/op
v0_treasury_generation_p2pkh-ecdsa-secp256k1-16   197104339   6.086 ns/op
2021-11-18 23:02:29 -06:00
Dave Collins
d4f5338af0
stdscript: Add v0 stake-tagged p2pkh extract.
This adds support for directly extracting the public key hash from
standard version 0 stake-tagged pay-to-pubkey-hash scripts along with
full test coverage.

While all of this data can be extracted from each individual type, it
can be more convenient for callers who treat all public key hashes as
the same entity which is the case for many applications.
2021-11-18 23:02:05 -06:00
Dave Collins
7d97fd5ff8
stdscript: Move from internal/staging to txscript.
This moves the new stdscript package from the internal staging area to
the txscript module and updates the relevant paths and package README.md
accordingly.
2021-11-18 12:29:53 -06:00