forked from TrueCloudLab/frostfs-node
[#1377] oid, cid: Upgrade SDK package
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f65898a354
commit
f15e6e888f
118 changed files with 1455 additions and 886 deletions
|
@ -1,6 +1,7 @@
|
|||
package audit
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
|
||||
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
||||
|
@ -36,15 +37,13 @@ func (c *Client) ListAuditResultIDByEpoch(epoch uint64) ([]ResultID, error) {
|
|||
|
||||
// ListAuditResultIDByCID returns a list of audit result IDs inside audit
|
||||
// contract for specific epoch number and container ID.
|
||||
func (c *Client) ListAuditResultIDByCID(epoch uint64, cid *cid.ID) ([]ResultID, error) {
|
||||
v2 := cid.ToV2()
|
||||
if v2 == nil {
|
||||
return nil, errUnsupported // use other major version if there any
|
||||
}
|
||||
func (c *Client) ListAuditResultIDByCID(epoch uint64, cnr *cid.ID) ([]ResultID, error) {
|
||||
binCnr := make([]byte, sha256.Size)
|
||||
cnr.Encode(binCnr)
|
||||
|
||||
prm := client.TestInvokePrm{}
|
||||
prm.SetMethod(listByCIDResultsMethod)
|
||||
prm.SetArgs(epoch, v2.GetValue())
|
||||
prm.SetArgs(epoch, binCnr)
|
||||
|
||||
items, err := c.client.TestInvoke(prm)
|
||||
if err != nil {
|
||||
|
@ -55,15 +54,13 @@ func (c *Client) ListAuditResultIDByCID(epoch uint64, cid *cid.ID) ([]ResultID,
|
|||
|
||||
// ListAuditResultIDByNode returns a list of audit result IDs inside audit
|
||||
// contract for specific epoch number, container ID and inner ring public key.
|
||||
func (c *Client) ListAuditResultIDByNode(epoch uint64, cid *cid.ID, nodeKey []byte) ([]ResultID, error) {
|
||||
v2 := cid.ToV2()
|
||||
if v2 == nil {
|
||||
return nil, errUnsupported // use other major version if there any
|
||||
}
|
||||
func (c *Client) ListAuditResultIDByNode(epoch uint64, cnr *cid.ID, nodeKey []byte) ([]ResultID, error) {
|
||||
binCnr := make([]byte, sha256.Size)
|
||||
cnr.Encode(binCnr)
|
||||
|
||||
prm := client.TestInvokePrm{}
|
||||
prm.SetMethod(listByNodeResultsMethod)
|
||||
prm.SetArgs(epoch, v2.GetValue(), nodeKey)
|
||||
prm.SetArgs(epoch, binCnr, nodeKey)
|
||||
|
||||
items, err := c.client.TestInvoke(prm)
|
||||
if err != nil {
|
||||
|
|
|
@ -37,7 +37,7 @@ func TestAuditResults(t *testing.T) {
|
|||
var auditRes auditAPI.Result
|
||||
auditRes.ForEpoch(epoch)
|
||||
auditRes.SetAuditorKey(key.PublicKey().Bytes())
|
||||
auditRes.ForContainer(*id)
|
||||
auditRes.ForContainer(id)
|
||||
|
||||
prm := PutPrm{}
|
||||
prm.SetResult(&auditRes)
|
||||
|
@ -46,7 +46,7 @@ func TestAuditResults(t *testing.T) {
|
|||
|
||||
time.Sleep(5 * time.Second)
|
||||
|
||||
list, err := auditClientWrapper.ListAuditResultIDByCID(epoch, id)
|
||||
list, err := auditClientWrapper.ListAuditResultIDByCID(epoch, &id)
|
||||
require.NoError(t, err)
|
||||
require.Len(t, list, 1)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue