[#371] Support recent changes in NeoFS API protocol

Support:
  * new status codes (object, container, session);
  * object `Lock` message;
  * different signature schemes.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-02-21 20:57:27 +03:00 committed by LeL
parent a4349f6692
commit 99370889d1
41 changed files with 1139 additions and 129 deletions

View file

@ -80,3 +80,17 @@ func LocalizeCommonFail(c *Code) {
func GlobalizeCommonFail(c *Code) {
c.GlobalizeSection(sectionAfterSuccess(sectionCommon))
}
// LocalizeIfInSection checks if passed global status.Code belongs to the section and:
// then localizes the code and returns true,
// else leaves the code unchanged and returns false.
//
// Arg must not be nil.
func LocalizeIfInSection(c *Code, sec uint32) bool {
if IsInSection(*c, sec) {
c.LocalizeSection(sec)
return true
}
return false
}