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

feat(ioctl): support znode project management commands(based #3987) #3989

Merged
merged 22 commits into from
Nov 28, 2023

Conversation

saitofun
Copy link
Contributor

@saitofun saitofun commented Nov 21, 2023

Description

support project create, update and query command

Fixes #3982

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

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

@saitofun saitofun marked this pull request as draft November 21, 2023 18:10
@saitofun saitofun marked this pull request as ready for review November 23, 2023 12:37
ioctl/cmd/ws/wsproject.go Outdated Show resolved Hide resolved
ioctl/cmd/ws/wsprojectcreate.go Outdated Show resolved Hide resolved
ioctl/cmd/ws/wsprojectcreate.go Outdated Show resolved Hide resolved
@saitofun saitofun requested a review from envestcc November 27, 2023 06:55
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 515 lines in your changes are missing coverage. Please review.

Comparison is base (e1f0636) 75.38% compared to head (f1335e4) 76.22%.
Report is 118 commits behind head on master.

❗ Current head f1335e4 differs from pull request most recent head 5f8d6b9. Consider uploading reports for the commit 5f8d6b9 to get more accurate results

Files Patch % Lines
blockindex/contractstaking/event_handler.go 67.23% 45 Missing and 13 partials ⚠️
action/protocol/staking/staking_statereader.go 69.76% 35 Missing and 17 partials ⚠️
action/protocol/execution/evm/evm.go 44.30% 43 Missing and 1 partial ⚠️
action/protocol/staking/protocol.go 33.33% 28 Missing ⚠️
...tion/protocol/staking/contractstake_bucket_type.go 0.00% 24 Missing ⚠️
api/coreservice.go 68.49% 17 Missing and 6 partials ⚠️
blockindex/contractstaking/util.go 39.47% 22 Missing and 1 partial ⚠️
action/protocol/rewarding/fund.go 23.07% 19 Missing and 1 partial ⚠️
api/websocket.go 0.00% 20 Missing ⚠️
action/protocol/execution/evm/evmstatedbadapter.go 0.00% 19 Missing ⚠️
... and 29 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3989      +/-   ##
==========================================
+ Coverage   75.38%   76.22%   +0.84%     
==========================================
  Files         303      330      +27     
  Lines       25923    28264    +2341     
==========================================
+ Hits        19541    21545    +2004     
- Misses       5360     5618     +258     
- Partials     1022     1101      +79     

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

wsProjectRegisterContractAddress string
wsProjectRegisterContractABI abi.ABI

//go:embed wsproject.json
Copy link
Member

Choose a reason for hiding this comment

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

Learned embed from it!

ioctl/cmd/ws/wsproject.go Outdated Show resolved Hide resolved
}

func convertStringToAbiBytes32(hash string) (interface{}, error) {
t, _ := abi.NewType("bytes32", "", nil)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe using [32]byte is enough

return rsp, nil
}

func getEventInputsByName(logs []*iotextypes.Log, eventName string) (map[string]any, error) {
Copy link
Member

Choose a reason for hiding this comment

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

It's similar to unpackEventParam in blockindex/contractstaking/util.go, can we make a common util function?

ioctl/cmd/ws/wsproject.go Outdated Show resolved Hide resolved
@saitofun saitofun requested a review from envestcc November 28, 2023 05:29
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@CoderZhi CoderZhi merged commit 8a94adb into master Nov 28, 2023
4 checks passed
@CoderZhi CoderZhi deleted the feat/ioctl_znode_project branch November 28, 2023 23:58
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.

Introduce wsctl to access w3bstream node
3 participants