Skip to content

Commit

Permalink
Merge branch 'anylock' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	go.mod
#	go.sum
  • Loading branch information
scorpiotzh committed Jun 26, 2024
2 parents ce3fbee + 4ef1424 commit f5e018f
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/dotbitHQ/das-lib v1.1.1-0.20240530014846-5c331bfec7ed
github.com/dotbitHQ/das-lib v1.1.1-0.20240621020942-dd4d07f3743e
github.com/fsnotify/fsnotify v1.5.4
github.com/getsentry/sentry-go v0.25.0
github.com/gin-gonic/gin v1.9.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5O
github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/dop251/goja v0.0.0-20211011172007-d99e4b8cbf48/go.mod h1:R9ET47fwRVRPZnOGvHxxhuZcbrMCuiqOz3Rlrh4KSnk=
github.com/dop251/goja_nodejs v0.0.0-20210225215109-d91c329300e7/go.mod h1:hn7BA7c8pLvoGndExHudxTDKZ84Pyvv+90pbBjbTz0Y=
github.com/dotbitHQ/das-lib v1.1.1-0.20240530014846-5c331bfec7ed h1:3XhUlSaZPsOsSHc22FLOxK0pp1/pRFmCN+O6EXaX+hI=
github.com/dotbitHQ/das-lib v1.1.1-0.20240530014846-5c331bfec7ed/go.mod h1:XrDous4HH3jze59GLdmdKZaAQ8h3unTFUBsppph7IF8=
github.com/dotbitHQ/das-lib v1.1.1-0.20240621020942-dd4d07f3743e h1:1BqBEoPNYtZqtXN7yX0RSVjja/9+S72VYxmzAzBdQdA=
github.com/dotbitHQ/das-lib v1.1.1-0.20240621020942-dd4d07f3743e/go.mod h1:XrDous4HH3jze59GLdmdKZaAQ8h3unTFUBsppph7IF8=
github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elazarl/goproxy v0.0.0-20221015165544-a0805db90819 h1:RIB4cRk+lBqKK3Oy0r2gRX4ui7tuhiZq2SuTtTCi0/0=
Expand Down
2 changes: 2 additions & 0 deletions http_server/handle/account_detail.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/scorpiotzh/toolib"
"net/http"
"strings"
)

type ReqAccountDetail struct {
Expand Down Expand Up @@ -79,6 +80,7 @@ func (h *HttpHandle) doAccountDetail(req *ReqAccountDetail, apiResp *api_code.Ap
apiResp.ApiRespErr(api_code.ApiCodeParamsInvalid, "params is invalid")
return nil
}
req.Account = strings.ToLower(req.Account)

// get account detail
accountId := common.Bytes2Hex(common.GetAccountIdByAccount(req.Account))
Expand Down
2 changes: 2 additions & 0 deletions http_server/handle/account_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/scorpiotzh/toolib"
"net/http"
"strings"
)

