mirror of
https://github.com/luxfi/evmgpu.git
synced 2026-10-30 16:57:11 +00:00
49 lines
1.5 KiB
Go
49 lines
1.5 KiB
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package txallowlist
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/luxfi/evmgpu/precompile/allowlist/allowlisttest"
|
|
"github.com/luxfi/evmgpu/precompile/precompileconfig"
|
|
"github.com/luxfi/evmgpu/precompile/precompiletest"
|
|
"github.com/luxfi/evmgpu/utils"
|
|
"github.com/luxfi/geth/common"
|
|
"go.uber.org/mock/gomock"
|
|
)
|
|
|
|
func TestVerify(t *testing.T) {
|
|
allowlisttest.VerifyPrecompileWithAllowListTests(t, Module, nil)
|
|
}
|
|
|
|
func TestEqual(t *testing.T) {
|
|
admins := []common.Address{allowlisttest.TestAdminAddr}
|
|
enableds := []common.Address{allowlisttest.TestEnabledAddr}
|
|
managers := []common.Address{allowlisttest.TestManagerAddr}
|
|
tests := map[string]precompiletest.ConfigEqualTest{
|
|
"non-nil config and nil other": {
|
|
Config: NewConfig(utils.NewUint64(3), admins, enableds, managers),
|
|
Other: nil,
|
|
Expected: false,
|
|
},
|
|
"different type": {
|
|
Config: NewConfig(nil, nil, nil, nil),
|
|
Other: precompileconfig.NewMockConfig(gomock.NewController(t)),
|
|
Expected: false,
|
|
},
|
|
"different timestamp": {
|
|
Config: NewConfig(utils.NewUint64(3), admins, enableds, managers),
|
|
Other: NewConfig(utils.NewUint64(4), admins, enableds, managers),
|
|
Expected: false,
|
|
},
|
|
"same config": {
|
|
Config: NewConfig(utils.NewUint64(3), admins, enableds, managers),
|
|
Other: NewConfig(utils.NewUint64(3), admins, enableds, managers),
|
|
Expected: true,
|
|
},
|
|
}
|
|
allowlisttest.EqualPrecompileWithAllowListTests(t, Module, tests)
|
|
}
|