Fix UTs and known issue on Neo#3
Merged
erikzhang merged 10 commits intoerikzhang:move-neofrom Jan 7, 2026
Merged
Conversation
Signed-off-by: superboyiii <573504781@qq.com>
vncoelho
reviewed
Jan 6, 2026
|
|
||
| // Handle unclaimed gas distribution when transferring zero amount | ||
| // This allows claiming unclaimed gas by transferring 0 NEO | ||
| if (amount.IsZero && from is not null) |
There was a problem hiding this comment.
maybe move this piece of code to a function, @superboyiii
vncoelho
reviewed
Jan 6, 2026
|
|
||
| // Register the candidate | ||
| if (!RegisterInternal(engine, pubkey)) | ||
| throw new InvalidOperationException("Failed to register candidate. The witness does not match the public key."); |
There was a problem hiding this comment.
how about if it is already registered?
should we abort?
There was a problem hiding this comment.
Maybe it is good to return false as well
erikzhang
reviewed
Jan 7, 2026
erikzhang
reviewed
Jan 7, 2026
| /// <param name="amount">The amount of tokens sent.</param> | ||
| /// <param name="data">Optional data containing the public key for registration.</param> | ||
| [ContractMethod(CpuFee = 1 << 15, RequiredCallFlags = CallFlags.States | CallFlags.AllowNotify)] | ||
| private async ContractTask _OnPayment(ApplicationEngine engine, UInt160 assetId, UInt160 from, BigInteger amount, StackItem data) |
Owner
There was a problem hiding this comment.
Do we have to keep this? RegisterCandidate doesn't work?
Author
There was a problem hiding this comment.
Both can work. Just keep it compatible. Not bad but more convenient.
erikzhang
reviewed
Jan 7, 2026
src/Neo/Wallets/AssetDescriptor.cs
Outdated
| public AssetDescriptor(DataCache snapshot, ProtocolSettings settings, UInt160 assetId) | ||
| { | ||
| // GasToken is managed by TokenManagement, not a contract itself | ||
| // GasToken and NeoToken are managed by TokenManagement, not contracts themselves |
Owner
There was a problem hiding this comment.
We don't need to support NEP-17 in N4 I think.
erikzhang
approved these changes
Jan 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
_OnPaymentmethod in Governance contract to handle NEP-27 payments for validator registration, accepting only GAS tokens and burning the registration fee. (I think it's missing and should be desgined, because existed UT has this scenario)_OnTransfermethod to handle zero-amount NEO transfers, allowing users to claim unclaimed GAS by transferring 0 NEO. (This makes Neo behavior compatible with the previous)Wallet.csandAssetDescriptor.cssupport Neo token.How Has This Been Tested?
Checklist: