Skip to content

Commit

Permalink
fix: webauthn tx idx error
Browse files Browse the repository at this point in the history
  • Loading branch information
sjatsh committed Sep 6, 2023
1 parent 0c59118 commit ca60a35
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 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

0 comments on commit ca60a35

Please sign in to comment.