forked from TrueCloudLab/frostfs-node
[#971] morph/netmap: Add optional parameters
Add optional parameters to the client call signature. Group parameters of a client call into struct to improve future codebase support. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
3114be39d0
commit
c25f5a86ae
11 changed files with 224 additions and 90 deletions
|
@ -8,8 +8,7 @@ import (
|
|||
|
||||
// EpochArgs groups the arguments
|
||||
// of get epoch number test invoke call.
|
||||
type EpochArgs struct {
|
||||
}
|
||||
type EpochArgs struct{}
|
||||
|
||||
// EpochValues groups the stack parameters
|
||||
// returned by get epoch number test invoke.
|
||||
|
@ -22,22 +21,6 @@ func (e EpochValues) Number() int64 {
|
|||
return e.num
|
||||
}
|
||||
|
||||
// EpochBlockArgs groups the arguments of
|
||||
// get epoch block number test invoke call.
|
||||
type EpochBlockArgs struct {
|
||||
}
|
||||
|
||||
// EpochBlockValues groups the stack parameters
|
||||
// returned by get epoch block number test invoke.
|
||||
type EpochBlockValues struct {
|
||||
block int64
|
||||
}
|
||||
|
||||
// Block return the block number of NeoFS epoch.
|
||||
func (e EpochBlockValues) Block() int64 {
|
||||
return e.block
|
||||
}
|
||||
|
||||
// Epoch performs the test invoke of get epoch number
|
||||
// method of NeoFS Netmap contract.
|
||||
func (c *Client) Epoch(_ EpochArgs) (*EpochValues, error) {
|
||||
|
@ -65,6 +48,21 @@ func (c *Client) Epoch(_ EpochArgs) (*EpochValues, error) {
|
|||
}, nil
|
||||
}
|
||||
|
||||
// EpochBlockArgs groups the arguments of
|
||||
// get epoch block number test invoke call.
|
||||
type EpochBlockArgs struct{}
|
||||
|
||||
// EpochBlockValues groups the stack parameters
|
||||
// returned by get epoch block number test invoke.
|
||||
type EpochBlockValues struct {
|
||||
block int64
|
||||
}
|
||||
|
||||
// Block return the block number of NeoFS epoch.
|
||||
func (e EpochBlockValues) Block() int64 {
|
||||
return e.block
|
||||
}
|
||||
|
||||
// LastEpochBlock performs the test invoke of get epoch block number
|
||||
// method of NeoFS Netmap contract.
|
||||
func (c *Client) LastEpochBlock(_ EpochBlockArgs) (*EpochBlockValues, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue