Skip to content

[Neo Plugins UT] Add RpcServer Unit Tests Part Blockchain.#3339

Merged
NGDAdmin merged 24 commits intoneo-project:masterfrom
Jim8y:mock-rpcserver-test
Jun 28, 2024
Merged

[Neo Plugins UT] Add RpcServer Unit Tests Part Blockchain.#3339
NGDAdmin merged 24 commits intoneo-project:masterfrom
Jim8y:mock-rpcserver-test

Conversation

@Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jun 16, 2024

Description

Neo Plugins lack unit tests, making it not clear whether our update to the code has changed any existing functionality or not. Thus having this pr to standard the plugin rpcserver method behavior.

Fixes # #3339

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • TestGetBestBlockHash
  • TestGetBlockByHash
  • TestGetBlockByIndex
  • TestGetBlockByUnknownIndex
  • TestGetBlockByUnknownHash
  • TestGetBlockByUnKnownIndex
  • TestGetBlockByUnKnownHash
  • TestGetBlockCount
  • TestGetBlockHeaderCount
  • TestGetBlockHash
  • TestGetBlockHashInvalidIndex
  • TestGetBlockHeader
  • TestGetContractState
  • TestGetContractStateUnknownContract
  • TestGetStorage
  • TestGetStorageUnknownContract
  • TestGetStorageUnknownStorageItem
  • TestFindStorage
  • TestFindStorageInvalidParams
  • TestGetRawMemPool
  • TestGetRawTransaction
  • TestGetRawTransactionUnknownTransaction
  • TestGetNextBlockValidators
  • TestGetCandidates
  • TestGetCommittee
  • TestGetNativeContracts
  • TestGetTransactionHeight
  • TestGetTransactionHeightUnknownTransaction
  • TestGetTransactionHeightInvalidParams
  • TestGetBestBlockHashInvalidParams
  • TestGetBlockInvalidParams
  • TestGetBlockHashInvalidParams
  • TestGetBlockHeaderInvalidParams
  • TestGetContractStateInvalidParams
  • TestGetStorageInvalidParams
  • TestGetRawTransactionInvalidParams
  • TestInternalServerError
  • TestUnknownHeight

Test Configuration:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Jim8y and others added 7 commits June 14, 2024 06:32
* master:
  Fixed pathing and Property (neo-project#3306)
  [Neo CLI New Feature] Allow custom plugins (neo-project#3295)
  Return expect to verify neo-cli (neo-project#3318)
  [Neo CLI Optimization] fix exception message (neo-project#3314)
  fix plugin download url (neo-project#3329)
@Jim8y Jim8y changed the title [Neo Plugins UT] Add RpcServer Unit Tests Part 1. [Neo Plugins UT] Add RpcServer Unit Tests Part Blockchain. Jun 16, 2024
@Jim8y
Copy link
Contributor Author

Jim8y commented Jun 16, 2024

How come the test coverage decreased 20%,,,, while i just aded tests in this pr.....

NGDAdmin
NGDAdmin previously approved these changes Jun 20, 2024
cschuchardt88
cschuchardt88 previously approved these changes Jun 20, 2024
shargon
shargon previously approved these changes Jun 20, 2024
Copy link
Member

@AnnaShaleva AnnaShaleva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good set of tests.

/// An array containing the transaction hash as the first element,
/// and an optional boolean indicating whether to return verbose information.
/// </param>
/// <returns>The transaction data as a <see cref="JToken"/>. In json format if the second item of _params is true, otherwise base64string. </returns>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the base64string pattern being repeated, so it's probably intentionally.

Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
@Jim8y Jim8y dismissed stale reviews from cschuchardt88 and shargon via 67eddfa June 25, 2024 23:14
Jimmy and others added 4 commits June 26, 2024 18:30
Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
Co-authored-by: Anna Shaleva <shaleva.ann@gmail.com>
@NGDAdmin NGDAdmin merged commit 07fb5ce into neo-project:master Jun 28, 2024
@Jim8y Jim8y deleted the mock-rpcserver-test branch July 19, 2024 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants