Skip to content

Add logs testing

Add logs testing #52

GitHub Actions / E2E Test Report succeeded Jan 31, 2024 in 0s

120 passed, 0 failed and 0 skipped

Tests passed successfully

✅ junit.xml

120 tests were completed in 71s with 120 passed, 0 failed and 0 skipped.

Test suite Passed Failed Skipped Time
test/thorest-api/accounts/execute-codes.test.ts 11✅ 10s
test/thorest-api/accounts/get-account-code.test.ts 27✅ 9s
test/thorest-api/accounts/get-account-storage.test.ts 10✅ 39s
test/thorest-api/accounts/get-accounts.test.ts 14✅ 477ms
test/thorest-api/blocks/get-blocks.test.ts 13✅ 734ms
test/thorest-api/logs/query-events.test.ts 21✅ 29s
test/thorest-api/logs/query-transfers.test.ts 16✅ 11s
test/thorest-api/subscriptions/ws-beat2.test.ts 1✅ 10s
test/thorest-api/subscriptions/ws-blocks.test.ts 1✅ 21s
test/thorest-api/subscriptions/ws-events.test.ts 1✅ 11s
test/thorest-api/subscriptions/ws-transfers.test.ts 1✅ 10s
test/thorest-api/subscriptions/ws-tx-pool.test.ts 1✅ 20s
test/thorest-api/transactions/get-transaction-receipt.test.ts 1✅ 436ms
test/thorest-api/transactions/get-transaction.test.ts 1✅ 550ms
test/thorest-api/transactions/post-transaction.test.ts 1✅ 10s

✅ test/thorest-api/accounts/execute-codes.test.ts