type ReqAccountList struct {
Expand Down Expand Up @@ -53,6 +54,7 @@ func (h *HttpHandle) AccountList(ctx *gin.Context) {
func (h *HttpHandle) doAccountList(req *ReqAccountList, apiResp *api_code.ApiResp) error {
var resp RespAccountList
resp.List = make([]AccountData, 0)
req.Keyword = strings.ToLower(req.Keyword)

// check params
addrHex, err := req.FormatChainTypeAddress(config.Cfg.Server.Net, true)
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/distribution_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ func (h *HttpHandle) DistributionList(ctx *gin.Context) {
}

func (h *HttpHandle) doDistributionList(req *ReqDistributionList, apiResp *api_code.ApiResp) error {
req.Account = strings.ToLower(req.Account)
accountId := common.Bytes2Hex(common.GetAccountIdByAccount(req.Account))
if err := h.checkForSearch(accountId, apiResp); err != nil {
return err
Expand Down
2 changes: 2 additions & 0 deletions http_server/handle/owner_payment_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/shopspring/decimal"
"net/http"
"strings"
"time"
)

Expand All @@ -29,6 +30,7 @@ func (h *HttpHandle) OwnerPaymentExport(ctx *gin.Context) {
ctx.JSON(http.StatusOK, apiResp)
return
}
req.Account = strings.ToLower(req.Account)

end, err := time.Parse("2006-01-02", req.End)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/owner_profit.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (h *HttpHandle) OwnerProfit(ctx *gin.Context) {

func (h *HttpHandle) doOwnerProfit(req *ReqOwnerProfit, apiResp *api_code.ApiResp) error {
var resp RespOwnerProfit
req.Account = strings.ToLower(req.Account)

hexAddress, err := req.FormatChainTypeAddress(h.DasCore.NetType(), true)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/profit_withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (h *HttpHandle) ProfitWithdraw(ctx *gin.Context) {

func (h *HttpHandle) doProfitWithdraw(req *ReqProfitWithdraw, apiResp *api_code.ApiResp) error {
var resp RespProfitWithdraw
req.Account = strings.ToLower(req.Account)

hexAddress, err := req.FormatChainTypeAddress(h.DasCore.NetType(), true)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions http_server/handle/sub_account_create_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func (h *HttpHandle) SubAccountCreateNew(ctx *gin.Context) {

func (h *HttpHandle) doSubAccountCreateNew(req *ReqSubAccountCreate, apiResp *api_code.ApiResp) error {
var resp RespSubAccountCreate
req.Account = strings.ToLower(req.Account)
for i, v := range req.SubAccountList {
req.SubAccountList[i].Account = strings.ToLower(v.Account)
}

// check params
if err := h.doSubAccountCheckParams(req, apiResp); err != nil {
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/sub_account_edit_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ func (h *HttpHandle) SubAccountEditNew(ctx *gin.Context) {
func (h *HttpHandle) doSubAccountEditNew(req *ReqSubAccountEdit, apiResp *api_code.ApiResp) error {
var resp RespSubAccountEdit
resp.List = make([]SignInfo, 0)
req.Account = strings.ToLower(req.Account)

// check params
h.checkReqSubAccountEdit(req, apiResp)
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/sub_account_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (h *HttpHandle) SubAccountInit(ctx *gin.Context) {
func (h *HttpHandle) doSubAccountInit(req *ReqSubAccountInit, apiResp *api_code.ApiResp, clientIp, remoteAddrIP string) error {
var resp RespSubAccountInit
resp.List = make([]SignInfo, 0)
req.Account = strings.ToLower(req.Account)

// check params
addrHex, err := req.FormatChainTypeAddress(config.Cfg.Server.Net, true)
Expand Down
3 changes: 3 additions & 0 deletions http_server/handle/sub_account_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/scorpiotzh/toolib"
"net/http"
"strings"
)

type ReqSubAccountList struct {
Expand Down Expand Up @@ -55,6 +56,8 @@ func (h *HttpHandle) SubAccountList(ctx *gin.Context) {
func (h *HttpHandle) doSubAccountList(req *ReqSubAccountList, apiResp *api_code.ApiResp) error {
var resp RespSubAccountList
resp.List = make([]AccountData, 0)
req.Account = strings.ToLower(req.Account)
req.Keyword = strings.ToLower(req.Keyword)

// check params
if req.ChainTypeAddress.KeyInfo.Key != "" {
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/sub_account_renew.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (h *HttpHandle) SubAccountRenew(ctx *gin.Context) {

func (h *HttpHandle) doSubAccountRenew(req *ReqSubAccountRenew, apiResp *api_code.ApiResp) error {
var resp RespSubAccountRenew
req.Account = strings.ToLower(req.Account)

// check params
if err := h.doSubAccountRenewCheckParams(req, apiResp); err != nil {
Expand Down
1 change: 1 addition & 0 deletions http_server/handle/transaction_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func (h *HttpHandle) TransactionStatus(ctx *gin.Context) {

func (h *HttpHandle) doTransactionStatus(req *ReqTransactionStatus, apiResp *api_code.ApiResp) error {
var resp RespTransactionStatus
req.Account = strings.ToLower(req.Account)

// check params
addrHex, err := req.FormatChainTypeAddress(config.Cfg.Server.Net, true)
Expand Down

0 comments on commit f5e018f

Please sign in to comment.