-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented state.go and types.go #42
Implemented state.go and types.go #42
Conversation
748d941
to
75dcc6c
Compare
execution/types.go
Outdated
func (c *CallOpts) MarshalJSON() ([]byte, error) { | ||
type Alias CallOpts | ||
return json.Marshal(&struct { | ||
*Alias | ||
Data string `json:"data,omitempty"` | ||
}{ | ||
Alias: (*Alias)(c), | ||
Data: hex.EncodeToString(c.Data), | ||
}) | ||
} | ||
func (c *CallOpts) UnmarshalJSON(data []byte) error { | ||
type Alias CallOpts | ||
aux := &struct { | ||
*Alias | ||
Data string `json:"data,omitempty"` | ||
}{ | ||
Alias: (*Alias)(c), | ||
} | ||
if err := json.Unmarshal(data, &aux); err != nil { | ||
return err | ||
} | ||
decodedData, err := hex.DecodeString(aux.Data) | ||
if err != nil { | ||
return err | ||
} | ||
c.Data = decodedData | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.actually the pr was opened before the refactoring.I will do the changes by today.
@VeerChaurasia Please make the changes by today , as the tests are failing without defined structs |
Implemented Execution/state.go and types.go ,the linter workflow is working perfectly when the structs are defined perfectly.