Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
52496e1c
Commit
52496e1c
authored
Nov 24, 2020
by
aniket-engg
Committed by
Aniket
Nov 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
provider updated to support web3 httpProvider typedef
parent
0c4348a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
provider.ts
libs/remix-simulator/src/provider.ts
+14
-2
accounts.ts
libs/remix-simulator/test/accounts.ts
+1
-1
blocks.ts
libs/remix-simulator/test/blocks.ts
+1
-1
misc.ts
libs/remix-simulator/test/misc.ts
+1
-1
No files found.
libs/remix-simulator/src/provider.ts
View file @
52496e1c
...
@@ -14,14 +14,18 @@ import { Debug } from './methods/debug'
...
@@ -14,14 +14,18 @@ import { Debug } from './methods/debug'
import
{
generateBlock
}
from
'./genesis'
import
{
generateBlock
}
from
'./genesis'
export
class
Provider
{
export
class
Provider
{
options
options
:
Record
<
string
,
unknown
>
executionContext
executionContext
Accounts
Accounts
Transactions
Transactions
methods
methods
host
:
string
connected
:
boolean
;
constructor
(
options
=
{})
{
constructor
(
host
:
string
=
'vm'
,
options
:
Record
<
string
,
unknown
>
=
{})
{
this
.
options
=
options
this
.
options
=
options
this
.
host
=
host
this
.
connected
=
true
// TODO: init executionContext here
// TODO: init executionContext here
this
.
executionContext
=
executionContext
this
.
executionContext
=
executionContext
this
.
Accounts
=
new
Accounts
(
this
.
executionContext
)
this
.
Accounts
=
new
Accounts
(
this
.
executionContext
)
...
@@ -75,6 +79,14 @@ export class Provider {
...
@@ -75,6 +79,14 @@ export class Provider {
isConnected
()
{
isConnected
()
{
return
true
return
true
}
}
disconnect
()
{
return
false
};
supportsSubscriptions
()
{
return
true
;
};
on
(
type
,
cb
)
{
on
(
type
,
cb
)
{
this
.
executionContext
.
logsManager
.
addListener
(
type
,
cb
)
this
.
executionContext
.
logsManager
.
addListener
(
type
,
cb
)
...
...
libs/remix-simulator/test/accounts.ts
View file @
52496e1c
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
describe
(
'Accounts'
,
()
=>
{
describe
(
'Accounts'
,
()
=>
{
before
(
function
()
{
before
(
function
()
{
const
provider
:
any
=
new
Provider
()
const
provider
=
new
Provider
()
web3
.
setProvider
(
provider
)
web3
.
setProvider
(
provider
)
})
})
...
...
libs/remix-simulator/test/blocks.ts
View file @
52496e1c
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
describe
(
'blocks'
,
()
=>
{
describe
(
'blocks'
,
()
=>
{
before
(()
=>
{
before
(()
=>
{
const
provider
:
any
=
new
Provider
(
{
const
provider
=
new
Provider
(
'vm'
,
{
coinbase
:
'0x0000000000000000000000000000000000000001'
coinbase
:
'0x0000000000000000000000000000000000000001'
})
})
web3
.
setProvider
(
provider
)
web3
.
setProvider
(
provider
)
...
...
libs/remix-simulator/test/misc.ts
View file @
52496e1c
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
...
@@ -6,7 +6,7 @@ import * as assert from 'assert'
describe
(
'Misc'
,
()
=>
{
describe
(
'Misc'
,
()
=>
{
before
(()
=>
{
before
(()
=>
{
const
provider
:
any
=
new
Provider
()
const
provider
=
new
Provider
()
web3
.
setProvider
(
provider
)
web3
.
setProvider
(
provider
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment