Skip to content

Commit

Permalink
fix: revert contract test
Browse files Browse the repository at this point in the history
  • Loading branch information
martinconic committed Nov 27, 2024
1 parent c3409e3 commit 43ed54d
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions pkg/postage/postagecontract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ import (
var postageStampContractABI = abiutil.MustParseABI(chaincfg.Testnet.PostageStampABI)

func TestCreateBatch(t *testing.T) {
t.Parallel()

defer func(b uint8) {
postagecontract.BucketDepth = b
}(postagecontract.BucketDepth)
postagecontract.BucketDepth = 9
owner := common.HexToAddress("abcd")
label := "label"
postageStampAddress := common.HexToAddress("ffff")
Expand All @@ -45,7 +47,6 @@ func TestCreateBatch(t *testing.T) {
txHashCreate := common.HexToHash("c3a7")
batchID := common.HexToHash("dddd")
postageMock := postageMock.New()
postagecontract.BucketDepth = 9

expectedCallDataForExpireLimitedBatches, err := postageStampContractABI.Pack("expireLimited", big.NewInt(50))
if err != nil {
Expand Down Expand Up @@ -162,7 +163,6 @@ func TestCreateBatch(t *testing.T) {

t.Run("invalid depth", func(t *testing.T) {
depth := uint8(9)
postagecontract.BucketDepth = 9

contract := postagecontract.New(
owner,
Expand Down Expand Up @@ -214,7 +214,6 @@ func TestCreateBatch(t *testing.T) {
t.Run("insufficient validity", func(t *testing.T) {
depth := uint8(10)
totalAmount := big.NewInt(102399)
postagecontract.BucketDepth = 9

lastPriceCallData, err := postageStampContractABI.Pack("lastPrice")
if err != nil {
Expand Down Expand Up @@ -280,8 +279,10 @@ func newCreateEvent(postageContractAddress common.Address, batchId common.Hash)
}

func TestTopUpBatch(t *testing.T) {
t.Parallel()

defer func(b uint8) {
postagecontract.BucketDepth = b
}(postagecontract.BucketDepth)
postagecontract.BucketDepth = 9
owner := common.HexToAddress("abcd")
postageStampAddress := common.HexToAddress("ffff")
bzzTokenAddress := common.HexToAddress("eeee")
Expand Down Expand Up @@ -442,8 +443,10 @@ func newTopUpEvent(postageContractAddress common.Address, batch *postage.Batch)
}

func TestDiluteBatch(t *testing.T) {
t.Parallel()

defer func(b uint8) {
postagecontract.BucketDepth = b
}(postagecontract.BucketDepth)
postagecontract.BucketDepth = 9
owner := common.HexToAddress("abcd")
postageStampAddress := common.HexToAddress("ffff")
bzzTokenAddress := common.HexToAddress("eeee")
Expand Down Expand Up @@ -949,8 +952,6 @@ func TestBatchExpirer(t *testing.T) {
}

func TestLookupERC20Address(t *testing.T) {
t.Parallel()

postageStampContractAddress := common.HexToAddress("ffff")
erc20Address := common.HexToAddress("ffff")

Expand Down

0 comments on commit 43ed54d

Please sign in to comment.