Skip to content

[Add]: Witness.Empty for simplifing somethings#3836

Merged
shargon merged 4 commits intoneo-project:masterfrom
Wi1l-B0t:feat.witness-empty
Mar 16, 2025
Merged

[Add]: Witness.Empty for simplifing somethings#3836
shargon merged 4 commits intoneo-project:masterfrom
Wi1l-B0t:feat.witness-empty

Conversation

@Wi1l-B0t
Copy link
Contributor

Description

There are many code lines like this

new Witness
{
    InvocationScript = Array.Empty<byte>(),
    VerificationScript = Array.Empty<byte>()
}

This pr adds Witness.Empty to simplify these.
And simplifies some arrya initializations.

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

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 previously approved these changes Mar 16, 2025
shargon
shargon previously approved these changes Mar 16, 2025
@shargon shargon merged commit 587bdf7 into neo-project:master Mar 16, 2025
7 checks passed
@Wi1l-B0t Wi1l-B0t deleted the feat.witness-empty branch March 17, 2025 01:00
@Jim8y
Copy link
Contributor

Jim8y commented Mar 18, 2025

@shargon please give us some time to check those prs, now prs are merged so fast~~~~

Jim8y added a commit that referenced this pull request Mar 24, 2025
* master: (52 commits)
  Add SHA512 (#3845)
  Clean crypto (#3844)
  Review of #3782 (#3843)
  [`Fix`] References in `StorageKey` (#3782)
  Ensure `IInteroperable.Clone` (#3829)
  Ensure the interop types are serializable before commit (#3802)
  fix: ModInverse extension in BigIntegerExtensions (#3840)
  Style: avoid allocating emtpy array (#3841)
  Style: format json in tests/ (#3839)
  Reduce mem arguments (#3838)
  Avoid returning the entire mempool when only `maxTransactionsPerBlock` is required (#3823)
  style: use proper Assert methods (#3834)
  Nullable and fix `lock` in `SQLiteWallet` (#3816)
  [`Add`]: `Witness.Empty` for simplifing somethings (#3836)
  Style: format too-long literal strings (#3835)
  Add: NotNullWhen(true) for some out parameters (#3833)
  Update SQLiteWallet.cs (#3830)
  Revert "Optimize DeleteAccount"
  Revert "add lock to Version"
  Revert "Optimize LoadAccounts"
  ...

# Conflicts:
#	neo.sln
cschuchardt88 pushed a commit to cschuchardt88/neo that referenced this pull request Jun 8, 2025
* Add: Witness.Empty for simplifing somethings

* Update src/Neo/Network/P2P/Payloads/Witness.cs

* Update src/Neo/Network/P2P/Payloads/Witness.cs

---------

Co-authored-by: Shargon <shargon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants