This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +12
-20
lines changed Expand file tree Collapse file tree 6 files changed +12
-20
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const Ganache = {
44
44
* `options.flavor` which defaults to `ethereum`.
45
45
*/
46
46
server : < F extends AnyFlavor = EthereumFlavor > (
47
- options ?: ServerOptions < F > & ProviderOptions < F >
47
+ options ?: ServerOptions < F >
48
48
) : Server < F > => new Server < F > ( options ) ,
49
49
50
50
/**
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export class Server<F extends AnyFlavor = EthereumFlavor> extends Emittery<{
111
111
}
112
112
113
113
constructor (
114
- options : ServerOptions < F > & { flavor ?: F [ "flavor" ] } = {
114
+ options : ServerOptions < F > = {
115
115
flavor : "ethereum"
116
116
} as ServerOptions < F >
117
117
) {
@@ -126,7 +126,7 @@ export class Server<F extends AnyFlavor = EthereumFlavor> extends Emittery<{
126
126
// const provider = server.provider; // this needs to exist
127
127
// await server.listen(8545)
128
128
// ```
129
- const { flavor, connector, promise } = initializeFlavor ( options ) ;
129
+ const { flavor, connector, promise } = initializeFlavor < F > ( options ) ;
130
130
this . #connector = connector ;
131
131
132
132
let serverOptions = ServerOptionsConfig . normalize ( options ) ;
Original file line number Diff line number Diff line change @@ -14,14 +14,19 @@ export type ProviderOptions<F extends AnyFlavor> =
14
14
: {
15
15
flavor : F [ "flavor" ] ;
16
16
} ) &
17
- Parameters < F [ "connect " ] > [ 0 ] ;
17
+ Parameters < F [ "options" ] [ "provider" ] [ "normalize "] > [ 0 ] ;
18
18
19
+ /**
20
+ * The server options include the default server optoins, the flavor's server
21
+ * options, and ProviderOptions<F>
22
+ */
19
23
export type ServerOptions < F extends AnyFlavor = EthereumFlavor > = Partial < {
20
24
[ K in keyof NamespacedServerConfigOptions ] : ExternalConfig <
21
25
NamespacedServerConfigOptions [ K ]
22
26
> ;
23
27
} > &
24
- Parameters < F [ "connect" ] > [ 0 ] ;
28
+ ProviderOptions < F > &
29
+ Parameters < F [ "options" ] [ "server" ] [ "normalize" ] > [ 0 ] ;
25
30
26
31
export type InternalServerOptions =
27
32
InternalOptions < NamespacedServerConfigOptions > ;
Original file line number Diff line number Diff line change @@ -69,6 +69,6 @@ async function ready({
69
69
`curl -X POST --data '${ JSON . stringify ( {
70
70
method : "sendFunds" ,
71
71
params : [ provider . getAccounts ( ) [ 0 ] , "<a different account>" , 99 ]
72
- } ) } ' http://${ options . server . host } :${ options . options . port } `
72
+ } ) } ' http://${ options . server . host } :${ options . server . port } `
73
73
) ;
74
74
}
Original file line number Diff line number Diff line change @@ -3,11 +3,7 @@ export type {
3
3
HttpRequest ,
4
4
WebSocket
5
5
} from "@trufflesuite/uws-js-unofficial" ;
6
- export type {
7
- Connector ,
8
- ConnectorConstructor ,
9
- WebsocketConnector
10
- } from "./src/connector" ;
6
+ export type { Connector , WebsocketConnector } from "./src/connector" ;
11
7
export type { Executor } from "@ganache/utils" ;
12
8
13
9
export type { ServerConfig } from "./src/options/server/server-config" ;
Original file line number Diff line number Diff line change @@ -7,15 +7,6 @@ import {
7
7
8
8
export type { WebSocket , HttpRequest } from "@trufflesuite/uws-js-unofficial" ;
9
9
10
- export interface ConnectorConstructor < Provider , RequestFormat , ResponseFormat > {
11
- new (
12
- providerOptions : Partial <
13
- Record < string , unknown | Partial < Record < string , unknown > > >
14
- > | null ,
15
- executor : Executor
16
- ) : Connector < Provider , RequestFormat , ResponseFormat > ;
17
- }
18
-
19
10
/**
20
11
* Connects an arbitrary public chain provider to ganache
21
12
*/
You can’t perform that action at this time.
0 commit comments