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

neofs-adm: allow to change parameters of the Policy contract #1289

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Apr 4, 2022

Tested here (will finish testing with actual parameter update check later) https://github.com/nspcc-dev/neofs-adm-tests/tree/set-policy):

$ make clone
$ NEOFS_REPO=https://github.com/fyrchik/neofs-node.git ./test.set-policy.sh neofs-adm-set-policy master

TODO: finish test, add to CI

Signed-off-by: Evgenii Stratonikov evgeniy@nspcc.ru

@codecov
Copy link

codecov bot commented Apr 5, 2022

Codecov Report

Merging #1289 (0d848b9) into master (923db59) will decrease coverage by 0.04%.
The diff coverage is 9.67%.

❗ Current head 0d848b9 differs from pull request most recent head e3cd963. Consider uploading reports for the commit e3cd963 to get more accurate results

@@            Coverage Diff             @@
##           master    #1289      +/-   ##
==========================================
- Coverage   35.48%   35.44%   -0.05%     
==========================================
  Files         310      311       +1     
  Lines       19234    19265      +31     
==========================================
+ Hits         6826     6829       +3     
- Misses      11869    11897      +28     
  Partials      539      539              
Impacted Files Coverage Δ
cmd/neofs-adm/internal/modules/morph/policy.go 0.00% <0.00%> (ø)
cmd/neofs-adm/internal/modules/morph/root.go 48.62% <42.85%> (-0.40%) ⬇️

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 923db59...e3cd963. Read the comment docs.

return fmt.Errorf("can't parse parameter value '%s': %w", args[1], err)
}

emit.AppCall(bw.BinWriter, policyHash, "set"+kv[0], callflag.All, big.NewInt(int64(value)))
Copy link
Member

Choose a reason for hiding this comment

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

does it work ok with small value? as I remember small numbers has its own opcodes. or it is ok to write any number as big.Int?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

big.Int will adjust it's behaviour appropriately. But we still can use int64 here, val is 32-bit.

…contract

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
@alexvanin alexvanin merged commit d311585 into nspcc-dev:master Apr 5, 2022
aprasolova pushed a commit to aprasolova/neofs-node that referenced this pull request Oct 19, 2022
…contract

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neofs-adm NeoFS Adm application issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants