parent
36e20332b6
commit
e2a09537a0
@ -1,20 +1,24 @@ |
|||||||
export function methods (): Record<string, unknown> { |
export class Net { |
||||||
return { |
vmContext |
||||||
net_version: net_version, |
options |
||||||
net_listening: net_listening, |
|
||||||
net_peerCount: net_peerCount |
constructor (vmContext, options) { |
||||||
|
this.vmContext = vmContext |
||||||
|
this.options = options |
||||||
} |
} |
||||||
} |
|
||||||
|
|
||||||
export function net_version (payload, cb): void { |
methods () { |
||||||
// should be configured networkId
|
return { |
||||||
cb(null, 1337) |
net_version: this.net_version.bind(this), |
||||||
} |
net_listening: this.net_listening.bind(this), |
||||||
|
net_peerCount: this.net_peerCount.bind(this) |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
export function net_listening (payload, cb): void { |
net_version (payload, cb) { cb(null, 1337) } |
||||||
cb(null, true) |
|
||||||
} |
net_listening (payload, cb) { cb(null, true)} |
||||||
|
|
||||||
export function net_peerCount (payload, cb): void { |
net_peerCount (payload, cb) { cb(null, 0)} |
||||||
cb(null, 0) |
|
||||||
} |
} |
||||||
|
|
||||||
|
Loading…
Reference in new issue