Skip to content

Commit

Permalink
Remove Test_forks_findTxFuncs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kourin1996 committed Jan 21, 2025
1 parent 617fb92 commit c0f5c39
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions core/types/celo_transaction_signing_forks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,67 +34,3 @@ func Test_forks_activeForks(t *testing.T) {
assert.Equal(t, []fork{&cel2{}, &celoLegacy{}}, celoForks.activeForks(1000, config))
})
}

// Test_forks_findTxFuncs tests that the correct txFuncs are returned for a given transaction type and chain config
func Test_forks_findTxFuncs(t *testing.T) {
t.Parallel()

cel2Time := uint64(1000)
config := &params.ChainConfig{
Cel2Time: &cel2Time,
}

celo2Forks := forks(celoForks.activeForks(cel2Time, config))
t.Run("Celo LegacyTx in Celo2", func(t *testing.T) {
assert.Equal(t, deprecatedTxFuncs, celo2Forks.findTxFuncs(NewTx(&LegacyTx{CeloLegacy: true})))
})

t.Run("Ethereum LegacyTx in Celo2", func(t *testing.T) {
assert.Equal(t, (*txFuncs)(nil), celo2Forks.findTxFuncs(NewTx(&LegacyTx{CeloLegacy: false})))
})

t.Run("AccessListTx in Celo2", func(t *testing.T) {
assert.Equal(t, accessListTxFuncs, celo2Forks.findTxFuncs(NewTx(&AccessListTx{})))
})

t.Run("DynamicFeeTx in Celo2", func(t *testing.T) {
assert.Equal(t, dynamicFeeTxFuncs, celo2Forks.findTxFuncs(NewTx(&DynamicFeeTx{})))
})

t.Run("CeloDynamicFeeTx in Celo2", func(t *testing.T) {
assert.Equal(t, deprecatedTxFuncs, celo2Forks.findTxFuncs(NewTx(&CeloDynamicFeeTx{})))
})

t.Run("CeloDynamicFeeTxV2 in Celo2", func(t *testing.T) {
assert.Equal(t, celoDynamicFeeTxV2Funcs, celo2Forks.findTxFuncs(NewTx(&CeloDynamicFeeTxV2{})))
})

celo1Forks := forks(celoForks.activeForks(uint64(100), config))
t.Run("Celo LegacyTx in Celo1", func(t *testing.T) {
assert.Equal(t, celoLegacyTxFuncs, celo1Forks.findTxFuncs(NewTx(&LegacyTx{CeloLegacy: true})))
})

t.Run("Ethereum LegacyTx in Celo1", func(t *testing.T) {
assert.Equal(t, (*txFuncs)(nil), celo1Forks.findTxFuncs(NewTx(&LegacyTx{CeloLegacy: false})))
})

t.Run("AccessListTx in Celo1", func(t *testing.T) {
assert.Equal(t, accessListTxFuncs, celo1Forks.findTxFuncs(NewTx(&AccessListTx{})))
})

t.Run("DynamicFeeTx in Celo1", func(t *testing.T) {
assert.Equal(t, dynamicFeeTxFuncs, celo1Forks.findTxFuncs(NewTx(&DynamicFeeTx{})))
})

t.Run("CeloDynamicFeeTx in Celo1", func(t *testing.T) {
assert.Equal(t, celoDynamicFeeTxFuncs, celo1Forks.findTxFuncs(NewTx(&CeloDynamicFeeTx{})))
})

t.Run("CeloDynamicFeeTxV2 in Celo1", func(t *testing.T) {
assert.Equal(t, celoDynamicFeeTxV2Funcs, celo1Forks.findTxFuncs(NewTx(&CeloDynamicFeeTxV2{})))
})

t.Run("CeloDenominatedTx in Celo1", func(t *testing.T) {
assert.Equal(t, (*txFuncs)(nil), celo1Forks.findTxFuncs(NewTx(&CeloDenominatedTx{})))
})
}

0 comments on commit c0f5c39

Please sign in to comment.