Use Bytes Primitive

This commit is contained in:
Jim Hamill
2025-07-23 00:27:41 +00:00
parent 9af5dc0087
commit e72c678785
10 changed files with 62 additions and 72 deletions
+6 -8
View File
@@ -1,13 +1,13 @@
import { describe, it, expect } from 'vitest';
import { Bytes } from '~/src/bytes';
import { Script } from '~/src/script';
import { Bytes } from '../src/bytes';
import { Script } from '../src/script';
describe('Success cases', () => {
// Test cases with different script representations
type ScriptCase = {
raw: Uint8Array;
raw: Bytes;
representations: {
bytes: Uint8Array;
bytes: Bytes;
asm: string;
hex: string;
};
@@ -15,13 +15,11 @@ describe('Success cases', () => {
const testCases: ScriptCase[] = [
{
raw: Bytes.fromHex(
'76a914876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d688ac',
).toUint8Array(),
raw: Bytes.fromHex('76a914876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d688ac'),
representations: {
bytes: Bytes.fromHex(
'76a914876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d688ac',
).toUint8Array(),
),
asm: 'OP_DUP\nOP_HASH160\nOP_PUSHBYTES_20\n0x876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d6\nOP_EQUALVERIFY\nOP_CHECKSIG',
hex: '76a914876fbb82ec05caa6af7a3b5e5a983aae6c6cc6d688ac',
},