Skip to content

xpoa: parameter version works compatibly with int and string type#286

Merged
aucusaga merged 5 commits into
OpenAtomFoundation:masterfrom
aucusaga:compatible
Nov 17, 2021
Merged

xpoa: parameter version works compatibly with int and string type#286
aucusaga merged 5 commits into
OpenAtomFoundation:masterfrom
aucusaga:compatible

Conversation

@aucusaga
Copy link
Copy Markdown
Contributor

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

@aucusaga aucusaga requested review from Omkaka09 and icexin November 15, 2021 07:07
Copy link
Copy Markdown
Contributor

@Omkaka09 Omkaka09 left a comment

Choose a reason for hiding this comment

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

LGTM

}

// ParseVersion 支持string格式和int格式的version type
func ParseVersion(cfg string) (int64, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这里的逻辑可以换成这样:

  • unmarshal int,如果成功直接返回
  • unmarshal str,如果失败返回错误
  • 转换 str 到 int

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #286 (f061dea) into master (a5c5c91) will increase coverage by 0.02%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #286      +/-   ##
==========================================
+ Coverage   46.49%   46.52%   +0.02%     
==========================================
  Files         136      136              
  Lines       12126    12132       +6     
==========================================
+ Hits         5638     5644       +6     
+ Misses       5321     5319       -2     
- Partials     1167     1169       +2     
Impacted Files Coverage Δ
bcs/consensus/xpoa/schedule.go 48.64% <ø> (+0.82%) ⬆️
bcs/consensus/xpoa/common.go 77.41% <60.00%> (-8.30%) ⬇️
bcs/consensus/xpoa/xpoa.go 55.26% <100.00%> (+1.05%) ⬆️
bcs/contract/xvm/code_manager.go 63.63% <0.00%> (-2.73%) ⬇️
bcs/network/p2pv1/server.go 56.42% <0.00%> (-1.43%) ⬇️
bcs/consensus/tdpos/tdpos.go 49.27% <0.00%> (-0.97%) ⬇️
kernel/consensus/base/driver/chained-bft/smr.go 42.93% <0.00%> (+0.79%) ⬆️
bcs/consensus/pow/pow.go 42.96% <0.00%> (+1.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5c5c91...f061dea. Read the comment docs.

@aucusaga aucusaga merged commit e9bc306 into OpenAtomFoundation:master Nov 17, 2021
@aucusaga aucusaga added this to the v5.2 milestone Nov 18, 2021
aucusaga added a commit to aucusaga/xupercore that referenced this pull request Nov 18, 2021
…enAtomFoundation#286)

* xpoa: parameter version works compatibly with int and string type.
aucusaga added a commit that referenced this pull request Nov 18, 2021
* consensus: make smr run with a single validator. (#284)
* xpoa: parameter version works compatibly with int and string type (#286)
vantinfy pushed a commit to superconsensus/matrixcore that referenced this pull request Jan 26, 2022
…enAtomFoundation#286)

* xpoa: parameter version works compatibly with int and string type.

(cherry picked from commit e9bc306)
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