[#107] Add client method ListFullSubjects #107
No reviewers
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#107
Loading…
Reference in a new issue
No description provided.
Delete branch "d.zverev/frostfs-contract:feature/frostfsid-add-list-subjects"
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?
Add ListFullSubjects to frostfsid client. Method slice of Subjects for the given slice of hashes.
Signed-off-by: d.zverev d.zverev@yadro.com
82b6da56aa
to0ee5ddc02d
[] Add client method ListFullSubjectsto [#107] Add client method ListFullSubjects0ee5ddc02d
tob7dfa43884
@ -260,6 +265,35 @@ func (c Client) ListSubjects() ([]util.Uint160, error) {
return UnwrapArrayOfUint160(commonclient.ReadIteratorItems(c.act, iteratorBatchSize, c.contract, listSubjectsMethod))
}
// ListSubjects gets list of subjects.
Please update comment accordingly to method.
Fixed.
b7dfa43884
tofa66432137
@ -263,0 +280,4 @@
if invoker.State != vmstate.Halt.String() {
return nil, fmt.Errorf("invocation failed: %s", invoker.FaultException)
}
subjects := make([]*Subject, 0)
please, just
var subjects []*Subject
or preallocate withmake([]*Subject, 0, len(invoker.Stack))
Changed to
var subjects []*Subject
fa66432137
tod6f1c8dfa4
@dkirillov waiting for your approval
@ -263,0 +280,4 @@
if invoker.State != vmstate.Halt.String() {
return nil, fmt.Errorf("invocation failed: %s", invoker.FaultException)
}
var subjects []*Subject
Should we pre-allocatate memory for slice? It seems we know exact size
Should we pre-allocatate memory for slice? It seems we know exact size
We can, but according previous comment i choose another option.
I can change it to pre-allocated memory if you prefer this type of definition.
Fixed.
d6f1c8dfa4
to3fd0e27df4
@ -263,0 +283,4 @@
subjects := make([]*Subject, 0, len(invoker.Stack))
for _, item := range invoker.Stack {
val := item.Value().([]stackitem.Item)
Do we need
val
here?Yes, i miss type conversion check.
Add check.
3fd0e27df4
toa6eb53ee59
a6eb53ee59
to17d3e02136
17d3e02136
toc142971bfd