-
Notifications
You must be signed in to change notification settings - Fork 27
feat: enable recvcheck linter and corrected the reported issues #1433
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,15 +93,15 @@ func (v *Value) UnmarshalCBOR(data []byte) error { | |
| return nil | ||
| } | ||
|
|
||
| func (v Value) Cbor() []byte { | ||
| func (v *Value) Cbor() []byte { | ||
| return []byte(v.cborData) | ||
| } | ||
|
|
||
| func (v Value) Value() any { | ||
| func (v *Value) Value() any { | ||
| return v.value | ||
| } | ||
|
|
||
| func (v Value) MarshalJSON() ([]byte, error) { | ||
| func (v *Value) MarshalJSON() ([]byte, error) { | ||
| var tmpJson string | ||
| if v.value != nil { | ||
| astJson, err := generateAstJson(v.value) | ||
|
|
@@ -282,15 +282,15 @@ func NewConstructor(constructor uint, value any) Constructor { | |
| return c | ||
| } | ||
|
|
||
| func (v Constructor) Constructor() uint { | ||
| func (v *Constructor) Constructor() uint { | ||
| return v.constructor | ||
| } | ||
|
|
||
| func (v Constructor) Fields() []any { | ||
| func (v *Constructor) Fields() []any { | ||
| return v.value.Value().([]any) | ||
| } | ||
|
|
||
| func (c Constructor) FieldsCbor() []byte { | ||
| func (c *Constructor) FieldsCbor() []byte { | ||
| return c.value.Cbor() | ||
| } | ||
|
|
||
|
|
@@ -330,7 +330,7 @@ func (c *Constructor) UnmarshalCBOR(data []byte) error { | |
| return nil | ||
| } | ||
|
|
||
| func (c Constructor) MarshalCBOR() ([]byte, error) { | ||
| func (c *Constructor) MarshalCBOR() ([]byte, error) { | ||
| var tmpTag Tag | ||
| if c.constructor <= 6 { | ||
| // Alternatives 0-6 | ||
|
|
@@ -350,7 +350,7 @@ func (c Constructor) MarshalCBOR() ([]byte, error) { | |
| return Encode(&tmpTag) | ||
| } | ||
|
|
||
| func (v Constructor) MarshalJSON() ([]byte, error) { | ||
| func (v *Constructor) MarshalJSON() ([]byte, error) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Constructor MarshalJSON changed to pointer receiver but callers still marshal Constructor values, so custom JSON output is bypassed Prompt for AI agents |
||
| var sb strings.Builder | ||
| sb.WriteString(fmt.Sprintf(`{"constructor":%d,"fields":[`, v.constructor)) | ||
| tmpList := [][]byte{} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1073,7 +1073,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: utxoId.Hash, | ||
| OutputIndex: uint32(utxoId.Idx), | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Taking the address of the reused range variable makes all UTxOs share the same output pointer, corrupting decoded UTxOs. Prompt for AI agents
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: All UTxOs take the address of the reused range variable Prompt for AI agents |
||
| }) | ||
| } | ||
| continue | ||
|
|
@@ -1103,7 +1103,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: utxoId.Hash, | ||
| OutputIndex: uint32(utxoId.Idx), | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
| }) | ||
| } | ||
| continue | ||
|
|
@@ -1130,7 +1130,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: hash, | ||
| OutputIndex: uint32(idx), | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
| }) | ||
| } | ||
| } | ||
|
|
@@ -1150,7 +1150,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: utxoId.Hash, | ||
| OutputIndex: uint32(utxoId.Idx), | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
| }) | ||
| } | ||
| continue | ||
|
|
@@ -1167,7 +1167,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: utxoId.Hash, | ||
| OutputIndex: uint32(utxoId.Idx), | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
| }) | ||
| } | ||
| } | ||
|
|
@@ -1222,7 +1222,7 @@ func (s *initialStateUtxos) UnmarshalCBOR(data []byte) error { | |
| TxId: hash, | ||
| OutputIndex: index, | ||
| }, | ||
| Output: output, | ||
| Output: &output, | ||
| }) | ||
| } | ||
| } | ||
|
|
||
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.
P1: Constructor.MarshalJSON moved to pointer receiver but generateAstJson marshals a value, so MarshalJSON is skipped and constructors serialize as
{}.Prompt for AI agents