Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
9b2d4d1096
|
|||
|
fae58c223b
|
|||
|
7e5a8c74a5
|
|||
|
df09c952de
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "meshcore",
|
"name": "meshcore",
|
||||||
"version": "1.1.0",
|
"version": "1.1.1",
|
||||||
"description": "MeshCore protocol support for Typescript",
|
"description": "MeshCore protocol support for Typescript",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"MeshCore",
|
"MeshCore",
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ export * from './identity.types';
|
|||||||
export type * from './identity.types';
|
export type * from './identity.types';
|
||||||
|
|
||||||
export * from './crypto';
|
export * from './crypto';
|
||||||
|
export * from './crypto.types';
|
||||||
export type * from './crypto.types';
|
export type * from './crypto.types';
|
||||||
|
|
||||||
export * from './packet';
|
export * from './packet';
|
||||||
|
export * from './packet.types';
|
||||||
export type * from './packet.types';
|
export type * from './packet.types';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from './crypto';
|
import { PublicKey, PrivateKey, SharedSecret, StaticSecret } from '../src/crypto';
|
||||||
import { bytesToHex, hexToBytes } from './parser';
|
import { bytesToHex, hexToBytes } from '../src/parser';
|
||||||
|
|
||||||
const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
const randomBytes = (len: number) => Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
||||||
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { describe, it, expect, beforeEach } from 'vitest';
|
import { describe, it, expect, beforeEach } from 'vitest';
|
||||||
import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from './identity';
|
import { Identity, LocalIdentity, Contact, Group, Contacts, parseNodeHash } from '../src/identity';
|
||||||
import { PrivateKey, PublicKey, SharedSecret } from './crypto';
|
import { PrivateKey, PublicKey, SharedSecret } from '../src/crypto';
|
||||||
import { DecryptedGroupText, DecryptedGroupData } from './packet.types';
|
import { DecryptedGroupText, DecryptedGroupData } from '../src/packet.types';
|
||||||
import { bytesToHex } from './parser';
|
import { bytesToHex } from '../src/parser';
|
||||||
|
|
||||||
function randomBytes(len: number) {
|
function randomBytes(len: number) {
|
||||||
return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
return Uint8Array.from({ length: len }, () => Math.floor(Math.random() * 256));
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { describe, expect, test } from 'vitest';
|
import { describe, expect, test } from 'vitest';
|
||||||
import { Packet } from './packet';
|
import { Packet } from '../src/packet';
|
||||||
import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from './packet.types';
|
import { PayloadType, RouteType, NodeType, TracePayload, AdvertPayload, RequestPayload, TextPayload, ResponsePayload, RawCustomPayload, AnonReqPayload } from '../src/packet.types';
|
||||||
import { hexToBytes, bytesToHex } from './parser';
|
import { hexToBytes, bytesToHex } from '../src/parser';
|
||||||
|
|
||||||
describe('Packet.fromBytes', () => {
|
describe('Packet.fromBytes', () => {
|
||||||
test('frame 1: len=122 type=5 payload_len=99', () => {
|
test('frame 1: len=122 type=5 payload_len=99', () => {
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { describe, it, expect } from 'vitest';
|
import { describe, it, expect } from 'vitest';
|
||||||
import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from './parser';
|
import { base64ToBytes, hexToBytes, BufferReader, BufferWriter } from '../src/parser';
|
||||||
|
|
||||||
describe('base64ToBytes', () => {
|
describe('base64ToBytes', () => {
|
||||||
it('decodes a simple base64 string', () => {
|
it('decodes a simple base64 string', () => {
|
||||||
@@ -14,6 +14,6 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"forceConsistentCasingInFileNames": true
|
"forceConsistentCasingInFileNames": true
|
||||||
},
|
},
|
||||||
"include": ["src"],
|
"include": ["src", "test/crypto.test.ts", "test/identity.test.ts", "test/packet.test.ts", "test/parser.test.ts"],
|
||||||
"exclude": ["node_modules", "dist", "test"]
|
"exclude": ["node_modules", "dist", "test"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user