Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

- terms read/write price uint64 #731

Merged
merged 1 commit into from
Jun 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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