[#708] morph/client: Update last epoch block method name

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-07-22 19:58:28 +03:00 committed by Pavel Karpy
parent 3561cf5873
commit bba470570f
2 changed files with 7 additions and 7 deletions

View file

@ -40,7 +40,7 @@ type cfg struct {
epochSnapshotMethod, // get network map snapshot by epoch method name
updateStateMethod, // update state method name for invocation
epochMethod, // get epoch number method name
epochBlockMethod, // get epoch number method name
lastEpochBlockMethod, // get last epoch number method name
updateInnerRing, // update innerring method name
setConfigMethod, // set config method name
configMethod string // get config value method name
@ -50,7 +50,7 @@ const (
defaultAddPeerMethod = "addPeer" // default add peer method name
defaultConfigMethod = "config" // default get config value method name
defaultEpochMethod = "epoch" // default get epoch number method name
defaultEpochBlockMethod = "epochBlock" // default get epoch block number method name
defaultLastEpochBlockMethod = "lastEpochBlock" // default get last epoch block number method name
defaultInnerRingListMethod = "innerRingList" // default get innerring list method name
defaultNetMapCandidateMethod = "netmapCandidates" // default get network candidates method name
defaultNetMapMethod = "netmap" // default get network map method name
@ -68,7 +68,7 @@ func defaultConfig() *cfg {
addPeerMethod: defaultAddPeerMethod,
configMethod: defaultConfigMethod,
epochMethod: defaultEpochMethod,
epochBlockMethod: defaultEpochBlockMethod,
lastEpochBlockMethod: defaultLastEpochBlockMethod,
innerRingList: defaultInnerRingListMethod,
netMapCandidatesMethod: defaultNetMapCandidateMethod,
netMapMethod: defaultNetMapMethod,

View file

@ -67,21 +67,21 @@ func (c *Client) Epoch(_ EpochArgs) (*EpochValues, error) {
// LastEpochBlock performs the test invoke of get epoch block number
// method of NeoFS Netmap contract.
func (c *Client) LastEpochBlock(_ EpochBlockArgs) (*EpochBlockValues, error) {
items, err := c.client.TestInvoke(c.epochBlockMethod)
items, err := c.client.TestInvoke(c.lastEpochBlockMethod)
if err != nil {
return nil, fmt.Errorf("could not perform test invocation (%s): %w",
c.epochBlockMethod, err)
c.lastEpochBlockMethod, err)
}
if ln := len(items); ln != 1 {
return nil, fmt.Errorf("unexpected stack item count (%s): %d",
c.epochBlockMethod, ln)
c.lastEpochBlockMethod, ln)
}
block, err := client.IntFromStackItem(items[0])
if err != nil {
return nil, fmt.Errorf("could not get number from stack item (%s): %w",
c.epochBlockMethod, err)
c.lastEpochBlockMethod, err)
}
return &EpochBlockValues{