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

[action] Web3 for CandidateActivate and CandidateEndorsement #4140

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

envestcc
Copy link
Member

@envestcc envestcc commented Feb 8, 2024

Description

This pull request adds support for the web3 in the candidateActivate and candidateEndorsement actions.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [] make test
  • [] fullsync
  • [] Other test (please specify)

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

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

@CoderZhi
Copy link
Collaborator

=== RUN   TestRlpDecodeVerify
    rlp_tx_test.go:99: 
        	Error Trace:	/home/runner/work/iotex-core/iotex-core/action/rlp_tx_test.go:99
        	Error:      	Received unexpected error:
        	            	invalid key format
        	            	github.com/iotexproject/go-pkgs/crypto.init
        	            		/home/runner/go/pkg/mod/github.com/iotexproject/go-pkgs@v0.1.13/crypto/key.go:38
        	            	runtime.doInit
        	            		/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/proc.go:6331
        	            	runtime.doInit
        	            		/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/proc.go:6308
        	            	runtime.doInit
        	            		/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/proc.go:6308
        	            	runtime.main
        	            		/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/proc.go:[233](https://github.com/iotexproject/iotex-core/actions/runs/7831212883/job/21367007708?pr=4140#step:5:234)
        	            	runtime.goexit
        	            		/opt/hostedtoolcache/go/1.19.12/x64/src/runtime/asm_amd64.s:1594
        	Test:       	TestRlpDecodeVerify

Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 89.47368% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 76.15%. Comparing base (e1f0636) to head (0597d63).
Report is 195 commits behind head on master.

Files Patch % Lines
action/candidate_endorsement.go 84.21% 3 Missing and 3 partials ⚠️
action/candidate_activate.go 94.11% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4140      +/-   ##
==========================================
+ Coverage   75.38%   76.15%   +0.77%     
==========================================
  Files         303      340      +37     
  Lines       25923    29055    +3132     
==========================================
+ Hits        19541    22126    +2585     
- Misses       5360     5828     +468     
- Partials     1022     1101      +79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

"stateMutability": "nonpayable",
"type": "function"
}
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a newline

stakingContractABI abi.ABI

candidateActivateMethod abi.Method
candidateEndorsementMethod abi.Method
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

break this file into candidate_activate.go and candidate_endorsement.go, just like other staking actions?
or move the ABI part in other staking actions into this file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to put all staking-related ABIs into one file, as this will detect conflicts between different parts of the ABI.

And added TODOs to move other parts into this file in other PRs

Copy link

sonarcloud bot commented Mar 11, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
5.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

@CoderZhi CoderZhi merged commit f02fd91 into iotexproject:master Mar 11, 2024
3 of 5 checks passed
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.

4 participants