Move struct parsers to separate file #97
No reviewers
TrueCloudLab/storage-services-committers
TrueCloudLab/storage-services-developers
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-contract#97
Loading…
Reference in a new issue
No description provided.
Delete branch "achuprov/frostfs-contract:frostfsid/move_service_functions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ref: #93
Make
frostfsid
struct parsers public to enable their use in other components.Ref: TrueCloudLab/frostfs-node#1117 TrueCloudLab/frostfs-node#1179
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com
02981ea7c6
to6b76e11a93
@ -0,0 +12,4 @@
"github.com/nspcc-dev/neo-go/pkg/vm/vmstate"
)
func UnwrapArrayOfUint160(items []stackitem.Item, err error) ([]util.Uint160, error) {
Please, remove
closes #93
from the PR description, that task was to properly integrate these torpcclient/
package (that means unwrap should accept*result.Invoke
and nomakeValidRes
nonsense).@ -0,0 +20,4 @@
return unwrap.ArrayOfUint160(MakeValidRes(stackitem.NewArray(items)))
}
func MakeValidRes(item stackitem.Item) (*result.Invoke, error) {
This function shouldn't be public, it is too generic in scope.
fixed
@ -0,0 +27,4 @@
}, nil
}
func MakeResFromAppExec(res *state.AppExecResult) (*result.Invoke, error) {
Same for this one. If it is used multiple times, it is ok to copy.
@ -0,0 +34,4 @@
}, nil
}
func ParseSubject(structArr []stackitem.Item) (*Subject, error) {
I agree with such a move of util functions to the separate file, but we need to remember that
client/client.go
is not regenerated that surely will cause errors if a refactor/introduction occurs.Didn't you consider to keep
utils.go
but removeclient.go
?My point is to use client from
rpcclient
that also allows to use anonymous invoker (doesn't require to sign txs). Then the contract's client (likefrostfs-node
,frostfs-s3-gw
) can parse received results withutil.go
. WDYT?This is another task. s3-gw uses structs from the
client.go
, so we cannot just remove it.6b76e11a93
to2aba66806c