-
Notifications
You must be signed in to change notification settings - Fork 2
/
result.go
36 lines (33 loc) · 952 Bytes
/
result.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package proof
import (
oracletypes "github.com/ODIN-PROTOCOL/odin-core/x/oracle/types"
)
// ResultEthereum is an Ethereum version of Result for solidity ABI-encoding.
type ResultEthereum struct {
ClientID string
OracleScriptID uint64
Params []byte
AskCount uint64
MinCount uint64
RequestID uint64
AnsCount uint64
RequestTime uint64
ResolveTime uint64
ResolveStatus uint8
Result []byte
}
func transformResult(r oracletypes.Result) ResultEthereum {
return ResultEthereum{
ClientID: r.ClientID,
OracleScriptID: uint64(r.OracleScriptID),
Params: r.Calldata,
AskCount: uint64(r.AskCount),
MinCount: uint64(r.MinCount),
RequestID: uint64(r.RequestID),
AnsCount: uint64(r.AnsCount),
RequestTime: uint64(r.RequestTime),
ResolveTime: uint64(r.ResolveTime),
ResolveStatus: uint8(r.ResolveStatus),
Result: r.Result,
}
}