Skip to content

Commit

Permalink
Fix: view execution
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed May 17, 2022
1 parent 7ff302e commit 672a158
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/models/contract_metadata/tzip20.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package contract_metadata

import (
"bytes"
stdJSON "encoding/json"

"github.com/baking-bad/bcdhub/internal/helpers"
Expand Down Expand Up @@ -51,16 +52,16 @@ type Sections struct {
Code stdJSON.RawMessage `json:"code"`
}

var null = " null"
var null = []byte("null")

// Empty -
func (s Sections) Empty() bool {
return string(s.Code) == null && string(s.Parameter) == null && string(s.ReturnType) == null
return bytes.HasSuffix(s.Code, null) && bytes.HasSuffix(s.Parameter, null) && bytes.HasSuffix(s.ReturnType, null)
}

// IsParameterEmpty -
func (s Sections) IsParameterEmpty() bool {
return string(s.Parameter) == null
return bytes.HasSuffix(s.Parameter, null)
}

// MichelsonInitialStorageEvent -
Expand Down

0 comments on commit 672a158

Please sign in to comment.