-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add update on ica callback data type
- Loading branch information
1 parent
5f64082
commit 7553dd5
Showing
3 changed files
with
48 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,29 @@ | ||
package types | ||
|
||
type MessageCallback struct { | ||
Callback Callback `json:"callback"` | ||
IcaCallback IcaCallbackData `json:"ica_callback"` | ||
} | ||
|
||
type Callback struct { | ||
ConnId string `json:"connection_id"` | ||
AccId string `json:"account_id"` | ||
TxId uint64 `json:"tx_id"` | ||
ResultCode uint64 `json:"result_code"` // Success(0) | Failure(1) | Timeout(2) | ||
ResultData []byte `json:"result_data"` | ||
type IcaCallbackData struct { | ||
ConnId string `json:"connection_id"` | ||
AccId string `json:"account_id"` | ||
TxId uint64 `json:"tx_id"` | ||
Result IcaCallbackResult `json:"result"` | ||
} | ||
|
||
var ( | ||
ResultCodeSuccess uint64 = 0 | ||
ResultCodeFailure uint64 = 1 | ||
ResultCodeTimeout uint64 = 2 | ||
) | ||
type IcaCallbackResult struct { | ||
Success *IcaCallbackSuccess `json:"success,omitempty"` | ||
Error *IcaCallbackError `json:"error,omitempty"` | ||
Timeout *IcaCallbackTimeout `json:"timeout,omitempty"` | ||
} | ||
|
||
type IcaCallbackSuccess struct { | ||
Data []byte `json:"data"` | ||
} | ||
|
||
type IcaCallbackError struct { | ||
Error string `json:"error"` | ||
} | ||
|
||
type IcaCallbackTimeout struct { | ||
} |