Skip to content
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

Conversation

VeerChaurasia
Copy link

Implemented Execution/state.go and types.go ,the linter workflow is working perfectly when the structs are defined perfectly.

@VeerChaurasia VeerChaurasia force-pushed the Implement-Execution/state.go-execution/types.go-#23 branch from 748d941 to 75dcc6c Compare September 25, 2024 08:02
Comment on lines 25 to 51
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marshalling & unmarshalling is already implemented here .
For more understanding on how to modify the existing function & make it work here, please refer to this.

Copy link
Author

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.

@gerceboss
Copy link
Contributor

@VeerChaurasia Please make the changes by today , as the tests are failing without defined structs

@VeerChaurasia VeerChaurasia marked this pull request as draft September 28, 2024 12:00
@VeerChaurasia VeerChaurasia marked this pull request as ready for review September 28, 2024 17:05
@star-gazer111 star-gazer111 merged commit 0c9272e into BlocSoc-iitr:dev Oct 1, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants