Skip to content

Commit 080a164

Browse files
committed
Remove useless mutex
1 parent bd565b4 commit 080a164

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

internal/api/lib_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ const (
2626
TESTING_CACHE_SIZE = 100 // MiB
2727
)
2828

29-
// Add mutex for thread safety
30-
var testMutex sync.Mutex
31-
3229
var TESTING_CAPABILITIES = []string{"staking", "stargate", "iterator", "cosmwasm_1_1", "cosmwasm_1_2", "cosmwasm_1_3"}
3330

3431
func TestInitAndReleaseCache(t *testing.T) {
@@ -809,9 +806,7 @@ func BenchmarkContractCall(b *testing.B) {
809806
gasMeter2 := NewMockGasMeter(TESTING_GAS_LIMIT)
810807
igasMeter2 := types.GasMeter(gasMeter2)
811808
store.SetGasMeter(gasMeter2)
812-
testMutex.Lock()
813809
info = MockInfoBin(b, "fred")
814-
testMutex.Unlock()
815810
msg := []byte(`{"allocate_large_memory":{"pages":0}}`) // replace with noop once we have it
816811
res, _, err = Execute(cache, checksum, env, info, msg, &igasMeter2, store, api, &querier, TESTING_GAS_LIMIT, TESTING_PRINT_DEBUG)
817812
require.NoError(b, err)
@@ -848,9 +843,7 @@ func Benchmark100ConcurrentContractCalls(b *testing.B) {
848843
errChan := make(chan error, callCount)
849844
resChan := make(chan []byte, callCount)
850845
wg.Add(callCount)
851-
testMutex.Lock()
852846
info = MockInfoBin(b, "fred")
853-
testMutex.Unlock()
854847
for i := 0; i < callCount; i++ {
855848
go func() {
856849
defer wg.Done()

0 commit comments

Comments
 (0)