fix plugins

pull/5370/head
Oleksii Kosynskyi 1 year ago
parent 875ed60d22
commit 11df64dbe5
  1. 12
      libs/remix-debug/src/init.ts
  2. 12
      libs/remix-lib/src/init.ts
  3. 4
      libs/remix-simulator/src/provider.ts

@ -1,18 +1,20 @@
'use strict'
import Web3, { Web3PluginBase } from 'web3'
export function extendWeb3 (web3) {
if(!web3.debug){
web3.registerPlugin(new Web3DebugPlugin())
}
}
export function loadWeb3 (url) {
if (!url) url = 'http://localhost:8545'
const web3 = new Web3()
web3.setProvider(new Web3.providers.HttpProvider(url))
web3.registerPlugin(new Web3DebugPlugin())
extendWeb3(web3)
return web3
}
export function extendWeb3 (web3) {
web3.registerPlugin(new Web3DebugPlugin())
}
export function setProvider (web3, url) {
web3.setProvider(new web3.providers.HttpProvider(url))
}

@ -1,17 +1,19 @@
'use strict'
import Web3, { Web3PluginBase } from 'web3'
export function extendWeb3 (web3) {
if(!web3.debug){
web3.registerPlugin(new Web3DebugPlugin())
}
}
export function loadWeb3 (url = 'http://localhost:8545') {
const web3 = new Web3()
web3.setProvider(new Web3.providers.HttpProvider(url))
web3.registerPlugin(new Web3DebugPlugin())
extendWeb3(web3)
return web3
}
export function extendWeb3 (web3) {
web3.registerPlugin(new Web3DebugPlugin())
}
class Web3DebugPlugin extends Web3PluginBase {
public pluginNamespace = 'debug'

@ -133,7 +133,9 @@ export class Provider {
}
export function extend (web3) {
web3.registerPlugin(new Web3TestPlugin())
if(!web3.testPlugin){
web3.registerPlugin(new Web3TestPlugin())
}
}
class Web3TestPlugin extends Web3PluginBase {

Loading…
Cancel
Save