github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/x/token/types/params_test.go (about)

     1  package types
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/fibonacci-chain/fbc/x/common"
     7  
     8  	"github.com/fibonacci-chain/fbc/x/params"
     9  	"github.com/stretchr/testify/require"
    10  )
    11  
    12  func TestParams(t *testing.T) {
    13  	common.InitConfig()
    14  
    15  	param := DefaultParams()
    16  	expectedString := `Params: 
    17  FeeIssue: 2500.000000000000000000` + common.NativeToken + `
    18  FeeMint: 10.000000000000000000` + common.NativeToken + `
    19  FeeBurn: 10.000000000000000000` + common.NativeToken + `
    20  FeeModify: 0.000000000000000000` + common.NativeToken + `
    21  FeeChown: 10.000000000000000000` + common.NativeToken + `
    22  OwnershipConfirmWindow: 24h0m0s
    23  `
    24  
    25  	paramStr := param.String()
    26  	require.EqualValues(t, expectedString, paramStr)
    27  
    28  	psp := params.ParamSetPairs{
    29  		{Key: KeyFeeIssue, Value: &param.FeeIssue},
    30  		{Key: KeyFeeMint, Value: &param.FeeMint},
    31  		{Key: KeyFeeBurn, Value: &param.FeeBurn},
    32  		{Key: KeyFeeModify, Value: &param.FeeModify},
    33  		{Key: KeyFeeChown, Value: &param.FeeChown},
    34  		{Key: KeyOwnershipConfirmWindow, Value: &param.OwnershipConfirmWindow},
    35  	}
    36  
    37  	for i := range psp {
    38  		require.EqualValues(t, psp[i].Key, param.ParamSetPairs()[i].Key)
    39  		require.EqualValues(t, psp[i].Value, param.ParamSetPairs()[i].Value)
    40  	}
    41  
    42  }