diff --git a/doc/demo_milestone2.md b/doc/demo_milestone2.md index 8e59d46..b8a304e 100644 --- a/doc/demo_milestone2.md +++ b/doc/demo_milestone2.md @@ -102,7 +102,34 @@ bin/wssubscribe_all ### Support following RPC methods author_submitExtrinsic +- All transaction types are supported, but for the demonstration sending DOT transaction is used in this E2E test +``` +bin/submit_extrinsic + +for example: + +bin/submit_extrinsic 5ECcjykmdAQK71qHBCkEWpWkoMJY6NXvpdKy8UeMx16q5gFr 5FpxCaAovn3t2sTsbBeT5pWTj2rg392E8QoduwAyENcPrKht 1000000000000000000 0xABCDEF123.....123 +(private key was corrupted on purpose, both hex formats with or without leading 0x are supported) +``` + +Alternate RPC method with waiting - author_submitAndWatchExtrinsic +``` +bin/submit_extrinsicNWatch + +for example: + +bin/submit_extrinsicNWatch 5ECcjykmdAQK71qHBCkEWpWkoMJY6NXvpdKy8UeMx16q5gFr 5FpxCaAovn3t2sTsbBeT5pWTj2rg392E8QoduwAyENcPrKht 1000000000000000000 0xABCDEF123.....123 +(private key was corrupted on purpose, both hex formats with or without leading 0x are supported) +``` + author_pendingExtrinsics + +The method may be examined with the following command with different parameters. Sometimes the default node (wss://alex.unfrastructure.io/public/ws) does not report any pending extrinsics. In order to get a non-empty result, we used alternate node: wss://poc3-rpc.polkadot.io/ +``` +bin/get_pending_extrinsics wss://alex.unfrastructure.io/public/ws +bin/get_pending_extrinsics wss://poc3-rpc.polkadot.io/ +``` + author_removeExtrinsic ``` TBD @@ -111,6 +138,5 @@ TBD ### Support following WebSocket subscriptions author_extrinsicUpdate -``` -TBD -``` + +Method submit_extrinsicNWatch subscribes to extrinsicUpdate's. diff --git a/test/get_pending_extrinsics.cpp b/test/get_pending_extrinsics.cpp index ce63715..d4ea895 100644 --- a/test/get_pending_extrinsics.cpp +++ b/test/get_pending_extrinsics.cpp @@ -1,19 +1,22 @@ #include "../src/polkadot.h" +#include "helpers/cli.h" #include "helpers/mockjsonrpc.h" #undef NDEBUG #include +#define BUFSIZE 100 + int main(int argc, char *argv[]) { auto app = polkadot::api::getInstance()->app(); - app->connect(); + app->connect(getNodeUrlParam(argc, argv)); cout << endl << endl << "============================ Get Pending Extrinsics ============================" << endl; - GenericExtrinsic peBuf[20]; - int count = app->pendingExtrinsics(peBuf, 20); + GenericExtrinsic peBuf[BUFSIZE]; + int count = app->pendingExtrinsics(peBuf, BUFSIZE); cout << endl << count << " pending extrinsics returned" << endl; for (int i = 0; i < count; ++i) { - if (i < 20) { + if (i < BUFSIZE) { // Checks assert(peBuf[i].signerAddress.length() != 0); assert(peBuf[i].length >= 100); // Minimum length == length of signature structure