From 4b078871160983a629b30dfc4e66799e8b762cf1 Mon Sep 17 00:00:00 2001 From: istae <14264581+istae@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:53:21 +0300 Subject: [PATCH] chore: upgrade abi version (#4780) --- .github/workflows/beekeeper.yml | 2 +- go.mod | 2 +- go.sum | 4 ++-- pkg/storageincentives/staking/contract.go | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/beekeeper.yml b/.github/workflows/beekeeper.yml index 944076d5676..58f40624408 100644 --- a/.github/workflows/beekeeper.yml +++ b/.github/workflows/beekeeper.yml @@ -12,7 +12,7 @@ env: REPLICA: 3 RUN_TYPE: "PR RUN" SETUP_CONTRACT_IMAGE: "ethersphere/bee-localchain" - SETUP_CONTRACT_IMAGE_TAG: "0.9.1-rc1" + SETUP_CONTRACT_IMAGE_TAG: "0.9.1-rc3" BEELOCAL_BRANCH: "main" BEEKEEPER_BRANCH: "master" BEEKEEPER_METRICS_ENABLED: false diff --git a/go.mod b/go.mod index dac2171ca23..a58ad76db0a 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/coreos/go-semver v0.3.0 github.com/ethereum/go-ethereum v1.14.3 github.com/ethersphere/go-price-oracle-abi v0.2.0 - github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc1 + github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc3 github.com/ethersphere/go-sw3-abi v0.6.5 github.com/ethersphere/langos v1.0.0 github.com/go-playground/validator/v10 v10.11.1 diff --git a/go.sum b/go.sum index acde65cdd7b..feda882ed8a 100644 --- a/go.sum +++ b/go.sum @@ -236,8 +236,8 @@ github.com/ethereum/go-ethereum v1.14.3 h1:5zvnAqLtnCZrU9uod1JCvHWJbPMURzYFHfc2e github.com/ethereum/go-ethereum v1.14.3/go.mod h1:1STrq471D0BQbCX9He0hUj4bHxX2k6mt5nOQJhDNOJ8= github.com/ethersphere/go-price-oracle-abi v0.2.0 h1:wtIcYLgNZHY4BjYwJCnu93SvJdVAZVvBaKinspyyHvQ= github.com/ethersphere/go-price-oracle-abi v0.2.0/go.mod h1:sI/Qj4/zJ23/b1enzwMMv0/hLTpPNVNacEwCWjo6yBk= -github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc1 h1:+BfZEv0zIN9MKQeRsZG/y3KruIuPlHHaG01oJ2wAvNA= -github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc1/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= +github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc3 h1:cROwOEgT4L+C0qsx4IV/eCD1ruSlOMIyfemUTWzQwAQ= +github.com/ethersphere/go-storage-incentives-abi v0.9.1-rc3/go.mod h1:SXvJVtM4sEsaSKD0jc1ClpDLw8ErPoROZDme4Wrc/Nc= github.com/ethersphere/go-sw3-abi v0.6.5 h1:M5dcIe1zQYvGpY2K07UNkNU9Obc4U+A1fz68Ho/Q+XE= github.com/ethersphere/go-sw3-abi v0.6.5/go.mod h1:BmpsvJ8idQZdYEtWnvxA8POYQ8Rl/NhyCdF0zLMOOJU= github.com/ethersphere/langos v1.0.0 h1:NBtNKzXTTRSue95uOlzPN4py7Aofs0xWPzyj4AI1Vcc= diff --git a/pkg/storageincentives/staking/contract.go b/pkg/storageincentives/staking/contract.go index 58fc43e2f4f..7b4252f32d8 100644 --- a/pkg/storageincentives/staking/contract.go +++ b/pkg/storageincentives/staking/contract.go @@ -29,6 +29,7 @@ var ( ErrInsufficientStake = errors.New("insufficient stake") ErrNotImplemented = errors.New("not implemented") ErrNotPaused = errors.New("contract is not paused") + ErrUnexpectedLength = errors.New("unexpected results length") approveDescription = "Approve tokens for stake deposit operations" depositStakeDescription = "Deposit Stake" @@ -322,14 +323,13 @@ func (c *contract) getPotentialStake(ctx context.Context) (*big.Int, error) { // committedStake uint256, // potentialStake uint256, // lastUpdatedBlockNumber uint256, - // isValue bool results, err := c.stakingContractABI.Unpack("stakes", result) if err != nil { return nil, err } - if len(results) < 5 { - return nil, errors.New("unexpected empty results") + if len(results) < 4 { + return nil, ErrUnexpectedLength } return abi.ConvertType(results[2], new(big.Int)).(*big.Int), nil