Skip to content

Commit

Permalink
Merge branch 'cache' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
scorpiotzh committed Sep 12, 2024
2 parents 898eeea + df26904 commit 42f1306
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions http_server/handle/account_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"context"
"das_register_server/config"
"errors"
"github.com/nervosnetwork/ckb-sdk-go/address"
"github.com/nervosnetwork/ckb-sdk-go/types"

Expand Down Expand Up @@ -99,10 +100,15 @@ func (h *HttpHandle) getAccountPrice(ctx context.Context, accLen uint8, args, ac
err = fmt.Errorf("accLen is 0")
return
}
if args == "" {
args = "0x03"
}
var newPrice, renewPrice, basicCapacity, preparedFeeCapacity uint64

builder, err := h.dasCore.ConfigCellDataBuilderByTypeArgsList(common.ConfigCellTypeArgsPrice, common.ConfigCellTypeArgsAccount)
err = errors.New("test config cell cache")
if err != nil {
log.Error(err.Error())
var cacheBuilder core.CacheConfigCellBase
strCache, errCache := h.dasCore.GetConfigCellByCache(core.CacheConfigCellKeyBase)
if errCache != nil {
Expand Down Expand Up @@ -155,10 +161,6 @@ func (h *HttpHandle) getAccountPrice(ctx context.Context, accLen uint8, args, ac
}
quote := quoteCell.Quote()

if args == "" {
args = "0x03"
}

log.Info(ctx, "BasicCapacity:", basicCapacity, "PreparedFeeCapacity:", preparedFeeCapacity, "Quote:", quote, "Price:", newPrice, renewPrice)
basicCapacity = basicCapacity/common.OneCkb + uint64(len([]byte(account))) + preparedFeeCapacity/common.OneCkb
baseAmount, _ = decimal.NewFromString(fmt.Sprintf("%d", basicCapacity))
Expand Down
3 changes: 3 additions & 0 deletions http_server/handle/config_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"das_register_server/config"
"encoding/json"
"errors"
"fmt"
"github.com/dotbitHQ/das-lib/common"
"github.com/dotbitHQ/das-lib/core"
Expand Down Expand Up @@ -81,7 +82,9 @@ func (h *HttpHandle) doConfigInfo(ctx context.Context, apiResp *api_code.ApiResp
var inviteDiscount, profitRateInviter uint32
var incomeCellMinTransferValue uint64
var transferThrottle, editManagerThrottle, editRecordsThrottle, maxAccountLen, minTtl, accountExpirationGracePeriod uint32
err = errors.New("test config cell cache")
if err != nil {
log.Error(err.Error())
var cacheBuilder core.CacheConfigCellBase
strCache, errCache := h.dasCore.GetConfigCellByCache(core.CacheConfigCellKeyBase)
if errCache != nil {
Expand Down

0 comments on commit 42f1306

Please sign in to comment.