forked from TrueCloudLab/frostfs-node
[#1320] English Check
Signed-off-by: Elizaveta Chichindaeva <elizaveta@nspcc.ru>
This commit is contained in:
parent
d99800ee93
commit
cc7a723d77
182 changed files with 802 additions and 802 deletions
|
@ -9,34 +9,34 @@ import (
|
|||
subnetid "github.com/nspcc-dev/neofs-sdk-go/subnet/id"
|
||||
)
|
||||
|
||||
// Put represents notification about NeoFS subnet creation.
|
||||
// Put represents a notification about NeoFS subnet creation.
|
||||
// Generated by a contract when intending to create a subnet.
|
||||
type Put interface {
|
||||
// Contains ID of the subnet to be created.
|
||||
// Contains the ID of the subnet to be created.
|
||||
eventWithID
|
||||
|
||||
// ReadCreator reads user ID of the subnet creator.
|
||||
// Returns an error if ID is missing.
|
||||
// ReadCreator reads the user ID of the subnet creator.
|
||||
// Returns an error if the ID is missing.
|
||||
ReadCreator(id *owner.ID) error
|
||||
|
||||
// ReadInfo reads information about subnet to be created.
|
||||
// ReadInfo reads information about a subnet to be created.
|
||||
ReadInfo(info *subnet.Info) error
|
||||
}
|
||||
|
||||
// PutValidator asserts intent to create a subnet.
|
||||
type PutValidator struct{}
|
||||
|
||||
// errDiffOwner is returned when subnet owners differ.
|
||||
// errDiffOwner is returned when the subnet owners differ.
|
||||
var errDiffOwner = errors.New("diff subnet owners")
|
||||
|
||||
// errDiffID is returned when subnet IDs differ.
|
||||
// errDiffID is returned when the subnet IDs differ.
|
||||
var errDiffID = errors.New("diff subnet IDs")
|
||||
|
||||
// Assert processes the attempt to create a subnet. Approves the creation through nil return.
|
||||
// Assert processes the attempt to create a subnet. It approves the creation through nil return.
|
||||
//
|
||||
// All read errors of Put are forwarded.
|
||||
//
|
||||
// Returns an error on:
|
||||
// It returns an error on:
|
||||
// * zero subnet creation;
|
||||
// * empty ID or different from the one wired into info;
|
||||
// * empty owner ID or different from the one wired into info.
|
||||
|
@ -68,12 +68,12 @@ func (x PutValidator) Assert(event Put) error {
|
|||
return fmt.Errorf("read info: %w", err)
|
||||
}
|
||||
|
||||
// check if explicit ID equals to the one from info
|
||||
// check if the explicit ID equals to the one from info
|
||||
if !subnet.IDEquals(info, id) {
|
||||
return errDiffID
|
||||
}
|
||||
|
||||
// check if explicit creator equals to the one from info
|
||||
// check if the explicit creator equals to the one from info
|
||||
if !subnet.IsOwner(info, creator) {
|
||||
return errDiffOwner
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue