Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Jan 12, 2024
1 parent 8adcd5b commit 850ed21
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions action/protocol/staking/bucket_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ func TestValidateBucket(t *testing.T) {
r.ErrorContains(validateBucketEndorsement(esm, bkt, true, blkHeight), "bucket is not endorsed")
// endorsed bucket
r.NoError(esm.Put(bktIdx, &Endorsement{ExpireHeight: endorsementNotExpireHeight}))
r.Nil(validateBucketEndorsement(esm, bkt, (true), blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, (false), blkHeight), "bucket is already endorsed")
r.Nil(validateBucketEndorsement(esm, bkt, true, blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, false, blkHeight), "bucket is already endorsed")
// unendorsing bucket
r.NoError(esm.Put(bktIdx, &Endorsement{ExpireHeight: blkHeight + 1}))
r.Nil(validateBucketEndorsement(esm, bkt, (true), blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, (false), blkHeight), "bucket is already endorsed")
r.Nil(validateBucketEndorsement(esm, bkt, true, blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, false, blkHeight), "bucket is already endorsed")
// endorse expired bucket
r.NoError(esm.Put(bktIdx, &Endorsement{ExpireHeight: blkHeight}))
r.Nil(validateBucketEndorsement(esm, bkt, (false), blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, (true), blkHeight), "bucket is not endorsed")
r.Nil(validateBucketEndorsement(esm, bkt, false, blkHeight))
r.ErrorContains(validateBucketEndorsement(esm, bkt, true, blkHeight), "bucket is not endorsed")
})
}

0 comments on commit 850ed21

Please sign in to comment.