[#XX] types: Refactor imported SDK and API types
Some checks failed
ci/woodpecker/pr/pre-commit Pipeline was successful
Build / Build Components (1.19) (pull_request) Successful in 2m45s
Build / Build Components (1.20) (pull_request) Successful in 8m1s
Tests and linters / Tests (1.19) (pull_request) Failing after 3m0s
Tests and linters / Tests (1.20) (pull_request) Failing after 3m20s
Tests and linters / Lint (pull_request) Failing after 9m45s
Tests and linters / Tests with -race (pull_request) Failing after 4m38s
Tests and linters / Staticcheck (pull_request) Failing after 9m4s
Some checks failed
ci/woodpecker/pr/pre-commit Pipeline was successful
Build / Build Components (1.19) (pull_request) Successful in 2m45s
Build / Build Components (1.20) (pull_request) Successful in 8m1s
Tests and linters / Tests (1.19) (pull_request) Failing after 3m0s
Tests and linters / Tests (1.20) (pull_request) Failing after 3m20s
Tests and linters / Lint (pull_request) Failing after 9m45s
Tests and linters / Tests with -race (pull_request) Failing after 4m38s
Tests and linters / Staticcheck (pull_request) Failing after 9m4s
Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
parent
a65e26878b
commit
4cb9488a4a
188 changed files with 2282 additions and 1321 deletions
|
@ -27,21 +27,21 @@ func GenerateObjectWithCID(cnr cid.ID) *objectSDK.Object {
|
|||
}
|
||||
|
||||
func GenerateObjectWithCIDWithPayload(cnr cid.ID, data []byte) *objectSDK.Object {
|
||||
var ver version.Version
|
||||
ver := version.NewVersion()
|
||||
ver.SetMajor(2)
|
||||
ver.SetMinor(1)
|
||||
|
||||
var csum checksum.Checksum
|
||||
csum := checksum.NewChecksum()
|
||||
csum.SetSHA256(sha256.Sum256(data))
|
||||
|
||||
var csumTZ checksum.Checksum
|
||||
csumTZ := checksum.NewChecksum()
|
||||
csumTZ.SetTillichZemor(tz.Sum(csum.Value()))
|
||||
|
||||
obj := objectSDK.New()
|
||||
obj.SetID(oidtest.ID())
|
||||
obj.SetOwnerID(usertest.ID())
|
||||
obj.SetContainerID(cnr)
|
||||
obj.SetVersion(&ver)
|
||||
obj.SetVersion(ver)
|
||||
obj.SetPayload(data)
|
||||
obj.SetPayloadChecksum(csum)
|
||||
obj.SetPayloadHomomorphicHash(csumTZ)
|
||||
|
@ -50,7 +50,7 @@ func GenerateObjectWithCIDWithPayload(cnr cid.ID, data []byte) *objectSDK.Object
|
|||
}
|
||||
|
||||
func AddAttribute(obj *objectSDK.Object, key, val string) {
|
||||
var attr objectSDK.Attribute
|
||||
attr := *objectSDK.NewAttribute()
|
||||
attr.SetKey(key)
|
||||
attr.SetValue(val)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue