Skip to content

Commit 35f0e51

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

14 files changed

+22
-20
lines changed

Diff for: chain/test_chain.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ package chain
33
import (
44
"errors"
55
"fmt"
6-
compilationTypes "github.com/crytic/medusa/compilation/types"
6+
"maps"
77
"math/big"
88

9+
compilationTypes "github.com/crytic/medusa/compilation/types"
10+
911
"github.com/crytic/medusa/chain/state"
1012
"golang.org/x/net/context"
1113

@@ -15,7 +17,6 @@ import (
1517
"github.com/crytic/medusa-geth/triedb/hashdb"
1618
"github.com/crytic/medusa/chain/config"
1719
"github.com/holiman/uint256"
18-
"golang.org/x/exp/maps"
1920

2021
"github.com/crytic/medusa-geth/common"
2122
"github.com/crytic/medusa-geth/common/math"

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-geth/common"
78
"github.com/crytic/medusa-geth/core/tracing"
89
coretypes "github.com/crytic/medusa-geth/core/types"
910
"github.com/crytic/medusa-geth/core/vm"
1011
"github.com/crytic/medusa-geth/eth/tracers"
1112
"github.com/crytic/medusa/chain/types"
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+
"slices"
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/crytic/medusa-geth/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-geth/common"
78
"github.com/crytic/medusa-geth/common/hexutil"
89
"github.com/crytic/medusa-geth/core"
910
coreTypes "github.com/crytic/medusa-geth/core/types"
1011
"github.com/crytic/medusa/chain"
1112
"github.com/crytic/medusa/logging"
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-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package contracts
22

33
import (
4+
"slices"
45
"strings"
56

6-
"golang.org/x/exp/slices"
7-
87
"github.com/crytic/medusa-geth/accounts/abi"
98
"github.com/crytic/medusa/compilation/types"
109
)

Diff for: fuzzing/executiontracer/execution_tracer.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package executiontracer
22

33
import (
4-
"github.com/crytic/medusa/fuzzing/config"
54
"math/big"
5+
"slices"
6+
7+
"github.com/crytic/medusa/fuzzing/config"
68

79
"github.com/crytic/medusa-geth/common"
810
"github.com/crytic/medusa-geth/core"
@@ -15,7 +17,6 @@ import (
1517

1618
"github.com/crytic/medusa-geth/core/vm"
1719
"github.com/crytic/medusa-geth/eth/tracers"
18-
"golang.org/x/exp/slices"
1920
)
2021

2122
// 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"
@@ -39,7 +40,6 @@ import (
3940
fuzzingutils "github.com/crytic/medusa/fuzzing/utils"
4041
"github.com/crytic/medusa/fuzzing/valuegeneration"
4142
"github.com/crytic/medusa/utils"
42-
"golang.org/x/exp/slices"
4343
)
4444

4545
// 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/coverage"
1516
"github.com/crytic/medusa/fuzzing/valuegeneration"
1617
"github.com/crytic/medusa/utils"
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

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package fuzzing
22

33
import (
44
"fmt"
5-
"github.com/crytic/medusa/fuzzing/config"
65
"math/big"
6+
"slices"
77
"sync"
88

9+
"github.com/crytic/medusa/fuzzing/config"
10+
911
"github.com/crytic/medusa-geth/core"
1012
"github.com/crytic/medusa/fuzzing/calls"
1113
"github.com/crytic/medusa/fuzzing/contracts"
1214
"github.com/crytic/medusa/fuzzing/executiontracer"
13-
"golang.org/x/exp/slices"
1415
)
1516

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

Diff for: fuzzing/test_case_property_provider.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package fuzzing
22

33
import (
44
"fmt"
5-
"github.com/crytic/medusa/fuzzing/config"
65
"math/big"
6+
"slices"
77
"sync"
88

9+
"github.com/crytic/medusa/fuzzing/config"
10+
911
"github.com/crytic/medusa-geth/core"
1012
"github.com/crytic/medusa/fuzzing/calls"
1113
"github.com/crytic/medusa/fuzzing/contracts"
1214
"github.com/crytic/medusa/fuzzing/executiontracer"
13-
"golang.org/x/exp/slices"
1415
)
1516

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

Diff for: fuzzing/valuegeneration/generator_mutational.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package valuegeneration
33
import (
44
"math/big"
55
"math/rand"
6+
"slices"
67

78
"github.com/crytic/medusa-geth/common"
89
"github.com/crytic/medusa/utils"
9-
"golang.org/x/exp/slices"
1010
)
1111

1212
// 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
@@ -3,14 +3,14 @@ package valuegeneration
33
import (
44
"encoding/hex"
55
"hash"
6+
"maps"
67
"math/big"
78
"reflect"
89

910
"github.com/crytic/medusa/utils/reflectionutils"
1011

1112
"github.com/crytic/medusa-geth/common"
1213
"golang.org/x/crypto/sha3"
13-
"golang.org/x/exp/maps"
1414
)
1515

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

0 commit comments

Comments
 (0)