POST /accounts/*
  ✅ should execute an array of clauses
  ✅ should be able to query historic revisions
  ✅ should be able execute clauses for valid revision: best
  ✅ should be able execute clauses for valid revision: 1
  ✅ should be able execute clauses for valid revision: 0x00000000920b473fff58c0de5a23ea2e7c17d1c52b132821e7f035c3295938c6
  ✅ valid revisions not found: 123412341
  ✅ valid revisions not found: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b42a
POST /accounts/* =>> execute with evm fields
  ✅ should return the correct block ref
  ✅ should return the correct gas payer
  ✅ should return the correct proved work
  ✅ should return the correct expiration

✅ test/thorest-api/accounts/get-account-code.test.ts

GET /accounts/{address}/code
  ✅ should return no code for newly created address: 0xdcb7725a9622788f79d598691586033a19db521c
  ✅ should return no code for newly created address: 0x268fcff1e8a2b3ec3755c46723ceec9bd3ce18b4
  ✅ should return no code for newly created address: 0xe28e97ef8e36e0754e265aff2f004af6d16755d5
  ✅ should return no code for newly created address: 0x8a56a815d338d6d53294eb116af8bbff98438405
  ✅ should return the code for authority: 0x0000000000000000000000417574686f72697479
  ✅ should return the code for energy: 0x0000000000000000000000000000456e65726779
  ✅ should return the code for extension: 0x0000000000000000000000457874656E73696F6e
  ✅ should return the code for params: 0x0000000000000000000000000000506172616D73
  ✅ should return the code for executor: 0x0000000000000000000000004578656375746f72
  ✅ should return the code for authority: 0000000000000000000000417574686f72697479
  ✅ should return the code for energy: 0000000000000000000000000000456e65726779
  ✅ should return the code for extension: 0000000000000000000000457874656E73696F6e
  ✅ should return the code for params: 0000000000000000000000000000506172616D73
  ✅ should return the code for executor: 0000000000000000000000004578656375746f72
  ✅ should return 400 for invalid address: bad address
  ✅ should return 400 for invalid address: 0x0001234
  ✅ should return 400 for invalid address: 0
  ✅ should return 400 for invalid address: false
  ✅ should be able to query historic revisions
  ✅ should be able to fetch the account state for revision: best
  ✅ should be able to fetch the account state for revision: 1
  ✅ should be able to fetch the account state for revision: 0x00000000920b473fff58c0de5a23ea2e7c17d1c52b132821e7f035c3295938c6
  ✅ should throw an error for invalid revision: bestest
  ✅ should throw an error for invalid revision: finalised
  ✅ should throw an error for invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869bZZZ
  ✅ should throw an error for invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b
  ✅ should throw an error for invalid revision: 0x

✅ test/thorest-api/accounts/get-account-storage.test.ts

GET /accounts/{address}/storage
  ✅ should return the storage value
  ✅ should be able to query history storage values
  ✅ valid revision best
  ✅ valid revision 1
  ✅ valid revision 0x00000000920b473fff58c0de5a23ea2e7c17d1c52b132821e7f035c3295938c6
  ✅ invalid revision: bestest
  ✅ invalid revision: finalised
  ✅ invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869bZZZ
  ✅ invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b
  ✅ invalid revision: 0x

✅ test/thorest-api/accounts/get-accounts.test.ts

GET /accounts/{address}
  ✅ correct balance
  ✅ contract account hasCode
  ✅ valid revision best
  ✅ valid revision 1
  ✅ valid revision 0x00000000920b473fff58c0de5a23ea2e7c17d1c52b132821e7f035c3295938c6
  ✅ invalid address: 0x00000000
  ✅ invalid address: zzzzzzz
  ✅ invalid address: 0x7567d83b7b8d80addcb281a71d54fc7b3364ffeZ
  ✅ invalid address: 0x7567d83b7b8d80addcb281a71d54fc7b3364ffe
  ✅ invalid revision: bestest
  ✅ invalid revision: finalised
  ✅ invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869bZZZ
  ✅ invalid revision: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b
  ✅ invalid revision: 0x

✅ test/thorest-api/blocks/get-blocks.test.ts

GET /blocks/{revision}
  ✅ can get block for revision: best
  ✅ can get block for revision: 1
  ✅ can get block for revision: 0x00000000920b473fff58c0de5a23ea2e7c17d1c52b132821e7f035c3295938c6
  ✅ can get block for revision: finalized
  ✅ valid revisions not found: 123412341
  ✅ valid revisions not found: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b42a
  ✅ invalid revisions: bestest
  ✅ invalid revisions: finalised
  ✅ invalid revisions: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869bZZZ
  ✅ invalid revisions: 0x00000000b4d1257f314d7b3f6720f99853bef846fa0a3d4873a2e1f5f869b
  ✅ invalid revisions: 0x
  ✅ should be able get compressed blocks
  ✅ should be able get expanded blocks

✅ test/thorest-api/logs/query-events.test.ts

POST /logs/event
  ✅ event log should be included in query
POST /logs/event =>> query by "range"
  ✅ should be able to omit the "from" field
  ✅ should be able to omit the "to" field
  ✅ should be omit the "unit" field
  ✅ should be able query by time
  ✅ should be able query by block
POST /logs/event =>> query by "order"
  ✅ events should be ordered by DESC
  ✅ events should be ordered by ASC
  ✅ default should be asc
POST /logs/event =>> query by "options"
  ✅ should be able omit all the options
  ✅ should be able to omit the "offset" field
  ✅ should be able paginate requests
POST /logs/event =>> query by "criteriaSet"
  ✅ should be able query by contract address
  ✅ should be able query by topic0 address
  ✅ should be able query by topic1
  ✅ should be able query by topic2
  ✅ should be able query by topic3
  ✅ should be able query by all topics
  ✅ should be able query by all topics and address
  ✅ should be empty for matching topics and non-matching address
  ✅ should be empty for non-matching topics and matching address

✅ test/thorest-api/logs/query-transfers.test.ts

POST /logs/transfers
  ✅ should find a log with all parameters set
POST /logs/transfers =>> query by "range"
  ✅ should be able to omit the "from" field
  ✅ should be able to omit the "to" field
  ✅ should be omit the "unit" field
  ✅ should be able query by time
  ✅ should be able query by block
POST /logs/transfers =>> query by "options"
  ✅ should be able omit all the options
  ✅ should be able to omit the "offset" field
  ✅ should be able paginate requests
POST /logs/transfers =>> query by "criteriaSet"
  ✅ should be able query by: sender
  ✅ should be able query by: txOrigin
  ✅ should be able query by: recipient
  ✅ should be able query by all criteria
POST /logs/transfers =>> query by "order"
  ✅ events should be ordered by DESC
  ✅ events should be ordered by ASC
  ✅ default should be asc

✅ test/thorest-api/subscriptions/ws-beat2.test.ts

WS /subscriptions/beat2
  ✅ should be able to subscribe

✅ test/thorest-api/subscriptions/ws-blocks.test.ts

WS /subscriptions/blocks
  ✅ should be able to subscribe

✅ test/thorest-api/subscriptions/ws-events.test.ts

WS /subscriptions/event
  ✅ should be able to subscribe

✅ test/thorest-api/subscriptions/ws-transfers.test.ts

WS /subscriptions/transfer
  ✅ should be able to subscribe

✅ test/thorest-api/subscriptions/ws-tx-pool.test.ts

WS /subscriptions/txpool
  ✅ should be able to subscribe

✅ test/thorest-api/transactions/get-transaction-receipt.test.ts

GET /transactions/{id}/receipt
  ✅ should get transaction receipt

✅ test/thorest-api/transactions/get-transaction.test.ts

GET /transactions/{id}
  ✅ should get a transaction

✅ test/thorest-api/transactions/post-transaction.test.ts

POST /transactions
  ✅ should send a transaction