-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,14 +379,8 @@ export class FallbackProvider extends BaseProvider { | |
const network = checkNetworks(providerConfigs.map((c) => (<any>(c.provider)).network)); | ||
if (network) { | ||
super(network); | ||
|
||
} else { | ||
// The network won't be known until all child providers know | ||
const ready = Promise.all(providerConfigs.map((c) => c.provider.getNetwork())).then((networks) => { | ||
return checkNetworks(networks); | ||
}); | ||
|
||
super(ready); | ||
super(this.detectNetwork()); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ricmoo
Author
Member
|
||
} | ||
|
||
// Preserve a copy, so we do not get mutated | ||
|
@@ -396,6 +390,11 @@ export class FallbackProvider extends BaseProvider { | |
this._highestBlockNumber = -1; | ||
} | ||
|
||
async detectNetwork(): Promise<Network> { | ||
const networks = await Promise.all(this.providerConfigs.map((c) => c.provider.getNetwork())); | ||
return checkNetworks(networks); | ||
} | ||
|
||
async perform(method: string, params: { [name: string]: any }): Promise<any> { | ||
|
||
// Sending transactions is special; always broadcast it to all backends | ||
|
This is throwing me
ReferenceError: must call super constructor before using 'this' in derived class constructor
.