From 17c0e79f1c6359a1e24010db8e18e1d1a1cab8df Mon Sep 17 00:00:00 2001 From: nisdas Date: Tue, 8 May 2018 17:33:03 +0800 Subject: [PATCH] sharding: Removing Test (#92) Former-commit-id: 24cbfacd178e77721dc50a36bec4d8c8aa0ff1cf [formerly ff1f6be335a2d30b5c7ccd309261b187fa833e4d] Former-commit-id: 1540df8a127da2d1d12f1761022dad3162814aa1 --- sharding/collation_test.go | 45 -------------------------------------- 1 file changed, 45 deletions(-) diff --git a/sharding/collation_test.go b/sharding/collation_test.go index af5779f79..226bf04ae 100644 --- a/sharding/collation_test.go +++ b/sharding/collation_test.go @@ -27,51 +27,6 @@ func TestCollation_Transactions(t *testing.T) { } } -func TestCollation_ProposerAddress(t *testing.T) { - proposerAddr := common.BytesToAddress([]byte("proposer")) - header := NewCollationHeader(big.NewInt(1), nil, big.NewInt(1), &proposerAddr, []byte{}) - body := []byte{} - - collation := NewCollation(header, body, nil) - - if collation.ProposerAddress().String() != proposerAddr.String() { - t.Errorf("initialized collation does not contain correct proposer address") - } -} -func TestCollation_GasUsed(t *testing.T) { - tests := []struct { - transactions []*types.Transaction - gasUsed *big.Int - }{ - { - transactions: []*types.Transaction{ - makeTxWithGasLimit(100), - makeTxWithGasLimit(100000), - makeTxWithGasLimit(899900), - }, - gasUsed: big.NewInt(1000000), - }, { - transactions: []*types.Transaction{}, - gasUsed: big.NewInt(0), - }, - { - transactions: []*types.Transaction{ - makeTxWithGasLimit(math.MaxUint64), - makeTxWithGasLimit(9001), - makeTxWithGasLimit(math.MaxUint64), - }, - gasUsed: big.NewInt(0).SetUint64(math.MaxUint64), - }, - } - - for _, tt := range tests { - got := (&Collation{transactions: tt.transactions}).GasUsed() - if tt.gasUsed.Cmp(got) != 0 { - t.Errorf("Returned unexpected gasUsed. Got=%v, wanted=%v", got, tt.gasUsed) - } - } -} - func TestSerialize(t *testing.T) { tests := []struct { transactions []*types.Transaction