1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-07-21 12:58:14 +00:00

11 Commits

Author SHA1 Message Date
Yuval Kogman
cd19d89e58 scripted-diff: fix BIP 2 field order violations
-BEGIN VERIFY SCRIPT-
set -e
perl <<'-END PERL-'
use strict;
use warnings;

my $topbip = 9999;

my @FieldOrder = qw(
	BIP
	Layer
	Title
	Author
	Authors
	Editor
	Deputies
	Discussions-To
	Comments-Summary
	Comments-URI
	Status
	Type
	Created
	License
	License-Code
	Discussion
	Post-History
	Version
	Requires
	Replaces
	Proposed-Replacement
	Superseded-By
);

my $bipnum = 0;
while (++$bipnum <= $topbip) {
	my $fn = sprintf "bip-%04d.mediawiki", $bipnum;
	my $is_markdown = 0;
	if (!-e $fn) {
		$fn = sprintf "bip-%04d.md", $bipnum;
		$is_markdown = 1;
	}
	-e $fn || next;
	open my $F, "<", $fn or die "$!";

	my (@before, %preamble, @after);

	if ($is_markdown) {
		while (<$F>) {
			push @before, $_;
			last if m[^(?:\xef\xbb\xbf)?```$]
		}
		die "No ``` in $fn" if eof $F;
	} else {
		while (<$F>) {
			push @before, $_;
			last if m[^(?:\xef\xbb\xbf)?<pre>$];
		}
		die "No <pre> in $fn" if eof $F;
	}
	my %found;
	my ($title, $author, $status, $type, $layer);
	my ($field, $val, @field_order);
	while (<$F>) {
		push @after, $_ and last if ($is_markdown && m[^```$]);
		push @after, $_ and last if (!$is_markdown && m[^</pre>$]);

		if (m[^  ([\w-]+)\: (.*\S)$]) {
			$field = $1;
			$val = $2;
		} elsif (m[^  ( +)(.*\S)$]) {
			$val = $2;
		} else {
			die "Bad line in $fn preamble";
		}

		push @{$preamble{$field} ||= []}, $_;
	}
	push @after, <$F>;
	close $F or die $!;

	open my $W, ">", "$fn" or die "$!";

	print $W @before;
	print $W map { @$_ } grep { defined } delete @preamble{@FieldOrder};
	die "Unknown fields: @{[ keys %preamble ]}" if %preamble;
	print $W @after;

	close $W or die $!;
}
-END PERL-
-END VERIFY SCRIPT-
2025-07-20 14:29:13 -06:00
Jon Atack
2eb22b8ec6 BIP327: update status 2024-10-11 11:19:56 -06:00
Jonas Nick
26bb1d8ea3 bip-0327: 1.0.1 -> 1.0.2
(cherry picked from commit 4f2e6e7ffbd2fdc095ab8d59827be9da18b790be)
2024-07-23 13:09:44 +05:30
siv2r
1c6ac0c4cf bip327: minor fixes
- An error test vector doesn’t specify the InvalidContributionError type
- In *DeterministicSign*, use GetXonlyPubkey instead of GetPubkey
- The key_agg_and_tweak fn doesn’t specify the return type
- In partial_sig_verify_internal, the pubkey arg should be PlainPk
- Remove unused enumerate() fn calls
- In test_sign_verify, add an additional assert statement
2024-07-19 23:52:41 +05:30
Tim Ruffing
6a7af366a5
bip-0327: Remove obsolete paragraph 2024-06-13 20:54:57 +02:00
Alexander Cyon
1eefea0456 Fix typos on 17 files. 2024-05-28 19:25:46 +02:00
Jon Atack
96161aeaf5
Merge pull request #1591 from siv2r/bip327-fix-verify-fail-vector
Fix the first two test vectors of verify fail test
2024-05-14 01:59:40 -07:00
siv2r
508e3a6a40 Fix the four test vectors
- first two vectors of verify_fail_test
- first two vectors of verify_error_test
2024-05-14 07:39:38 +05:30
siv2r
ddf5b25fc7 bip327: fix broken links 2024-02-26 17:14:18 +05:30
Anthony Towns
0e5b18c0ff BIP327: fixups for buildtable.pl 2023-03-29 15:10:15 +10:00
Jonas Nick
87394eaeb4 Add BIP327: MuSig2 for BIP340-compatible Multi-Signatures 2023-03-27 11:48:22 +09:00