Skip to content

Commit 0f8a226

Browse files
committed
Merge branch 'nothingmuch-field-ordering-pr'
* nothingmuch-field-ordering-pr: CI: Enforce BIP 2 & 3 field ordering requirements scripted-diff: fix BIP 2 field order violations
2 parents 340c1a3 + 0eb3718 commit 0f8a226

10 files changed

+43
-14
lines changed

bip-0077.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
Author: Dan Gould <[email protected]>
66
Yuval Kogman <[email protected]>
77
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0077
8-
Post-History: https://github.com/bitcoin/bips/pull/1483
9-
https://gnusha.org/pi/bitcoindev/[email protected]/#t
10-
https://gnusha.org/pi/bitcoindev/[email protected]/#t
118
Status: Draft
129
Type: Standards Track
1310
Created: 2023-08-08
1411
License: BSD-2-Clause
12+
Post-History: https://github.com/bitcoin/bips/pull/1483
13+
https://gnusha.org/pi/bitcoindev/[email protected]/#t
14+
https://gnusha.org/pi/bitcoindev/[email protected]/#t
1515
Requires: 21, 78, 173, 174
1616
```
1717

bip-0078.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Layer: Applications
44
Title: A Simple Payjoin Proposal
55
Author: Nicolas Dorier <[email protected]>
6-
Replaces: 79
76
Comments-Summary: No comments yet.
87
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0078
98
Status: Draft
109
Type: Standards Track
1110
Created: 2019-05-01
1211
License: BSD-2-Clause
12+
Replaces: 79
1313
</pre>
1414

1515
==Introduction==

bip-0326.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
Layer: Applications
44
Title: Anti-fee-sniping in taproot transactions
55
Author: Chris Belcher <[email protected]>
6-
Status: Draft
7-
Type: Informational
86
Comments-Summary: No comments yet.
97
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0326
8+
Status: Draft
9+
Type: Informational
1010
Created: 2021-06-10
1111
License: CC0-1.0
1212
Post-History: 2021-6-10: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-June/019048.html

bip-0327.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
Author: Jonas Nick <[email protected]>
55
Tim Ruffing <[email protected]>
66
Elliott Jin <[email protected]>
7+
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
78
Status: Active
8-
License: BSD-3-Clause
99
Type: Informational
1010
Created: 2022-03-22
11+
License: BSD-3-Clause
1112
Post-History: 2022-04-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-April/020198.html [bitcoin-dev] MuSig2 BIP
1213
2022-10-11: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2022-October/021000.html [bitcoin-dev] MuSig2 BIP
13-
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0327
1414
</pre>
1515

1616
== Introduction ==

bip-0340.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0340
99
Status: Final
1010
Type: Standards Track
11+
Created: 2020-01-19
1112
License: BSD-2-Clause
1213
License-Code: BSD-2-Clause
1314
MIT
1415
CC0-1.0
15-
Created: 2020-01-19
1616
Post-History: 2018-07-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-July/016203.html [bitcoin-dev] Schnorr signatures BIP
1717
</pre>
1818

bip-0341.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
Type: Standards Track
1212
Created: 2020-01-19
1313
License: BSD-3-Clause
14-
Requires: 340
1514
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
1615
2019-10-09: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-October/017378.html [bitcoin-dev] Taproot updates
16+
Requires: 340
1717
</pre>
1818

1919
==Introduction==

bip-0342.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
Type: Standards Track
1212
Created: 2020-01-19
1313
License: BSD-3-Clause
14-
Requires: 340, 341
1514
Post-History: 2019-05-06: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2019-May/016914.html [bitcoin-dev] Taproot proposal
15+
Requires: 340, 341
1616
</pre>
1717

1818
==Introduction==

bip-0350.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
Type: Standards Track
1010
Created: 2020-12-16
1111
License: BSD-2-Clause
12-
Replaces: 173
1312
Post-History: 2021-01-05: https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2021-January/018338.html [bitcoin-dev] Bech32m BIP: new checksum, and usage for segwit address
13+
Replaces: 173
1414
</pre>
1515

1616
==Introduction==

bip-0374.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0374
99
Status: Draft
1010
Type: Standards Track
11-
License: BSD-2-Clause
1211
Created: 2024-12-26
12+
License: BSD-2-Clause
1313
Post-History: https://gist.github.com/andrewtoth/df97c3260cc8d12f09d3855ee61322ea
1414
https://groups.google.com/g/bitcoindev/c/MezoKV5md7s
1515
</pre>

scripts/buildtable.pl

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,30 @@
3737
'Requires' => undef,
3838
'Superseded-By' => undef,
3939
);
40+
my @FieldOrder = qw(
41+
BIP
42+
Layer
43+
Title
44+
Author
45+
Authors
46+
Editor
47+
Deputies
48+
Discussions-To
49+
Comments-Summary
50+
Comments-URI
51+
Status
52+
Type
53+
Created
54+
License
55+
License-Code
56+
Discussion
57+
Post-History
58+
Version
59+
Requires
60+
Replaces
61+
Proposed-Replacement
62+
Superseded-By
63+
);
4064

4165
my %ValidLayer = (
4266
'Consensus (soft fork)' => undef,
@@ -114,7 +138,7 @@
114138
}
115139
my %found;
116140
my ($title, $author, $status, $type, $layer);
117-
my ($field, $val);
141+
my ($field, $val, @field_order);
118142
while (<$F>) {
119143
last if ($is_markdown && m[^```$]);
120144
last if (!$is_markdown && m[^</pre>$]);
@@ -182,13 +206,18 @@
182206
die "Unknown field $field in $fn";
183207
}
184208
++$found{$field};
209+
push @field_order, $field unless @field_order and $field_order[-1] eq $field;
185210
}
186211
if (not $found{License}) {
187212
die "Missing License in $fn" unless exists $TolerateMissingLicense{$bipnum};
188213
}
189214
for my $field (keys %RequiredFields) {
190215
die "Missing $field in $fn" unless $found{$field};
191216
}
217+
my @expected_field_order = grep { exists $found{$_} } @FieldOrder;
218+
if ("@expected_field_order" ne "@field_order") {
219+
die "Field order is incorrect in $fn, should be:\n\t" . join(", ", @expected_field_order) . "\nbut contains:\n\t" . join(", ", @field_order);
220+
}
192221
print "|-";
193222
if (defined $ValidStatus{$status}) {
194223
print " style=\"" . $ValidStatus{$status} . "\"";

0 commit comments

Comments
 (0)