Skip to content

Commit e48f1ad

Browse files
committed
refactor: replace golang.org/x/exp with stdlib
Signed-off-by: TechVest <[email protected]>
1 parent 8f2d718 commit e48f1ad

16 files changed

+19
-20
lines changed

Diff for: chain/test_chain.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package chain
33
import (
44
"errors"
55
"fmt"
6+
"maps"
67
"math/big"
78

89
"github.com/crytic/medusa/chain/state"
@@ -14,7 +15,6 @@ import (
1415
"github.com/ethereum/go-ethereum/triedb"
1516
"github.com/ethereum/go-ethereum/triedb/hashdb"
1617
"github.com/holiman/uint256"
17-
"golang.org/x/exp/maps"
1818

1919
"github.com/crytic/medusa/chain/types"
2020
"github.com/crytic/medusa/chain/vendored"

Diff for: chain/test_chain_tracer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package chain
22

33
import (
44
"math/big"
5+
"slices"
56

67
"github.com/crytic/medusa/chain/types"
78
"github.com/ethereum/go-ethereum/common"
89
"github.com/ethereum/go-ethereum/core/tracing"
910
coretypes "github.com/ethereum/go-ethereum/core/types"
1011
"github.com/ethereum/go-ethereum/core/vm"
1112
"github.com/ethereum/go-ethereum/eth/tracers"
12-
"golang.org/x/exp/slices"
1313
)
1414

1515
// TestChainTracer is an extended tracers.Tracer which can be used with a TestChain to store any captured

Diff for: cmd/completion.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package cmd
22

33
import (
44
"fmt"
5-
"golang.org/x/exp/slices"
65
"os"
6+
"strslicesings"
77
"strings"
88

99
"github.com/spf13/cobra"

Diff for: compilation/types/compiled_contract.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7+
"slices"
78
"strings"
89

910
"github.com/ethereum/go-ethereum/accounts/abi"
10-
"golang.org/x/exp/slices"
1111
)
1212

1313
// CompiledContract represents a single contract unit from a smart contract compilation.

Diff for: fuzzing/calls/call_message.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package calls
22

33
import (
44
"math/big"
5+
"slices"
56

67
"github.com/crytic/medusa/chain"
78
"github.com/crytic/medusa/logging"
89
"github.com/ethereum/go-ethereum/common"
910
"github.com/ethereum/go-ethereum/common/hexutil"
1011
"github.com/ethereum/go-ethereum/core"
1112
coreTypes "github.com/ethereum/go-ethereum/core/types"
12-
"golang.org/x/exp/slices"
1313
)
1414

1515
// The following directives will be picked up by the `go generate` command to generate JSON marshaling code from

Diff for: fuzzing/contracts/contract.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package contracts
22

33
import (
4-
"golang.org/x/exp/slices"
4+
"slices"
55
"strings"
66

77
"github.com/crytic/medusa/compilation/types"

Diff for: fuzzing/coverage/coverage_maps.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
package coverage
22

33
import (
4-
"golang.org/x/exp/slices"
5-
4+
"syslicesnc"
65
"sync"
76

87
compilationTypes "github.com/crytic/medusa/compilation/types"

Diff for: fuzzing/coverage/source_analysis.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import (
44
"bytes"
55
"encoding/json"
66
"fmt"
7+
"maps"
78
"sort"
89

910
"github.com/crytic/medusa/compilation/types"
10-
"golang.org/x/exp/maps"
1111
)
1212

1313
// SourceAnalysis describes source code coverage across a list of compilations, after analyzing associated CoverageMaps.

Diff for: fuzzing/executiontracer/execution_tracer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package executiontracer
22

33
import (
44
"math/big"
5+
"slices"
56

67
"github.com/crytic/medusa/chain"
78
"github.com/crytic/medusa/chain/types"
@@ -14,7 +15,6 @@ import (
1415

1516
"github.com/ethereum/go-ethereum/core/vm"
1617
"github.com/ethereum/go-ethereum/eth/tracers"
17-
"golang.org/x/exp/slices"
1818
)
1919

2020
// CallWithExecutionTrace obtains an execution trace for a given call, on the provided chain, using the state

Diff for: fuzzing/fuzzer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"os"
1010
"path/filepath"
1111
"runtime"
12+
"slices"
1213
"sort"
1314
"strconv"
1415
"strings"
@@ -38,7 +39,6 @@ import (
3839
"github.com/crytic/medusa/utils"
3940
"github.com/ethereum/go-ethereum/accounts/abi"
4041
"github.com/ethereum/go-ethereum/common"
41-
"golang.org/x/exp/slices"
4242
)
4343

4444
// Fuzzer represents an Ethereum smart contract fuzzing provider.

Diff for: fuzzing/fuzzer_worker.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package fuzzing
22

33
import (
44
"fmt"
5+
"maps"
56
"math/big"
67
"math/rand"
78

@@ -14,7 +15,6 @@ import (
1415
"github.com/crytic/medusa/fuzzing/valuegeneration"
1516
"github.com/crytic/medusa/utils"
1617
"github.com/ethereum/go-ethereum/common"
17-
"golang.org/x/exp/maps"
1818
)
1919

2020
// FuzzerWorker describes a single thread worker utilizing its own go-ethereum test node to run property tests against

Diff for: fuzzing/test_case_assertion_provider.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ package fuzzing
22

33
import (
44
"math/big"
5+
"slices"
56
"sync"
67

78
"github.com/crytic/medusa/compilation/abiutils"
89
"github.com/crytic/medusa/fuzzing/calls"
910
"github.com/crytic/medusa/fuzzing/config"
1011
"github.com/crytic/medusa/fuzzing/contracts"
11-
12-
"golang.org/x/exp/slices"
1312
)
1413

1514
// AssertionTestCaseProvider is am AssertionTestCase provider which spawns test cases for every contract method and

Diff for: fuzzing/test_case_optimization_provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package fuzzing
33
import (
44
"fmt"
55
"math/big"
6+
"slices"
67
"sync"
78

89
"github.com/crytic/medusa/fuzzing/calls"
910
"github.com/crytic/medusa/fuzzing/contracts"
1011
"github.com/crytic/medusa/fuzzing/executiontracer"
1112
"github.com/ethereum/go-ethereum/core"
12-
"golang.org/x/exp/slices"
1313
)
1414

1515
// MIN_INT is the minimum value for an int256 in hexadecimal

Diff for: fuzzing/test_case_property_provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package fuzzing
33
import (
44
"fmt"
55
"math/big"
6+
"slices"
67
"sync"
78

89
"github.com/crytic/medusa/fuzzing/calls"
910
"github.com/crytic/medusa/fuzzing/contracts"
1011
"github.com/crytic/medusa/fuzzing/executiontracer"
1112
"github.com/ethereum/go-ethereum/core"
12-
"golang.org/x/exp/slices"
1313
)
1414

1515
// PropertyTestCaseProvider is a provider for on-chain property tests.

Diff for: fuzzing/valuegeneration/generator_mutational.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
package valuegeneration
22

33
import (
4-
"github.com/crytic/medusa/utils"
5-
"github.com/ethereum/go-ethereum/common"
6-
"golang.org/x/exp/slices"
74
"math/big"
85
"math/rand"
6+
"slices"
7+
8+
"github.com/crytic/medusa/utils"
9+
"github.com/ethereum/go-ethereum/common"
910
)
1011

1112
// MutationalValueGenerator represents a ValueGenerator and ValueMutator for function inputs and call arguments. It

Diff for: fuzzing/valuegeneration/value_set.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"encoding/hex"
55
"github.com/crytic/medusa/utils/reflectionutils"
66
"hash"
7+
"maps"
78
"math/big"
89
"reflect"
910

1011
"github.com/ethereum/go-ethereum/common"
1112
"golang.org/x/crypto/sha3"
12-
"golang.org/x/exp/maps"
1313
)
1414

1515
// ValueSet represents potential values of significance within the source code to be used in fuzz tests.

0 commit comments

Comments
 (0)