File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ package localstatequery
16
16
17
17
import (
18
18
"encoding/hex"
19
+ "fmt"
20
+ "os"
19
21
"reflect"
20
22
"testing"
21
23
@@ -92,6 +94,16 @@ var tests = []testDefinition{
92
94
Message : NewMsgReAcquireVolatileTip (),
93
95
MessageType : MessageTypeReacquireVolatileTip ,
94
96
},
97
+ {
98
+ CborHex : string (readFile ("../../cardano-blueprint/src/api/examples/getSystemStart/query.cbor" )),
99
+ Message : NewMsgQuery (& SystemStartQuery {simpleQueryBase {Type : QueryTypeSystemStart }}),
100
+ MessageType : MessageTypeQuery ,
101
+ },
102
+ {
103
+ CborHex : string (readFile ("../../cardano-blueprint/src/api/examples/getSystemStart/result.cbor" )),
104
+ Message : NewMsgResult ([]byte {5 }), // FIXME: not correct and should also check SystemStart decoder
105
+ MessageType : MessageTypeResult ,
106
+ },
95
107
}
96
108
97
109
func TestDecode (t * testing.T ) {
@@ -135,3 +147,12 @@ func TestEncode(t *testing.T) {
135
147
}
136
148
}
137
149
}
150
+
151
+ // Helper function to allow inline reading of a file without capturing the error
152
+ func readFile (path string ) []byte {
153
+ data , err := os .ReadFile (path )
154
+ if err != nil {
155
+ panic (fmt .Sprintf ("error reading file: %s" , err ))
156
+ }
157
+ return data
158
+ }
You can’t perform that action at this time.
0 commit comments