forked from TrueCloudLab/frostfs-node
[#505] neofsid: Implement wrapper over contract client
Implement wrapper over NeoFS ID contact's client which allows to which allows you to conveniently interact with the contract. Implement `AccountKeys` method for getting a list of keys by account ID. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
68b469a79d
commit
eb26f92678
2 changed files with 61 additions and 0 deletions
23
pkg/morph/client/neofsid/wrapper/client.go
Normal file
23
pkg/morph/client/neofsid/wrapper/client.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package neofsid
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neofs-node/pkg/morph/client/neofsid"
|
||||
)
|
||||
|
||||
// ClientWrapper is a wrapper over NeoFS ID contract
|
||||
// client which provides convenient methods for
|
||||
// working with a contract.
|
||||
//
|
||||
// Working ClientWrapper must be created via Wrap.
|
||||
type ClientWrapper neofsid.Client
|
||||
|
||||
// Wrap creates, initializes and returns the ClientWrapper instance.
|
||||
//
|
||||
// If c is nil, panic occurs.
|
||||
func Wrap(c *neofsid.Client) *ClientWrapper {
|
||||
if c == nil {
|
||||
panic("neofs ID client is nil")
|
||||
}
|
||||
|
||||
return (*ClientWrapper)(c)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue