github.com/lino-network/lino@v0.6.11/x/reputation/repv2/encoder_test.go (about)

     1  package repv2
     2  
     3  import (
     4  	// "fmt"
     5  	// "math/big"
     6  	"testing"
     7  
     8  	"github.com/stretchr/testify/suite"
     9  )
    10  
    11  type EncoderTestSuite struct {
    12  	suite.Suite
    13  }
    14  
    15  // func (suite *EncoderTestSuite) TestUserMeta() {
    16  // 	user := &userMeta{
    17  // 		Consumption       : big.NewInt()
    18  // 		Hold
    19  // 		Reputation
    20  // 		LastSettledRound
    21  // 		LastDonationRound
    22  // 		Unsettled
    23  
    24  // 	}
    25  // }
    26  
    27  // func BenchmarkEncoder(b *testing.B) {
    28  // 	user := &userMeta2{
    29  // 		Consumption:       Int{big.NewInt(10)},
    30  // 		Hold:              Int{big.NewInt(300)},
    31  // 		Reputation:        Int{big.NewInt(5000)},
    32  // 		LastSettledRound:  3,
    33  // 		LastDonationRound: 5,
    34  // 		Unsettled: []Donation2{
    35  // 			{
    36  // 				Pid:    "1344",
    37  // 				Amount: Int{big.NewInt(3333)},
    38  // 				Impact: Int{big.NewInt(55134)},
    39  // 			},
    40  // 			{
    41  // 				Pid:    "1344",
    42  // 				Amount: Int{big.NewInt(3333)},
    43  // 				Impact: Int{big.NewInt(55134)},
    44  // 			},
    45  // 		},
    46  // 	}
    47  
    48  // 	sz := 0
    49  // 	for i := 0; i < b.N; i++ {
    50  // 		dt := encodeUserMeta2(user)
    51  // 		sz += len(dt)
    52  // 		_ = decodeUserMeta2(dt)
    53  // 	}
    54  
    55  // 	fmt.Println("xcx", sz)
    56  // }
    57  
    58  func TestEncoderTestSuite(t *testing.T) {
    59  	suite.Run(t, new(EncoderTestSuite))
    60  }