Skip to content

Commit

Permalink
Merge pull request #64 from firstbatchxyz/erhant/parcel-rfk
Browse files Browse the repository at this point in the history
Parcel refactor
  • Loading branch information
anilaltuner authored Dec 20, 2023
2 parents 22b6c2b + fdf1ef1 commit 325fccd
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 28 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ tmp.ts

# Test stuff
coverage

.vscode
14 changes: 0 additions & 14 deletions .vscode/settings.json

This file was deleted.

14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@
"targets": {
"cjs": {
"outputFormat": "commonjs",
"isLibrary": true,
"context": "node"
"isLibrary": false,
"context": "node",
"scopeHoist": false,
"includeNodeModules": false,
"optimize": false
},
"mjs": {
"outputFormat": "esmodule",
"isLibrary": true,
"context": "node"
"isLibrary": false,
"context": "node",
"scopeHoist": false,
"includeNodeModules": false,
"optimize": false
}
},
"engines": {
Expand Down
5 changes: 1 addition & 4 deletions src/base/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
UpdateWhitelistInput,
OpitonalArray,
} from '../contracts/types';
import {Base} from './base';
import type {Base} from './base';

export class Admin<M extends ContractMode = ContractMode> {
constructor(private readonly base: Base<M>) {}
Expand All @@ -25,9 +25,6 @@ export class Admin<M extends ContractMode = ContractMode> {
});
}

// TODO: transfer ownership
// remove yourself from whitelists and such

/**
* Changes the whitelist for the selected list.
* @param users an array of user addresses
Expand Down
2 changes: 1 addition & 1 deletion src/base/base.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Warp, Contract, ArWallet, CustomSignature} from 'warp-contracts';
import {Warp, Contract, ArWallet, type CustomSignature} from 'warp-contracts';
import {SnarkjsExtension} from 'warp-contracts-plugin-snarkjs';
import {EthersExtension} from 'warp-contracts-plugin-ethers';
import type {ContractInputGeneric, ContractMode, ContractState} from '../contracts/types/contract';
Expand Down
2 changes: 1 addition & 1 deletion src/bin/evolve.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {JWKInterface, Warp} from 'warp-contracts';
import type {JWKInterface, Warp} from 'warp-contracts';
import {ArweaveSigner} from 'warp-contracts-plugin-deploy';

/** Evolve an existing contract with a new source code. */
Expand Down
3 changes: 2 additions & 1 deletion src/bin/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {readFileSync} from 'fs';
import {JWKInterface, Warp, WarpFactory} from 'warp-contracts';
import type {JWKInterface, Warp} from 'warp-contracts';
import {WarpFactory} from 'warp-contracts';
import {DeployPlugin} from 'warp-contracts-plugin-deploy';
import {prepareState as prepareStateWithWarp} from './deploy';
import {ContractState} from '../contracts/types';
Expand Down
1 change: 1 addition & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ The tests are as follows:
- `crud` tests for basic CRUD functionality, such as checking for existing keys, not removing an already removed key and such.
- `htx` tests use a custom contract where assume Bundlr usage and instead of values themselves, we store `valueHash.txid` as values.
- `multi` tests using a single Warp instance with multiple contracts, and multiple HollowDB instances.
- `null` tests null values, which are not allowed due to ambiguity between a null value and non-existent value.
2 changes: 1 addition & 1 deletion tests/hooks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {LoggerFactory, Warp, WarpFactory} from 'warp-contracts';
import {DeployPlugin} from 'warp-contracts-plugin-deploy';
import {Redis} from 'ioredis';
import {overrideCache} from '../utils/cache';
import {Wallet} from 'warp-contracts/lib/types/contract/testing/Testing';
import type {Wallet} from 'warp-contracts/lib/types/contract/testing/Testing';

/**
* Setup Warp instance for a test, connected to Arlocal at the provided port.
Expand Down
4 changes: 2 additions & 2 deletions tests/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type {Warp, JWKInterface} from 'warp-contracts';
import {randomBytes} from 'crypto';
import {Warp, JWKInterface} from 'warp-contracts';
import {readFileSync} from 'fs';
import {deploy} from '../../src/bin/deploy';
import {computeKey} from 'hollowdb-prover';
import {deploy} from '../../src/bin/deploy';
import {ContractState} from '../../src/contracts/types';

/** Add funds to any wallet. */
Expand Down

0 comments on commit 325fccd

Please sign in to comment.