Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
envestcc committed Oct 10, 2023
1 parent 4703474 commit 65eb100
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions blockindex/contractstaking/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func TestContractStakingCache_BucketsByIndices(t *testing.T) {

func TestContractStakingCache_TotalBucketCount(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)

height := uint64(0)
// no bucket
Expand Down Expand Up @@ -331,7 +331,7 @@ func TestContractStakingCache_TotalBucketCount(t *testing.T) {

func TestContractStakingCache_ActiveBucketTypes(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)

height := uint64(0)
// no bucket type
Expand Down Expand Up @@ -396,7 +396,7 @@ func TestContractStakingCache_ActiveBucketTypes(t *testing.T) {

func TestContractStakingCache_Merge(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)
height := uint64(1)
ctx := protocol.WithFeatureCtx(protocol.WithBlockCtx(genesis.WithGenesisContext(context.Background(), genesis.Default), protocol.BlockCtx{BlockHeight: height}))

Expand Down Expand Up @@ -454,7 +454,7 @@ func TestContractStakingCache_Merge(t *testing.T) {

func TestContractStakingCache_MatchBucketType(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)

// no bucket types
_, bucketType, ok := cache.MatchBucketType(big.NewInt(100), 100)
Expand Down Expand Up @@ -489,7 +489,7 @@ func TestContractStakingCache_MatchBucketType(t *testing.T) {

func TestContractStakingCache_BucketTypeCount(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)

height := uint64(0)
// no bucket type
Expand Down Expand Up @@ -518,7 +518,7 @@ func TestContractStakingCache_BucketTypeCount(t *testing.T) {

func TestContractStakingCache_LoadFromDB(t *testing.T) {
require := require.New(t)
cache := newContractStakingCache("", genesis.Default.VoteWeightCalConsts)
cache := newContractStakingCache(identityset.Address(27).String(), genesis.Default.VoteWeightCalConsts)

// load from empty db
path, err := testutil.PathOfTempFile("staking.db")
Expand Down

0 comments on commit 65eb100

Please sign in to comment.