[#1557] morph/event: Remove embedded structs from scriptHashWithValue
All checks were successful
Tests and linters / Run gofumpt (pull_request) Successful in 4m15s
Pre-commit hooks / Pre-commit (pull_request) Successful in 5m38s
Tests and linters / gopls check (pull_request) Successful in 6m6s
DCO action / DCO (pull_request) Successful in 6m13s
Vulncheck / Vulncheck (pull_request) Successful in 7m12s
Build / Build Components (pull_request) Successful in 8m9s
Tests and linters / Tests with -race (pull_request) Successful in 8m32s
Tests and linters / Tests (pull_request) Successful in 8m35s
Tests and linters / Staticcheck (pull_request) Successful in 8m32s
Tests and linters / Lint (pull_request) Successful in 9m38s

Also, make them public, because otherwise `unused` linter complains.
```
pkg/morph/event/utils.go:25:2  unused  field `typ` is unused
```
This complain is wrong, though: we _use_ `typ` field because the whole
struct is used as a map key.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2024-12-11 15:20:59 +03:00
parent e9837bbcf9
commit 6f80c82d4d
Signed by: fyrchik
SSH key fingerprint: SHA256:m/TTwCzjnRkXgnzEx9X92ccxy1CcVeinOgDb3NPWWmg
2 changed files with 6 additions and 24 deletions

View file

@ -20,13 +20,9 @@ type scriptHashValue struct {
hash util.Uint160
}
type typeValue struct {
typ Type
}
type scriptHashWithType struct {
scriptHashValue
typeValue
Hash util.Uint160
Type Type
}
type notaryRequestTypes struct {
@ -73,16 +69,6 @@ func (s scriptHashValue) ScriptHash() util.Uint160 {
return s.hash
}
// SetType is an event type setter.
func (s *typeValue) SetType(v Type) {
s.typ = v
}
// GetType is an event type getter.
func (s typeValue) GetType() Type {
return s.typ
}
// WorkerPoolHandler sets closure over worker pool w with passed handler h.
func WorkerPoolHandler(w util2.WorkerPool, h Handler, log *logger.Logger) Handler {
return func(ctx context.Context, e Event) {