Skip to content

Commit

Permalink
- terms read/write price uint64 (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssardana08 authored Jun 18, 2022
1 parent a2eaa88 commit 7440aa2
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 95 deletions.
4 changes: 2 additions & 2 deletions code/go/0chain.net/blobbercore/allocation/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ type Terms struct {
AllocationID string `gorm:"allocation_id;size:64;not null"`
Allocation Allocation `gorm:"foreignKey:AllocationID"` // references allocations(id)

ReadPrice int64 `gorm:"read_price;not null"`
WritePrice int64 `gorm:"write_price;not null"`
ReadPrice uint64 `gorm:"read_price;not null"`
WritePrice uint64 `gorm:"write_price;not null"`
}

func (Terms) TableName() string {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ message Term {
int64 id = 1;
string blobber_id = 2;
string allocation_id = 3;
int64 read_price = 4;
int64 write_price = 5;
uint64 read_price = 4;
uint64 write_price = 5;
}

message FileRef {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions code/go/0chain.net/blobbercore/handler/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func getStorageNode() (*transaction.StorageNode, error) {
return nil, err
}
}
sn.Terms.ReadPrice = int64(zcncore.ConvertToValue(readPrice))
sn.Terms.WritePrice = int64(zcncore.ConvertToValue(writePrice))
sn.Terms.ReadPrice = zcncore.ConvertToValue(readPrice)
sn.Terms.WritePrice = zcncore.ConvertToValue(writePrice)
sn.Terms.MinLockDemand = config.Configuration.MinLockDemand
sn.Terms.MaxOfferDuration = config.Configuration.MaxOfferDuration

Expand Down
4 changes: 2 additions & 2 deletions code/go/0chain.net/core/transaction/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ type SmartContractTxnData struct {
// but any existing offer will use terms of offer signing time.
type Terms struct {
// ReadPrice is price for reading. Token / GB.
ReadPrice int64 `json:"read_price"`
ReadPrice uint64 `json:"read_price"`
// WritePrice is price for reading. Token / GB. Also,
// it used to calculate min_lock_demand value.
WritePrice int64 `json:"write_price"`
WritePrice uint64 `json:"write_price"`
// MinLockDemand in number in [0; 1] range. It represents part of
// allocation should be locked for the blobber rewards even if
// user never write something to the blobber.
Expand Down

0 comments on commit 7440aa2

Please sign in to comment.