Skip to content

Commit

Permalink
Use bytes instead of regex match
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Nov 13, 2023
1 parent 8275aa7 commit 7fe087c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/api/v1/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ export class TrxVariant implements ABISerializableObject {
if (this.extra.packed_trx) {
switch (this.extra.compression) {
case 'zlib': {
const inflated = pako.inflate(
new Uint8Array(
this.extra.packed_trx.match(/[\da-f]{2}/gi).map((h) => parseInt(h, 16))
)
)
const inflated = pako.inflate(Bytes.from(this.extra.packed_trx, 'hex').array)
return Serializer.decode({data: inflated, type: Transaction})
}
case 'none': {
Expand Down

0 comments on commit 7fe087c

Please sign in to comment.