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
Make PacketList
a valid subtype of Array
and update Packet.tag
type accessor
#1289
Conversation
PacketList
a valid subtype of Array
PacketList
a valid subtype of Array
and update Packet.tag
type accessor
9c41bb9
to
cc17eed
Compare
…d tests for more packet methods
@@ -81,7 +81,7 @@ async function makeKeyValid() { | |||
pusersig.readSubPackets(fake.writeHashedSubPackets(), false); | |||
// reconstruct the modified key | |||
const newlist = new PacketList(); | |||
newlist.concat([pubkey, puser, pusersig]); | |||
newlist.push(...[pubkey, puser, pusersig]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is then very nitpicky but you can just do:
newlist.push(...[pubkey, puser, pusersig]); | |
newlist.push(pubkey, puser, pusersig); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is fixed in the next PR 🙃
@@ -56,7 +56,7 @@ async function testSubkeyTrust() { | |||
fakeBindingSignature.keyFlags = [enums.keyFlags.signData]; | |||
await fakeBindingSignature.sign(attackerPrivKey.keyPacket, dataToSign); | |||
const newList = new PacketList(); | |||
newList.concat([ | |||
newList.push(...[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And similarly here
Changes:
PacketList.prototype.concat
andpush
(we solely rely onArray.push
instead).filterByTag
.write()
method forTrust
andMarker
packets, to make them compatible with theBasePacket
interfacePacketList
type definitionsPacket.tag
, which isstatic
since Use consistent name casing #1268