Skip to content

Commit 512e1b8

Browse files
authored
Fix postman eth_getBalance test & misc edits (#466)
Fix postman eth_getBalance test - Update to get balance on `0.0.98` account Additional misc fixes - Fix `eth_call` log - Add `callerName` to query log - Fix k6 README Signed-off-by: Nana Essilfie-Conduah <[email protected]>
1 parent 224cb65 commit 512e1b8

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

k6/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ For domain specific parameters the following rule is used:
4040
When the value of a parameter is set with an environment variable, the value will be used, but if no value is set for a
4141
particular parameter, then its value will be found by querying either the rest or rosetta APIs.
4242

43+
#### Full Suite Test
44+
45+
To run all tests, just do
46+
47+
```shell
48+
k6 run src/sceanrios/apis.js
49+
```
50+
4351
The test suite will run the tests sequentially with a configurable graceful stop time in between, so they don't
4452
interfere with each other.
4553

@@ -398,12 +406,11 @@ With the test suite mode, a simplified markdown format report `report.md` will a
398406
| web3_clientVersion | 1 | 100.00 | 2328.00/s | 2328.00/s | 0.23ms | |
399407
| web3_client_version | 1 | 100.00 | 859.18/s | 859.18/s | 0.23ms | |
400408

401-
### Single Test
409+
#### Single Test
402410

403411
To run a single test, such as the `eth_chainid` test, just do
404412

405413
```shell
406-
source src/rosetta/k6.env
407414
k6 run src/sceanrios/test/eth_chainid.js
408415
```
409416

packages/relay/src/lib/clients/sdkClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class SDKClient {
244244
const resp = await query.execute(client);
245245
this.logger.info(`${requestIdPrefix} Consensus Node query response: ${query.constructor.name} ${Status.Success._code}`);
246246
// local free queries will have a '0.0.0' accountId on transactionId
247-
this.logger.trace(`${requestIdPrefix} ${query.paymentTransactionId} query cost ${query._queryPayment}`);
247+
this.logger.trace(`${requestIdPrefix} ${query.paymentTransactionId} ${callerName} query cost: ${query._queryPayment}`);
248248

249249
this.captureMetrics(
250250
SDKClient.queryMode,
@@ -303,7 +303,7 @@ export class SDKClient {
303303
}
304304

305305
const transactionRecord: TransactionRecord = await resp.getRecord(this.clientMain);
306-
this.logger.trace(`${requestIdPrefix} ${resp.transactionId.toString()} transaction cost: ${transactionRecord.transactionFee}`);
306+
this.logger.trace(`${requestIdPrefix} ${resp.transactionId.toString()} ${callerName} transaction cost: ${transactionRecord.transactionFee}`);
307307
this.captureMetrics(
308308
SDKClient.transactionMode,
309309
transactionName,

packages/relay/src/lib/eth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ export class EthImpl implements Eth {
772772
// FIXME: In the future this will be implemented by making calls to the mirror node. For the
773773
// time being we'll eat the cost and ask the main consensus nodes instead.
774774
const requestIdPrefix = formatRequestIdMessage(requestId);
775-
this.logger.trace(`${requestIdPrefix} call(hash=${call}, blockParam=${blockParam})`, call, blockParam);
775+
this.logger.trace(`${requestIdPrefix} call(hash=${JSON.stringify(call)}, blockParam=${blockParam})`, call, blockParam);
776776
// The "to" address must always be 42 chars.
777777
if (call.to.length != 42) {
778778
throw new Error(requestIdPrefix+

packages/server/tests/postman.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
"header": [],
278278
"body": {
279279
"mode": "raw",
280-
"raw": "{\n \"id\": \"test_id\",\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_chainId\",\n \"params\": []\n}",
280+
"raw": "{\n \"id\": \"test_id\",\n \"jsonrpc\": \"2.0\",\n \"method\": \"eth_getBalance\",\n \"params\": [\"0x0000000000000000000000000000000000000062\"]\n}",
281281
"options": {
282282
"raw": {
283283
"language": "json"

0 commit comments

Comments
 (0)