Fix ProposalInfo default constructor for zero-address initialization#953
Open
Copilot wants to merge 4 commits into
Open
Fix ProposalInfo default constructor for zero-address initialization#953Copilot wants to merge 4 commits into
ProposalInfo default constructor for zero-address initialization#953Copilot wants to merge 4 commits into
Conversation
* Initial plan * Remove fisco-bcos.org URL, replace with GitHub repo URL in build.gradle Co-authored-by: kyonRay <32325790+kyonRay@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: kyonRay <32325790+kyonRay@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix ProposalInfo no-arg constructor to avoid NumberFormatException
Fix Jun 16, 2026
ProposalInfo default constructor for zero-address initialization
kyonRay
approved these changes
Jun 17, 2026
There was a problem hiding this comment.
Pull request overview
Fixes ProposalInfo’s no-arg constructor so it can be instantiated safely and its DynamicStruct ABI shape matches the full 7-field ProposalInfo definition.
Changes:
- Update
ProposalInfo()to useAddress.DEFAULT(zero address) and include both address fields in theDynamicStructtemplate. - Add a unit test validating
ProposalInfo()constructs, exposes 7 components, reports the expected ABI type string, and uses zero addresses for both address fields.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/main/java/org/fisco/bcos/sdk/v3/contract/auth/po/ProposalInfo.java | Fixes default constructor to avoid NumberFormatException and to build a 7-field ABI template (incl. both addresses). |
| src/test/java/org/fisco/bcos/sdk/v3/test/contract/auth/ProposalInfoTest.java | Adds regression test for default constructor ABI shape and zero-address initialization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
22
to
26
| public ProposalInfo() { | ||
| super( | ||
| new Address(""), | ||
| Address.DEFAULT, | ||
| Address.DEFAULT, | ||
| new Uint8(0), |
|
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.



ProposalInfo()could not be instantiated because its no-arg constructor built anAddressfrom an empty string, which throwsNumberFormatException. The constructor also omitted the second address field from the dynamic struct template, leaving the default ABI shape incomplete.Constructor fix
new Address("")with valid zero-address placeholders viaAddress.DEFAULTresourceIdandproposerin the no-arg constructor so the defaultDynamicStructmatches the full 7-fieldProposalInfoABIRegression coverage
new ProposalInfo()