Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
LYC386 committed Sep 19, 2023
1 parent f554a48 commit 9e72a68
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/pkg/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (k *Currency) OnRequest(id uint64, payload []byte, hasSURB bool) ([]byte, e
}

var result []byte
if req.Command == 0x01 {
if req.Command == command.DirectPost {
// Directly return rpc response without passing to iChain
result, err = json.Marshal(response)
} else {
Expand All @@ -143,8 +143,8 @@ func (k *Currency) OnRequest(id uint64, payload []byte, hasSURB bool) ([]byte, e
// Called when cmd==0x01 (DirectPost), directly sends payload to rpcURL.
// Payload data is handled by User (Wallet)
func wrapRequest(rpcURL string, cmd uint8, payload []byte) (*chain.HttpData, error) {
if cmd != 0x01 {
return nil, fmt.Errorf("expect cmd to be 0x00, got %d", cmd)
if cmd != command.DirectPost {
return nil, fmt.Errorf("expect cmd to be 0x01, got %d", cmd)
}
return &chain.HttpData{Method: "POST", URL: rpcURL, Body: payload}, nil

Expand Down

0 comments on commit 9e72a68

Please sign in to comment.