[#7] Add new container invocation wrapper for inner ring
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
5f3978b66c
commit
055f7be6d1
1 changed files with 33 additions and 0 deletions
33
pkg/innerring/invoke/container.go
Normal file
33
pkg/innerring/invoke/container.go
Normal file
|
@ -0,0 +1,33 @@
|
|||
package invoke
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/crypto/keys"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client"
|
||||
)
|
||||
|
||||
type (
|
||||
// ContainerParams for container put invocation.
|
||||
ContainerParams struct {
|
||||
Key *keys.PublicKey
|
||||
Container []byte
|
||||
Signature []byte
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
putContainerMethod = "put"
|
||||
)
|
||||
|
||||
// RegisterContainer invokes Put method.
|
||||
func RegisterContainer(cli *client.Client, con util.Uint160, p *ContainerParams) error {
|
||||
if cli == nil {
|
||||
return client.ErrNilClient
|
||||
}
|
||||
|
||||
return cli.Invoke(con, extraFee, putContainerMethod,
|
||||
p.Container,
|
||||
p.Signature,
|
||||
p.Key.Bytes(),
|
||||
)
|
||||
}
|
Loading…
Reference in a new issue