Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/did-trade-hub'
Browse files Browse the repository at this point in the history
  • Loading branch information
sjatsh committed Sep 6, 2023
2 parents d1152f9 + ca60a35 commit e360720
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
2 changes: 2 additions & 0 deletions http_server/handle/approval_delay.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func (h *HttpHandle) doApprovalDelayMainAccount(req *ReqApprovalDelay, apiResp *
action: common.DasActionDelayApproval,
account: req.Account,
evmChainId: req.EvmChainId,
address: accInfo.Owner,
chainType: accInfo.OwnerChainType,
})
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeError500, "buildTx err: "+err.Error())
Expand Down
2 changes: 2 additions & 0 deletions http_server/handle/approval_enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ func (h *HttpHandle) doApprovalEnableMainAccount(req *ReqApprovalEnable, apiResp
action: common.DasActionCreateApproval,
account: req.Account,
evmChainId: req.EvmChainId,
address: accInfo.Owner,
chainType: accInfo.OwnerChainType,
})
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeError500, "buildTx err: "+err.Error())
Expand Down
8 changes: 5 additions & 3 deletions http_server/handle/approval_fulfill.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ func (h *HttpHandle) doApprovalFulfillMainAccount(req *ReqApprovalFulfill, apiRe
txParams.OutputsData = append(txParams.OutputsData, accData)

signList, txHash, err := h.buildTx(&paramBuildTx{
txParams: &txParams,
action: common.DasActionFulfillApproval,
account: req.Account,
txParams: &txParams,
action: common.DasActionFulfillApproval,
account: req.Account,
address: accInfo.Owner,
chainType: accInfo.OwnerChainType,
})
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeError500, "buildTx err: "+err.Error())
Expand Down
13 changes: 10 additions & 3 deletions http_server/handle/approval_revoke.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,17 @@ func (h *HttpHandle) doApprovalRevokeMainAccount(req *ReqApprovalRevoke, apiResp
})
txParams.OutputsData = append(txParams.OutputsData, accData)

platformHex, err := req.FormatChainTypeAddress(config.Cfg.Server.Net, false)
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeParamsInvalid, "params invalid")
return err
}
signList, txHash, err := h.buildTx(&paramBuildTx{
txParams: &txParams,
action: common.DasActionRevokeApproval,
account: req.Account,
txParams: &txParams,
action: common.DasActionRevokeApproval,
account: req.Account,
address: platformHex.AddressHex,
chainType: platformHex.ChainType,
})
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeError500, "buildTx err: "+err.Error())
Expand Down
10 changes: 9 additions & 1 deletion http_server/handle/transaction_send_new.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,9 +529,17 @@ func (h *HttpHandle) doEditSignMsg(req *ReqTransactionSend, apiResp *api_code.Ap
return nil
}

if req.SignAddress == "" {
err := fmt.Errorf("sign_address can not be empty when has webauthn sign (sign_type = 8)")
apiResp.ApiRespErr(api_code.ApiCodeParamsInvalid, err.Error())
return err
}

txAddr := ""
switch req.Action {
case common.DasActionEnableSubAccount, common.DasActionConfigSubAccountCustomScript, common.DasActionConfigSubAccount:
case common.DasActionEnableSubAccount, common.DasActionConfigSubAccountCustomScript, common.DasActionConfigSubAccount,
common.DasActionCreateApproval, common.DasActionDelayApproval,
common.DasActionRevokeApproval, common.DasActionFulfillApproval:
var sic SignInfoCache
txStr, err := h.RC.GetSignTxCache(req.SignKey)
if err != nil {
Expand Down

0 comments on commit e360720

Please sign in to comment.