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

feat: rating fields in orders crud #1839

Open
wants to merge 19 commits into
base: feat/market-stage-one-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion blockchain/addresses.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const (
sidechainSNMAddressKey = "sidechainSNMAddress"
masterchainSNMAddressKey = "masterchainSNMAddress"
blacklistAddressKey = "blacklistAddress"
marketAddressKey = "marketAddress"
marketAddressKey = "marketV2Address"
profileRegistryAddressKey = "profileRegistryAddress"
oracleUsdAddressKey = "oracleUsdAddress"
gatekeeperMasterchainAddressKey = "gatekeeperMasterchainAddress"
Expand Down
12 changes: 9 additions & 3 deletions blockchain/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2108,9 +2108,13 @@ func NewDevicesStorage(addr common.Address, opts *chainOpts) (*BasicDevicesStora
}

func (m *BasicDevicesStorage) StoreOrUpdate(ctx context.Context, key *ecdsa.PrivateKey, devices interface{}) error {
data, err := json.Marshal(devices)
if err != nil {
return err
var data []byte
var err error
if devices != nil {
data, err = json.Marshal(devices)
if err != nil {
return err
}
}
bytes32Ty, err := abi.NewType("bytes")
if err != nil {
Expand All @@ -2135,6 +2139,7 @@ func (m *BasicDevicesStorage) StoreOrUpdate(ctx context.Context, key *ecdsa.Priv

gasLimit := devicesGasLimit(uint64(len(data)))
txOpts := m.opts.getTxOpts(ctx, key, gasLimit)
ctxlog.S(ctx).Debugf("providing %d gas for storing devices with %d len", gasLimit, len(data))
if curHash == newHash {
ctxlog.S(ctx).Debug("hash is unchanged, touching")
tx, err := txRetryWrapper(func() (*types.Transaction, error) {
Expand Down Expand Up @@ -2164,6 +2169,7 @@ func (m *BasicDevicesStorage) StoreOrUpdate(ctx context.Context, key *ecdsa.Priv
if receipt.Status == types.ReceiptStatusFailed {
return fmt.Errorf("DevicesStorage::SetDevices transaction failed")
}
ctxlog.S(ctx).Debugf("used %d gas for storing devices with %d len", receipt.GasUsed, len(data))
}
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions blockchain/gasLimits.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const (
approveGasLimit = 70000
placeOrderGasLimit = 650000
cancelOrderGasLimit = 300000
quickBuyGasLimit = 1200000
openDealGasLimit = 600000
quickBuyGasLimit = 1300000
openDealGasLimit = 800000
closeDealGasLimit = 250000
billGasLimit = 300000
createChangeRequestGasLimit = 300000
Expand All @@ -25,5 +25,5 @@ const (
)

func devicesGasLimit(size uint64) uint64 {
return 200000 + size/32*20000
return 400000 + size/32*31000
}
2 changes: 1 addition & 1 deletion blockchain/source/api/Market.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion blockchain/source/api/OracleUSD.go

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