Skip to content

[N3] Unify RPC logic and fix size check#936

Merged
shargon merged 1 commit intoneo-project:master-n3from
shargon:n3-rpc-length
Dec 2, 2025
Merged

[N3] Unify RPC logic and fix size check#936
shargon merged 1 commit intoneo-project:master-n3from
shargon:n3-rpc-length

Conversation

@shargon
Copy link
Member

@shargon shargon commented Dec 1, 2025

The condition tx.Length > 1024 has been removed because it is not present in the transaction validation.

This pull request refactors network fee calculation logic in the RpcServer.Wallet.cs file to improve code maintainability and reduce duplication. The main change is the extraction of repeated fee calculation code into a new helper method, which is then used in multiple transaction-related methods.

Refactoring for maintainability:

  • Introduced a new private method EnsureNetworkFee to encapsulate the network fee calculation and limit enforcement logic, replacing duplicated code in transaction creation methods (SendFrom, SendMany, and SendToAddress).
  • Updated SendFrom, SendMany, and SendToAddress methods to use the new EnsureNetworkFee helper, removing inline fee calculation logic and simplifying these methods. [1] [2] [3]

@shargon shargon merged commit 419c3f1 into neo-project:master-n3 Dec 2, 2025
3 checks passed
@shargon shargon deleted the n3-rpc-length branch December 2, 2025 12:17
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.

3 participants