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

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
remotes/fyrchik/meta-pebble
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 epochSnapshotMethod, // get network map snapshot by epoch method name
updateStateMethod, // update state method name for invocation updateStateMethod, // update state method name for invocation
epochMethod, // get epoch number method name epochMethod, // get epoch number method name
epochBlockMethod, // get epoch number method name lastEpochBlockMethod, // get last epoch number method name
updateInnerRing, // update innerring method name updateInnerRing, // update innerring method name
setConfigMethod, // set config method name setConfigMethod, // set config method name
configMethod string // get config value method name configMethod string // get config value method name
@ -50,7 +50,7 @@ const (
defaultAddPeerMethod = "addPeer" // default add peer method name defaultAddPeerMethod = "addPeer" // default add peer method name
defaultConfigMethod = "config" // default get config value method name defaultConfigMethod = "config" // default get config value method name
defaultEpochMethod = "epoch" // default get epoch number 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 defaultInnerRingListMethod = "innerRingList" // default get innerring list method name
defaultNetMapCandidateMethod = "netmapCandidates" // default get network candidates method name defaultNetMapCandidateMethod = "netmapCandidates" // default get network candidates method name
defaultNetMapMethod = "netmap" // default get network map method name defaultNetMapMethod = "netmap" // default get network map method name
@ -68,7 +68,7 @@ func defaultConfig() *cfg {
addPeerMethod: defaultAddPeerMethod, addPeerMethod: defaultAddPeerMethod,
configMethod: defaultConfigMethod, configMethod: defaultConfigMethod,
epochMethod: defaultEpochMethod, epochMethod: defaultEpochMethod,
epochBlockMethod: defaultEpochBlockMethod, lastEpochBlockMethod: defaultLastEpochBlockMethod,
innerRingList: defaultInnerRingListMethod, innerRingList: defaultInnerRingListMethod,
netMapCandidatesMethod: defaultNetMapCandidateMethod, netMapCandidatesMethod: defaultNetMapCandidateMethod,
netMapMethod: defaultNetMapMethod, 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 // LastEpochBlock performs the test invoke of get epoch block number
// method of NeoFS Netmap contract. // method of NeoFS Netmap contract.
func (c *Client) LastEpochBlock(_ EpochBlockArgs) (*EpochBlockValues, error) { func (c *Client) LastEpochBlock(_ EpochBlockArgs) (*EpochBlockValues, error) {
items, err := c.client.TestInvoke(c.epochBlockMethod) items, err := c.client.TestInvoke(c.lastEpochBlockMethod)
if err != nil { if err != nil {
return nil, fmt.Errorf("could not perform test invocation (%s): %w", return nil, fmt.Errorf("could not perform test invocation (%s): %w",
c.epochBlockMethod, err) c.lastEpochBlockMethod, err)
} }
if ln := len(items); ln != 1 { if ln := len(items); ln != 1 {
return nil, fmt.Errorf("unexpected stack item count (%s): %d", return nil, fmt.Errorf("unexpected stack item count (%s): %d",
c.epochBlockMethod, ln) c.lastEpochBlockMethod, ln)
} }
block, err := client.IntFromStackItem(items[0]) block, err := client.IntFromStackItem(items[0])
if err != nil { if err != nil {
return nil, fmt.Errorf("could not get number from stack item (%s): %w", return nil, fmt.Errorf("could not get number from stack item (%s): %w",
c.epochBlockMethod, err) c.lastEpochBlockMethod, err)
} }
return &EpochBlockValues{ return &EpochBlockValues{