Skip to content

Commit 5874271

Browse files
authored
Merge pull request #26 from rarimo/fix/execution-reverted-err
Change VoteV2
2 parents 8caab4a + 5c1aaa9 commit 5874271

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/service/api/handlers/vote_v2.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import (
2929
)
3030

3131
const (
32-
OPERATION resources.ResourceType = "operation"
3332
TRANSACTION resources.ResourceType = "transaction"
3433
)
3534

@@ -120,7 +119,7 @@ func VoteV2(w http.ResponseWriter, r *http.Request) {
120119
log.WithError(err).Error("Failed to configure gas and gasPrice")
121120
// `errors.Is` is not working for rpc errors, they passed as a string without additional wrapping
122121
// because of this we operate with raw strings
123-
if strings.Contains(err.Error(), vm.ErrExecutionReverted.Error()) {
122+
if strings.Contains(strings.ToLower(err.Error()), strings.ToLower(vm.ErrExecutionReverted.Error())) {
124123
errParts := strings.Split(err.Error(), ":")
125124
contractName := strings.TrimSpace(errParts[len(errParts)-2])
126125
errMsg := errors.New(strings.TrimSpace(errParts[len(errParts)-1]))

0 commit comments

Comments
 (0)