mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-06 07:53:12 +00:00
deploy: f26f84944f92fe287c6dbe9ee2747fd003d6b3b2
This commit is contained in:
parent
e1f64aeb69
commit
cb9485e72f
@ -12,3 +12,4 @@ import
|
||||
./v2/test_message_store,
|
||||
./v2/test_jsonrpc_waku,
|
||||
./v2/test_web3 # will remove it when rln-relay tests get added
|
||||
# TODO ./v2/test_waku_rln_relay
|
||||
|
||||
21
tests/v2/test_utils.nim
Normal file
21
tests/v2/test_utils.nim
Normal file
@ -0,0 +1,21 @@
|
||||
import web3, chronos, options, stint
|
||||
|
||||
proc deployContract*(web3: Web3, code: string, gasPrice = 0): Future[ReceiptObject] {.async.} =
|
||||
let provider = web3.provider
|
||||
let accounts = await provider.eth_accounts()
|
||||
|
||||
var code = code
|
||||
if code[1] notin {'x', 'X'}:
|
||||
code = "0x" & code
|
||||
var tr: EthSend
|
||||
tr.source = web3.defaultAccount
|
||||
tr.data = code
|
||||
tr.gas = Quantity(3000000000000).some
|
||||
if gasPrice != 0:
|
||||
tr.gasPrice = some(gasPrice)
|
||||
|
||||
let r = await web3.send(tr)
|
||||
return await web3.getMinedTransactionReceipt(r)
|
||||
|
||||
proc ethToWei*(eth: UInt256): UInt256 =
|
||||
eth * 1000000000000000000.u256
|
||||
100
tests/v2/test_waku_rln_relay.nim
Normal file
100
tests/v2/test_waku_rln_relay.nim
Normal file
File diff suppressed because one or more lines are too long
@ -297,6 +297,7 @@ proc mountStore*(node: WakuNode, store: MessageStore = nil) =
|
||||
node.subscriptions.subscribe(WakuStoreCodec, node.wakuStore.subscription())
|
||||
|
||||
proc mountRelay*(node: WakuNode, topics: seq[string] = newSeq[string]()) {.async, gcsafe.} =
|
||||
# TODO add the RLN registration
|
||||
let wakuRelay = WakuRelay.init(
|
||||
switch = node.switch,
|
||||
# Use default
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user