Skip to content

Commit 1d3a5cb

Browse files
authored
Merge pull request #972 from Pauan/fix/unit-tests
Fixing unit tests to use the proper imports
2 parents f19f90d + c6ad430 commit 1d3a5cb

11 files changed

+23
-13
lines changed

sdk/rollup.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default networks.map((network) => {
3939

4040
// Used by the SDK
4141
"comlink",
42+
`@provablehq/sdk/${network}.js`,
4243
`@provablehq/wasm/${network}.js`,
4344
"core-js/proposals/json-parse-with-source.js",
4445

sdk/tests/account.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sinon from "sinon";
22
import { expect } from "chai";
3-
import { Account, Address, PrivateKey, RecordCiphertext, ViewKey } from "../src/node";
3+
import { Account, Address, PrivateKey, RecordCiphertext, ViewKey } from "@provablehq/sdk/%%NETWORK%%.js";
44
import { seed, message, beaconPrivateKeyString, beaconViewKeyString, beaconAddressString, recordCiphertextString, foreignCiphertextString, recordPlaintextString } from "./data/account-data";
55

66
describe('Account', () => {

sdk/tests/arithmetic.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sinon from "sinon";
22
import { expect } from "chai";
3-
import { Field, Scalar, Group} from "../src/node";
3+
import { Field, Scalar, Group} from "@provablehq/sdk/%%NETWORK%%.js";
44

55
describe('Field and Group Arithmetic Tests', () => {
66
afterEach(() => {

sdk/tests/key-provider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from "chai";
2-
import {AleoKeyProvider, CachedKeyPair, CREDITS_PROGRAM_KEYS, FunctionKeyPair, OfflineKeyProvider, ProvingKey, VerifyingKey} from "../src/node";
2+
import {AleoKeyProvider, CachedKeyPair, CREDITS_PROGRAM_KEYS, FunctionKeyPair, OfflineKeyProvider, ProvingKey, VerifyingKey} from "@provablehq/sdk/%%NETWORK%%.js";
33

44
describe('KeyProvider', () => {
55
let keyProvider: AleoKeyProvider;

sdk/tests/network-client.integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from "chai";
22
import {beaconAddressString, beaconPrivateKeyString} from "./data/account-data";
3-
import {Account, AleoNetworkClient} from "../src/browser";
3+
import {Account, AleoNetworkClient} from "@provablehq/sdk/%%NETWORK%%.js";
44

55
describe('NodeConnection', () => {
66
let localApiClient: AleoNetworkClient;

sdk/tests/network-client.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ import {
77
TransactionObject,
88
InputObject,
99
OutputObject,
10-
ExecutionObject
11-
} from "../src/node";
10+
ExecutionObject,
11+
DeploymentObject,
12+
ExecutionJSON,
13+
InputJSON,
14+
OutputJSON,
15+
Plaintext,
16+
PlaintextObject,
17+
Transition,
18+
TransitionObject,
19+
} from "@provablehq/sdk/%%NETWORK%%.js";
1220
import { beaconPrivateKeyString } from "./data/account-data";
13-
import { DeploymentObject, ExecutionJSON, InputJSON, OutputJSON, Plaintext, PlaintextObject, Transition, TransitionObject } from "../src/node";
1421

1522
async function catchError(f: () => Promise<any>): Promise<Error | null> {
1623
try {

sdk/tests/program-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
statePathRecordOwnerPrivateKey,
88
stateRoot
99
} from "./data/account-data";
10-
import { Account, ExecutionResponse, OfflineQuery, ProgramManager, RecordPlaintext } from "../src/node";
10+
import { Account, ExecutionResponse, OfflineQuery, ProgramManager, RecordPlaintext } from "@provablehq/sdk/%%NETWORK%%.js";
1111

1212
describe('Program Manager', () => {
1313
const programManager = new ProgramManager("https://api.explorer.provable.com/v1", undefined, undefined);

sdk/tests/record-provider.integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { expect } from "chai";
22
import { beaconPrivateKeyString } from "./data/account-data";
3-
import { Account, AleoNetworkClient, NetworkRecordProvider, RecordPlaintext } from "../src/node";
3+
import { Account, AleoNetworkClient, NetworkRecordProvider, RecordPlaintext } from "@provablehq/sdk/%%NETWORK%%.js";
44

55
describe('RecordProvider', () => {
66
let account: Account;

sdk/tests/record-provider.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from "chai";
2-
import {Account, AleoNetworkClient, BlockHeightSearch, NetworkRecordProvider} from "../src/node";
2+
import {Account, AleoNetworkClient, BlockHeightSearch, NetworkRecordProvider} from "@provablehq/sdk/%%NETWORK%%.js";
33
import {beaconPrivateKeyString} from "./data/account-data";
44

55
describe.skip('RecordProvider', () => {

sdk/tests/wasm.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from "chai";
2-
import { Address, PrivateKey, ViewKey, Signature, RecordCiphertext, RecordPlaintext, PrivateKeyCiphertext } from "../src/node";
2+
import { Address, PrivateKey, ViewKey, Signature, RecordCiphertext, RecordPlaintext, PrivateKeyCiphertext } from "@provablehq/sdk/%%NETWORK%%.js";
33
import {
44
seed,
55
message,
@@ -191,7 +191,7 @@ describe('WASM Objects', () => {
191191
});
192192

193193
it('properly assesses equality and inequality', () => {
194-
const viewKey1 = new ViewKey();
194+
const viewKey1 = new (ViewKey as any)();
195195
const viewKey2 = ViewKey.from_string(viewKeyString);
196196
const viewKey3 = ViewKey.from_string(viewKeyString);
197197

0 commit comments

Comments
 (0)