nwaku/tests/v2/test_waku_rln_relay.nim

103 lines
45 KiB
Nim
Raw Normal View History

Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
import
chronos, nimcrypto, options, json, stint,
test_utils,
web3
# the address of Ethereum client (ganache-cli for now)
const ethClient = "ws://localhost:8540/"
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
const membershipContractCode = "0x6080604052600060085560006009553480156200001b57600080fd5b506200002662002457565b6040518060600160405280600081526020017f2ff267fd23782a5625e6d804f0a7fa700b8dc6084e2e7a5aff7cd4b1c506d30b81526020017f07191352b37e1257205f09eaba526667cf18cb12e2cfeb2abc38e64bc0f0112e81525090506000600190506000600390506002600311620000ec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180620052356029913960400191505060405180910390fd5b82600160038110620000fa57fe5b60200201516200010f6200040560201b60201c565b1462000167576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806200525e602c913960400191505060405180910390fd5b808210620001c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806200528a6024913960400191505060405180910390fd5b80600081905550816001819055508067ffffffffffffffff81118015620001e757600080fd5b50604051908082528060200260200182016040528015620002175781602001602082028036833780820191505090505b50600290805190602001906200022f92919062002479565b508067ffffffffffffffff811180156200024857600080fd5b50604051908082528060200260200182016040528015620002785781602001602082028036833780820191505090505b50600390805190602001906200029092919062002479565b5081810367ffffffffffffffff81118015620002ab57600080fd5b50604051908082528060200260200182016040528015620002db5781602001602082028036833780820191505090505b5060049080519060200190620002f392919062002479565b5082600290600362000307929190620024cb565b508260039060036200031b929190620024cb565b5060005b828203811015620003685783838201600381106200033957fe5b6020020151600482815481106200034c57fe5b906000526020600020018190555080806001019150506200031f565b50620003b660405180604001604052808560018503600381106200038857fe5b60200201518152602001856001850360038110620003a257fe5b60200201518152506200042d60201b60201c565b600681905550600654600581905550620003ee604051806040016040528060055481526020016006548152506200042d60201b60201c565b6007819055505050506001600b819055506200253c565b60007f2ff267fd23782a5625e6d804f0a7fa700b8dc6084e2e7a5aff7cd4b1c506d30b905090565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000016040517f165d45ae851912f9a33800b04cc6617b184bf67db11ce904dc82601244551ae281527f10fc284d0af588165f4fc650fe7c53b1d80fbaac16d30518bf142117f42f820460208201527f06b687bd3c688aa9a03545d0835bca75ae82c434bf7d5fb065a2818b5c74814f60408201527f01057eb8e4bba26f12f4ea819251708d72e0605e6de827e990c3ba4ae13f5ecd60608201527e23779a38eb9ef4a9beaf4dc0a2ab5233a28ce6d10ad2512230a275b83017c360808201527f012e5dfdd4f34081753b70c897773f5d2987c8bbae32ad202a27cd61d7fba2fb7f0d1807f022a8d80d9304a1522087b8692dc0acf7b43fea28782d2ae672c0b11f7f17d468d0e6541de501481931453ed1e4a250e5e301f27dc91fe3b4bd522aa53c7f1ea09a4bd33f14eafd75e775d85e568fa668938fdd2f16fad1d4d2d2b9862b007f061f2e832c23bee84c2f09d63d371cc5eda2f749cdbe9a6a6d20469e9fa36e8b8851017f061f2e832c23bee84c2f09d63d371cc5eda2f749cdbe9a6a6d20469e9fa36e8b60208a0151017f061f2e832c23bee84c2f09d63d371cc5eda2f749cdbe9a6a6d20469e9fa36e8b8883840989848b83840909935089838409905089838b83840909925089828309905089828b8384090991507f0e4d154ca9b7f5111958289f43ed5bbc4d4f6118d45d9aefeb778179d921a59b9050808a60408b015184098b60208c015186098c8c518809010101818b8a85098c60808d015187098d60608e01518909010101828c8886098d8a88098e8c8a0901010193508b82830992508b828d8586090991508b81820992508b818d8586090990508b84850992508b848d8586090993507f298d683000ab71c72fe4371cf6cd37bb584b6d816a653ee4bfea62518a337e079250828c60408d015186098d60208e015184098e8e5186090101019550828c8b86098d60808e015184098e60608f015186090101019450828c8886098d8a84098e8c860901010193508b86870992508b868d8586090995508b85860992508b858d8586090994508b84850992508b848d8586090993507f2f860295bc93d694e74905913ddcae47290b9b5abb43a537fe40d9305bd1e1679250828c60408d015186098d60208e015188098e8e518a090101019150828c8b86098d60808e015188098e60608f01518a090101019050828c8886098d8a88098e8c8a0901010193508b82830992508b828d8586090991508b81820992508b818d8586090990508b84850992508b848d8586090993507f1dd8b95
# the contract interface
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
contract(MembershipContract):
proc registerSingle(newMember: Uint256): Uint256 # payable call
proc isValidMembershipRoot(membershipRoot: Uint256): Bool
proc membershipTest() {.async.} =
# connect to the eth client
let web3 = await newWeb3(ethClient)
echo "web3 connected"
# fetch the list of registered accounts
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
let accounts = await web3.provider.eth_accounts()
web3.defaultAccount = accounts[1]
echo "Account address ", web3.defaultAccount
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
var balance = await web3.provider.eth_getBalance(web3.defaultAccount , "latest")
echo "Initial account balance: ", balance
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
let receipt = await web3.deployContract(membershipContractCode)
var contractAddress = receipt.contractAddress.get
echo "Address of the deployed contract: ", contractAddress
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
balance = await web3.provider.eth_getBalance(web3.defaultAccount , "latest")
echo "Account balance after the contract deployment: ", balance
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
# creates a Sender object with a web3 field and contract address of type Address
var sender = web3.contractSender(MembershipContract, contractAddress)
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
# send takes three parameters, c: ContractCallBase, value = 0.u256, gas = 3000000'u64 gasPrice = 0
# should use send proc for the contract functions that update the state of the contract
echo "this is the registration result ", await sender.registerSingle(20.u256).send(value = 1.u256) # value is the membership fee
await web3.close()
echo "web3 closed"
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
# This is only a test contract for the experimentation, will be removed on the final merge
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
#[
pragma solidity >=0.4.22 <0.8.0;
contract NumberContract {
uint256 public number;
function setNumber(uint256 newNumber) public {
number = newNumber;
}
function getNumber() public view returns (uint256) {
return number;
}
}
]#
# the contract interface
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
contract(NumberContract):
proc setNumber(number: Uint256)
proc getNumber(): Uint256 {.view.}
const getNumberContractCode = "608060405234801561001057600080fd5b5060e18061001f6000396000f30060806040526004361060525763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fb5c1cb811460575780638381f58a14606e578063f2c9ecd8146092575b600080fd5b348015606257600080fd5b50606c60043560a4565b005b348015607957600080fd5b50608060a9565b60408051918252519081900360200190f35b348015609d57600080fd5b50608060af565b600055565b60005481565b600054905600a165627a7a72305820fe643610ce4d15c255ba5670a02aa3e86919cc099c10e31e2c8633926e31970e0029"
proc getNumberTest() {.async.} =
let web3 = await newWeb3(ethClient)
echo "web3 connected"
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
let accounts = await web3.provider.eth_accounts()
web3.defaultAccount = accounts[0]
var balance = await web3.provider.eth_getBalance(web3.defaultAccount , "latest")
echo "The account's initial balance: ", balance
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
let receipt = await web3.deployContract(getNumberContractCode)
var contractAddress = receipt.contractAddress.get
echo "The address of the deployed contract: ", contractAddress
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
balance = await web3.provider.eth_getBalance(web3.defaultAccount , "latest")
echo "Account balance after the contract deployment: ", balance
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
var ns = web3.contractSender(NumberContract, contractAddress)
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
discard await ns.setNumber(50.u256).send()
balance = await web3.provider.eth_getBalance(web3.defaultAccount , "latest")
echo "balance after sent: ", balance
echo "this is the number fetched from the contract: ", await ns.getNumber().call()
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
await web3.close()
echo "closed"
Test for the Rln relay/membership management contract deployment (#312) * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * enhancement/cleanup-warnings (#290) Accounting: Move flag to config and add basic test for accounting state (#284) * Accounting: Add config flag (default to false) Also fix bug where query function is called twice when flag is set. * Accounting: test state update after store req Refactor: waku_types separation of concern (trial with waku_swap) (#282) * waku_types refactor: Accounting types to waku_swap * waku_types refactor: Separate waku_swap_types file * Fix import path for waku_swap adds the test file for waku rln relay WIP: adds some initial code commented out the rln-relay test code refactor/db-message-store-split (#280) * fixes * fic * fix * fix * fix * fixed * fix * fixes * fixes, using sqlite lib fully * fix * Update sqlite.nim Waku v2 JSON-RPC REST API: Store protocol proof of concept (#263) * Waku V2 history query POC * Fix folder structure * Improve test clarity * Improve imports, returns and some naming * Changed naming conventions. Refactor & improve. Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Refactor types store (#291) * Refactor: Move waku_store into its own folder * Refactor: Move waku store types to new home (WIP) * Refactor: Fix errors and recursive imports * Fix rebase errors * Refactor: More rebase import fixes Accounting credit receiving node (#292) * Accounting WIP: Swap access through Store * Fix order bug and comment scenario + typo * WIP * Accounting: Account for receiving store node - Turn accountFor function into credit and debit - Misc formatting * Accounting: Fix bugs related to mount and test * Accounting: Simplify query signature We already have a ref to wakuSwap through wakuStore now. * Resolve rebase issues enhancement/remove-flood (#295) * removes flood * rm Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Updated submodules (#303) add Jenkinsfile and some Makefile targets for CI (#302) Signed-off-by: Jakub Sokołowski <jakub@status.im> Co-authored-by: Oskar Thorén <ot@oskarthoren.com> Accounting: End to end with Cheque PoC (#304) Added some basic debug and relay json-rpc calls (#305) Uncomment and call empty rln test adds the membership contract to the test file adds a test utils for contract deployment increases the gas limit for group management contract * removes some files * WIP: adds the interface of membership contract * uncomments the interface of getNumber contract * adds tests for interaction with the membership contract * send is replaced with call * replaces call with send * adds a todo * removes empty lines * adds some comments * adds a todo * adds the solidity code of the NumberContract * fixes a bug: replaces call with send * removes store test comments * removes excess spaces
2021-01-07 20:34:24 +00:00
waitFor membershipTest()
echo "rln-relay test finished"
# this is only for the experimentation
#waitFor getNumberTest()