-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
77 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
packages/nodes-from-anchor/test/v01/InstructionArgumentNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletions
9
packages/nodes-from-anchor/test/v01/typeNodes/ArrayTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { arrayTypeNode, fixedCountNode, numberTypeNode, prefixedCountNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates array type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01({ array: ['u8', 2] }), arrayTypeNode(numberTypeNode('u8'), fixedCountNode(2))); | ||
t.deepEqual( | ||
typeNodeFromAnchorV01({ vec: 'u8' }), | ||
test('it creates array type nodes', () => { | ||
expect(typeNodeFromAnchorV01({ array: ['u8', 2] })).toEqual(arrayTypeNode(numberTypeNode('u8'), fixedCountNode(2))); | ||
expect(typeNodeFromAnchorV01({ vec: 'u8' })).toEqual( | ||
arrayTypeNode(numberTypeNode('u8'), prefixedCountNode(numberTypeNode('u32'))), | ||
); | ||
}); |
6 changes: 3 additions & 3 deletions
6
packages/nodes-from-anchor/test/v01/typeNodes/BooleanTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { booleanTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates boolean type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01('bool'), booleanTypeNode()); | ||
test('it creates boolean type nodes', () => { | ||
expect(typeNodeFromAnchorV01('bool')).toEqual(booleanTypeNode()); | ||
}); |
6 changes: 3 additions & 3 deletions
6
packages/nodes-from-anchor/test/v01/typeNodes/BytesTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { bytesTypeNode, numberTypeNode, sizePrefixTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates bytes type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01('bytes'), sizePrefixTypeNode(bytesTypeNode(), numberTypeNode('u32'))); | ||
test('it creates bytes type nodes', () => { | ||
expect(typeNodeFromAnchorV01('bytes')).toEqual(sizePrefixTypeNode(bytesTypeNode(), numberTypeNode('u32'))); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 15 additions & 15 deletions
30
packages/nodes-from-anchor/test/v01/typeNodes/NumberTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { numberTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates number type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01('f32'), numberTypeNode('f32')); | ||
t.deepEqual(typeNodeFromAnchorV01('f64'), numberTypeNode('f64')); | ||
t.deepEqual(typeNodeFromAnchorV01('i8'), numberTypeNode('i8')); | ||
t.deepEqual(typeNodeFromAnchorV01('i16'), numberTypeNode('i16')); | ||
t.deepEqual(typeNodeFromAnchorV01('i32'), numberTypeNode('i32')); | ||
t.deepEqual(typeNodeFromAnchorV01('i64'), numberTypeNode('i64')); | ||
t.deepEqual(typeNodeFromAnchorV01('i128'), numberTypeNode('i128')); | ||
t.deepEqual(typeNodeFromAnchorV01('shortU16'), numberTypeNode('shortU16')); | ||
t.deepEqual(typeNodeFromAnchorV01('u8'), numberTypeNode('u8')); | ||
t.deepEqual(typeNodeFromAnchorV01('u16'), numberTypeNode('u16')); | ||
t.deepEqual(typeNodeFromAnchorV01('u32'), numberTypeNode('u32')); | ||
t.deepEqual(typeNodeFromAnchorV01('u64'), numberTypeNode('u64')); | ||
t.deepEqual(typeNodeFromAnchorV01('u128'), numberTypeNode('u128')); | ||
test('it creates number type nodes', () => { | ||
expect(typeNodeFromAnchorV01('f32')).toEqual(numberTypeNode('f32')); | ||
expect(typeNodeFromAnchorV01('f64')).toEqual(numberTypeNode('f64')); | ||
expect(typeNodeFromAnchorV01('i8')).toEqual(numberTypeNode('i8')); | ||
expect(typeNodeFromAnchorV01('i16')).toEqual(numberTypeNode('i16')); | ||
expect(typeNodeFromAnchorV01('i32')).toEqual(numberTypeNode('i32')); | ||
expect(typeNodeFromAnchorV01('i64')).toEqual(numberTypeNode('i64')); | ||
expect(typeNodeFromAnchorV01('i128')).toEqual(numberTypeNode('i128')); | ||
expect(typeNodeFromAnchorV01('shortU16')).toEqual(numberTypeNode('shortU16')); | ||
expect(typeNodeFromAnchorV01('u8')).toEqual(numberTypeNode('u8')); | ||
expect(typeNodeFromAnchorV01('u16')).toEqual(numberTypeNode('u16')); | ||
expect(typeNodeFromAnchorV01('u32')).toEqual(numberTypeNode('u32')); | ||
expect(typeNodeFromAnchorV01('u64')).toEqual(numberTypeNode('u64')); | ||
expect(typeNodeFromAnchorV01('u128')).toEqual(numberTypeNode('u128')); | ||
}); |
14 changes: 6 additions & 8 deletions
14
packages/nodes-from-anchor/test/v01/typeNodes/OptionTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,17 @@ | ||
import { numberTypeNode, optionTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates option type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01({ option: 'u8' }), optionTypeNode(numberTypeNode('u8'))); | ||
test('it creates option type nodes', () => { | ||
expect(typeNodeFromAnchorV01({ option: 'u8' })).toEqual(optionTypeNode(numberTypeNode('u8'))); | ||
}); | ||
|
||
test('it creates option type nodes with fixed size', t => { | ||
t.deepEqual( | ||
typeNodeFromAnchorV01({ coption: 'u8' }), | ||
test('it creates option type nodes with fixed size', () => { | ||
expect(typeNodeFromAnchorV01({ coption: 'u8' })).toEqual( | ||
optionTypeNode(numberTypeNode('u8'), { fixed: true, prefix: numberTypeNode('u32') }), | ||
); | ||
t.deepEqual( | ||
typeNodeFromAnchorV01({ coption: 'u8' }), | ||
expect(typeNodeFromAnchorV01({ coption: 'u8' })).toEqual( | ||
optionTypeNode(numberTypeNode('u8'), { fixed: true, prefix: numberTypeNode('u32') }), | ||
); | ||
}); |
6 changes: 3 additions & 3 deletions
6
packages/nodes-from-anchor/test/v01/typeNodes/PublicKeyTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { publicKeyTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates public key type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01('pubkey'), publicKeyTypeNode()); | ||
test('it creates public key type nodes', () => { | ||
expect(typeNodeFromAnchorV01('pubkey')).toEqual(publicKeyTypeNode()); | ||
}); |
6 changes: 3 additions & 3 deletions
6
packages/nodes-from-anchor/test/v01/typeNodes/StringTypeNode.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import { numberTypeNode, sizePrefixTypeNode, stringTypeNode } from '@kinobi-so/nodes'; | ||
import test from 'ava'; | ||
import { expect, test } from 'vitest'; | ||
|
||
import { typeNodeFromAnchorV01 } from '../../../src/index.js'; | ||
|
||
test('it creates string type nodes', t => { | ||
t.deepEqual(typeNodeFromAnchorV01('string'), sizePrefixTypeNode(stringTypeNode('utf8'), numberTypeNode('u32'))); | ||
test('it creates string type nodes', () => { | ||
expect(typeNodeFromAnchorV01('string')).toEqual(sizePrefixTypeNode(stringTypeNode('utf8'), numberTypeNode('u32'))); | ||
}); |
Oops, something went wrong.