From 5a022363a8b11f991067d22f907ef545ce5727f9 Mon Sep 17 00:00:00 2001 From: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Date: Wed, 24 Jul 2024 05:28:48 +0530 Subject: [PATCH 1/3] Is enterprise --- wasmsdk/allocation.go | 3 ++- zboxcore/sdk/sdk.go | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wasmsdk/allocation.go b/wasmsdk/allocation.go index 3cf765e8c..4b433d895 100644 --- a/wasmsdk/allocation.go +++ b/wasmsdk/allocation.go @@ -62,7 +62,7 @@ func getAllocationBlobbers(preferredBlobberURLs []string, } func createAllocation(datashards, parityshards int, size int64, - minReadPrice, maxReadPrice, minWritePrice, maxWritePrice int64, lock int64, blobberIds, blobberAuthTickets []string, setThirdPartyExtendable, force bool) ( + minReadPrice, maxReadPrice, minWritePrice, maxWritePrice int64, lock int64, blobberIds, blobberAuthTickets []string, setThirdPartyExtendable, IsEnterprise, force bool) ( *transaction.Transaction, error) { options := sdk.CreateAllocationOptions{ @@ -80,6 +80,7 @@ func createAllocation(datashards, parityshards int, size int64, Lock: uint64(lock), BlobberIds: blobberIds, ThirdPartyExtendable: setThirdPartyExtendable, + IsEnterprise: IsEnterprise, BlobberAuthTickets: blobberAuthTickets, Force: force, } diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index 102a9191b..e2f259edd 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -1035,6 +1035,7 @@ type CreateAllocationOptions struct { BlobberIds []string BlobberAuthTickets []string ThirdPartyExtendable bool + IsEnterprise bool FileOptionsParams *FileOptionsParameters Force bool } @@ -1045,14 +1046,14 @@ func CreateAllocationWith(options CreateAllocationOptions) ( return CreateAllocationForOwner(client.GetClientID(), client.GetClientPublicKey(), options.DataShards, options.ParityShards, options.Size, options.ReadPrice, options.WritePrice, options.Lock, - options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.Force, options.FileOptionsParams) + options.BlobberIds, options.BlobberAuthTickets, options.ThirdPartyExtendable, options.IsEnterprise, options.Force, options.FileOptionsParams) } func CreateAllocationForOwner( owner, ownerpublickey string, datashards, parityshards int, size int64, readPrice, writePrice PriceRange, - lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, force bool, fileOptionsParams *FileOptionsParameters, + lock uint64, preferredBlobberIds, blobberAuthTickets []string, thirdPartyExtendable, IsEnterprise, force bool, fileOptionsParams *FileOptionsParameters, ) (hash string, nonce int64, txn *transaction.Transaction, err error) { if lock > math.MaxInt64 { @@ -1077,6 +1078,7 @@ func CreateAllocationForOwner( allocationRequest["owner_public_key"] = ownerpublickey allocationRequest["third_party_extendable"] = thirdPartyExtendable allocationRequest["file_options_changed"], allocationRequest["file_options"] = calculateAllocationFileOptions(63 /*0011 1111*/, fileOptionsParams) + allocationRequest["is_enterprise"] = IsEnterprise var sn = transaction.SmartContractTxnData{ Name: transaction.NEW_ALLOCATION_REQUEST, From 2b0b3e8011c55fae2124554b3219a8350f74e791 Mon Sep 17 00:00:00 2001 From: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Date: Mon, 29 Jul 2024 18:45:59 +0530 Subject: [PATCH 2/3] Debug --- zboxcore/sdk/sdk.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index e2f259edd..14c0b7af2 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -1080,6 +1080,8 @@ func CreateAllocationForOwner( allocationRequest["file_options_changed"], allocationRequest["file_options"] = calculateAllocationFileOptions(63 /*0011 1111*/, fileOptionsParams) allocationRequest["is_enterprise"] = IsEnterprise + fmt.Println("allocationRequest", allocationRequest) + var sn = transaction.SmartContractTxnData{ Name: transaction.NEW_ALLOCATION_REQUEST, InputArgs: allocationRequest, From e606c5d8220489e03230d805e427d87508104a46 Mon Sep 17 00:00:00 2001 From: Jayash Satolia <73050737+Jayashsatolia403@users.noreply.github.com> Date: Tue, 30 Jul 2024 00:10:16 +0530 Subject: [PATCH 3/3] Remove println --- zboxcore/sdk/sdk.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/zboxcore/sdk/sdk.go b/zboxcore/sdk/sdk.go index 14c0b7af2..e2f259edd 100644 --- a/zboxcore/sdk/sdk.go +++ b/zboxcore/sdk/sdk.go @@ -1080,8 +1080,6 @@ func CreateAllocationForOwner( allocationRequest["file_options_changed"], allocationRequest["file_options"] = calculateAllocationFileOptions(63 /*0011 1111*/, fileOptionsParams) allocationRequest["is_enterprise"] = IsEnterprise - fmt.Println("allocationRequest", allocationRequest) - var sn = transaction.SmartContractTxnData{ Name: transaction.NEW_ALLOCATION_REQUEST, InputArgs: allocationRequest,