Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
chore: separate filecoin package into filecoin and filecoin-options (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeseese committed Mar 30, 2021
1 parent 7bf9fae commit 5f2e0bf
Show file tree
Hide file tree
Showing 60 changed files with 736 additions and 767 deletions.
5 changes: 0 additions & 5 deletions src/chains/ethereum/ethereum/src/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ export type ProviderOptions = EthereumProviderOptions | EthereumLegacyOptions;
export type Provider = EthereumProvider;
export const Provider = EthereumProvider;

export type ProviderOptions = EthereumProviderOptions | EthereumLegacyOptions;
export type Provider = EthereumProvider;
export const Provider = EthereumProvider;
export const FlavorName = "ethereum" as const;

function isHttp(
connection: HttpRequest | WebSocket
): connection is HttpRequest {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* @ganache/filecoin
*
* @copyright 2019-2020 Truffle Blockchain Group
* @copyright Truffle Blockchain Group
* @author Tim Coulter
* @license MIT
*/
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
],
"dependencies": {
"@filecoin-shipyard/lotus-client-schema": "0.0.12",
"@ganache/filecoin-options": "0.1.0",
"@ganache/options": "0.1.0",
"@ganache/utils": "0.1.0",
"base32-encoding": "1.0.0",
Expand All @@ -68,7 +69,7 @@
"@filecoin-shipyard/lotus-client-provider-browser": "0.0.14",
"@filecoin-shipyard/lotus-client-rpc": "0.0.11",
"cross-env": "7.0.2",
"nyc": "^15.1.0",
"nyc": "15.1.0",
"typedoc": "0.17.8",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v18.4.0"
}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import dagCBOR from "ipld-dag-cbor";
import { RetrievalOffer } from "./things/retrieval-offer";
import seedrandom from "seedrandom";
import BN from "bn.js";
import { FilecoinInternalOptions } from "./options";
import { FilecoinInternalOptions } from "@ganache/filecoin-options";

export type BlockchainEvents = {
ready(): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import FilecoinApi from "./api";
import { JsonRpcTypes, types, utils, PromiEvent } from "@ganache/utils";
import FilecoinProvider from "./provider";
import { RecognizedString, HttpRequest } from "uWebSockets.js";
import { FilecoinProviderOptions } from "./options";
import { FilecoinProviderOptions } from "@ganache/filecoin-options";

export type ProviderOptions = FilecoinProviderOptions;
export type Provider = FilecoinProvider;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import FilecoinApi from "./api";
import GanacheSchema from "./schema";
import { Schema } from "@filecoin-shipyard/lotus-client-schema";
import Blockchain from "./blockchain";
import { FilecoinOptionsConfig, FilecoinProviderOptions } from "./options";
import {
FilecoinOptionsConfig,
FilecoinProviderOptions
} from "@ganache/filecoin-options";

// Meant to mimic this provider:
// https://github.com/filecoin-shipyard/js-lotus-client-provider-browser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { StorageProposalData } from "../../src/things/storage-proposal-data";
import { RootCID } from "../../src/things/root-cid";
import { DealState } from "../../src/deal-state";

import { FilecoinOptionsConfig } from "../../src/options/index";
import { FilecoinOptionsConfig } from "@ganache/filecoin-options";

describe("Blockchain", () => {
describe("general", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { RequestCoordinator, Executor } from "@ganache/utils/src/utils";
import { utils } from "@ganache/utils";
import FilecoinProvider from "../../src/provider";

const getProvider = async () => {
const requestCoordinator = new RequestCoordinator(0);
const executor = new Executor(requestCoordinator);
const requestCoordinator = new utils.RequestCoordinator(0);
const executor = new utils.Executor(requestCoordinator);
const provider = new FilecoinProvider(
{
chain: {
Expand Down
22 changes: 22 additions & 0 deletions src/chains/filecoin/filecoin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "../../../../tsconfig.json",
"compilerOptions": {
"outDir": "lib"
},
"include": ["index.ts", "src/**/*"],
"typeRoots": ["./node_modules/@types", "./src/@types"],
"references": [
{
"name": "@ganache/filecoin-options",
"path": "../options"
},
{
"name": "@ganache/options",
"path": "../../../packages/options"
},
{
"name": "@ganache/utils",
"path": "../../../packages/utils"
}
]
}
8 changes: 8 additions & 0 deletions src/chains/filecoin/options/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
./index.ts
tests
.nyc_output
coverage
scripts
src
tsconfig.json
typedoc.json
21 changes: 21 additions & 0 deletions src/chains/filecoin/options/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019-2020 Truffle Blockchain Group

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions src/chains/filecoin/options/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `@ganache/filecoin-options`

> TODO: description
9 changes: 9 additions & 0 deletions src/chains/filecoin/options/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*!
* @ganache/filecoin-options
*
* @copyright Truffle Blockchain Group
* @author Tim Coulter
* @license MIT
*/

export * from "./src";
13 changes: 13 additions & 0 deletions src/chains/filecoin/options/npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions src/chains/filecoin/options/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "@ganache/filecoin-options",
"version": "0.1.0",
"description": "",
"author": "Tim Coulter",
"homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/filecoin/options#readme",
"license": "MIT",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"source": "index.ts",
"directories": {
"lib": "lib",
"test": "test"
},
"files": [
"lib"
],
"repository": {
"type": "git",
"url": "https://github.com/trufflesuite/ganache-core.git",
"directory": "src/chains/filecoin/options"
},
"scripts": {
"tsc": "ttsc",
"test": "nyc npm run mocha",
"mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'"
},
"bugs": {
"url": "https://github.com/trufflesuite/ganache-core/issues"
},
"keywords": [
"ganache",
"ganache-filecoin-options",
"ethereum",
"evm",
"blockchain",
"smart contracts",
"dapps",
"solidity",
"vyper",
"fe",
"web3",
"tooling",
"truffle"
],
"dependencies": {
"@ganache/options": "0.1.0",
"seedrandom": "3.0.5"
}
}
5 changes: 5 additions & 0 deletions src/chains/filecoin/options/tests/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import assert from "assert";

describe("@ganache/filecoin-options", () => {
it("needs tests");
});
14 changes: 14 additions & 0 deletions src/chains/filecoin/options/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../../../tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"composite": true
},
"include": ["src"],
"references": [
{
"name": "@ganache/options",
"path": "../../../packages/options"
}
]
}
8 changes: 0 additions & 8 deletions src/chains/filecoin/tsconfig.json

This file was deleted.

0 comments on commit 5f2e0bf

Please sign in to comment.