From bba470570fd07301ee227fa586e7bd591665dea2 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 22 Jul 2021 19:58:28 +0300 Subject: [PATCH] [#708] morph/client: Update last epoch block method name Signed-off-by: Alex Vanin --- pkg/morph/client/netmap/client.go | 6 +++--- pkg/morph/client/netmap/epoch.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/morph/client/netmap/client.go b/pkg/morph/client/netmap/client.go index b41fca2abe..e1e2a1aab5 100644 --- a/pkg/morph/client/netmap/client.go +++ b/pkg/morph/client/netmap/client.go @@ -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, diff --git a/pkg/morph/client/netmap/epoch.go b/pkg/morph/client/netmap/epoch.go index 02e00ca77b..0aad4192d0 100644 --- a/pkg/morph/client/netmap/epoch.go +++ b/pkg/morph/client/netmap/epoch.go @@ -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{