Check codes are ascending with validation script (#212)

Ref: https://github.com/multiformats/multicodec/pull/210
This commit is contained in:
Rod Vagg 2021-05-12 21:18:43 +10:00 committed by GitHub
parent 5d444039bb
commit 325a006369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -79,7 +79,6 @@ swarm-ns, namespace, 0xe4, draft, Swarm
ipns-ns, namespace, 0xe5, draft, IPNS path
zeronet, namespace, 0xe6, draft, ZeroNet site address
secp256k1-pub, key, 0xe7, draft, Secp256k1 public key
secp256k1-priv, key, 0x1301, draft, Secp256k1 private key
bls12_381-g1-pub, key, 0xea, draft, BLS12-381 public key in the G1 field
bls12_381-g2-pub, key, 0xeb, draft, BLS12-381 public key in the G2 field
x25519-pub, key, 0xec, draft, Curve25519 public key
@ -127,6 +126,7 @@ p521-pub, key, 0x1202, draft, P-521
ed448-pub, key, 0x1203, draft, Ed448 public Key
x448-pub, key, 0x1204, draft, X448 public Key
ed25519-priv, key, 0x1300, draft, Ed25519 private key
secp256k1-priv, key, 0x1301, draft, Secp256k1 private key
kangarootwelve, multihash, 0x1d01, draft, KangarooTwelve is an extendable-output hash function based on Keccak-p
sm3-256, multihash, 0x534d, draft,
blake2b-8, multihash, 0xb201, draft, Blake2b consists of 64 output lengths that give different hashes

1 name tag code status description
79 ipns-ns namespace 0xe5 draft IPNS path
80 zeronet namespace 0xe6 draft ZeroNet site address
81 secp256k1-pub key 0xe7 draft Secp256k1 public key
secp256k1-priv key 0x1301 draft Secp256k1 private key
82 bls12_381-g1-pub key 0xea draft BLS12-381 public key in the G1 field
83 bls12_381-g2-pub key 0xeb draft BLS12-381 public key in the G2 field
84 x25519-pub key 0xec draft Curve25519 public key
126 ed448-pub key 0x1203 draft Ed448 public Key
127 x448-pub key 0x1204 draft X448 public Key
128 ed25519-priv key 0x1300 draft Ed25519 private key
129 secp256k1-priv key 0x1301 draft Secp256k1 private key
130 kangarootwelve multihash 0x1d01 draft KangarooTwelve is an extendable-output hash function based on Keccak-p
131 sm3-256 multihash 0x534d draft
132 blake2b-8 multihash 0xb201 draft Blake2b consists of 64 output lengths that give different hashes

View File

@ -24,6 +24,7 @@ def check(fname='table.csv'):
codes = {}
names = {}
headerOffsets = []
lastCode = -1
for line, row in enumerate(tablereader):
try:
# Check the padding of each column
@ -69,6 +70,12 @@ def check(fname='table.csv'):
except Exception as e:
raise CheckError(f"failed to parse code '{code}' for '{name}': {e}")
# Check codes are ascending
ooo = code < lastCode
lastCode = code
if ooo:
raise CheckError(f"code {code} is out of order, previous code was {lastCode}")
# Finally, check for duplicates
if name in names: