Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Neo Core Style] Rename parameters, update comments, fix code style #3294

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Jun 6, 2024

Description

This pr is mainly intended to rename the index to blockHeight. Reason of making this update is because when we use

    public static Manifest.ContractManifest Manifest { get; } =
        NativeContract.Ledger.GetContractState(ProtocolSettings.Default, uint.MaxValue).Manifest;

the second parameter is confusing, as native contract itself has a field Id, sort of confusing to people who is not familer with neo as core-devs. Well, i am also lost for a while thought shargon was passing the contract id/index in the devpack test engine.

And to avoid this pr be a single line pr, I also fixed some style issues, and a nullable issue here:

.Concat(_eventsDescriptors != null ? _eventsDescriptors.Select(u => u.ActiveIn) : [])

As Concat requires left and right value both be NotNull while _eventsDescriptors is nullable.

Fixes # (issue)

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?

Existing tests.

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

@shargon shargon merged commit 766ad08 into neo-project:master Jun 7, 2024
6 checks passed
Jim8y added a commit to Jim8y/neo that referenced this pull request Jun 7, 2024
* 'fix-3300' of github.com:Jim8y/neo:
  Fixed up `main.yml` (neo-project#3292)
  [Neo Core Style] Rename parameters, update comments, fix code style (neo-project#3294)
Jim8y added a commit to Jim8y/neo that referenced this pull request Jun 8, 2024
* master:
  Fix error when vc_redist is missing (neo-project#3293)
  Fixed up `main.yml` (neo-project#3292)
  [Neo Core Style] Rename parameters, update comments, fix code style (neo-project#3294)
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.

4 participants