Skip to content

Commit

Permalink
Merge pull request #1302 from 0chain/fix/min-lock
Browse files Browse the repository at this point in the history
Fix allocation min lock
  • Loading branch information
guruhubb authored Nov 26, 2023
2 parents 9a527cc + f3e6600 commit be14335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions wasmsdk/allocation.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,11 @@ func updateAllocation(allocationID string,

func getAllocationMinLock(datashards, parityshards int,
size int64,
maxreadPrice, maxwritePrice uint64,
maxwritePrice uint64,
) (int64, error) {
readPrice := sdk.PriceRange{Min: 0, Max: maxreadPrice}
writePrice := sdk.PriceRange{Min: 0, Max: maxwritePrice}

value, err := sdk.GetAllocationMinLock(datashards, parityshards, size, readPrice, writePrice)
value, err := sdk.GetAllocationMinLock(datashards, parityshards, size, writePrice)
if err != nil {
sdkLogger.Error(err)
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion zboxcore/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1567,7 +1567,7 @@ func CommitToFabric(metaTxnData, fabricConfigJSON string) (string, error) {
func GetAllocationMinLock(
datashards, parityshards int,
size int64,
readPrice, writePrice PriceRange,
writePrice PriceRange,
) (int64, error) {
baSize := int64(math.Ceil(float64(size) / float64(datashards)))
totalSize := baSize * int64(datashards+parityshards)
Expand Down

0 comments on commit be14335

Please sign in to comment.