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