@@ -191,9 +191,10 @@ func TestInitCacheEmptyCapabilities(t *testing.T) {
191191 ReleaseCache (cache )
192192}
193193
194- func withCache (t testing.TB ) (Cache , func ()) {
194+ func withCache (tb testing.TB ) (Cache , func ()) {
195+ tb .Helper ()
195196 tmpdir , err := os .MkdirTemp ("" , "wasmvm-testing" )
196- require .NoError (t , err )
197+ require .NoError (tb , err )
197198 config := types.VMConfig {
198199 Cache : types.CacheOptions {
199200 BaseDir : tmpdir ,
@@ -203,7 +204,7 @@ func withCache(t testing.TB) (Cache, func()) {
203204 },
204205 }
205206 cache , err := InitCache (config )
206- require .NoError (t , err )
207+ require .NoError (tb , err )
207208
208209 cleanup := func () {
209210 os .RemoveAll (tmpdir )
@@ -868,6 +869,8 @@ func Benchmark100ConcurrentContractCalls(b *testing.B) {
868869 resChan := make (chan []byte , callCount )
869870 wg .Add (callCount )
870871
872+ info = MockInfoBin (b , "fred" )
873+
871874 for i := 0 ; i < callCount ; i ++ {
872875 go func () {
873876 defer wg .Done ()
@@ -1189,6 +1192,7 @@ func TestReplyAndQuery(t *testing.T) {
11891192}
11901193
11911194func requireOkResponse (tb testing.TB , res []byte , expectedMsgs int ) {
1195+ tb .Helper ()
11921196 var result types.ContractResult
11931197 err := json .Unmarshal (res , & result )
11941198 require .NoError (tb , err )
@@ -1197,6 +1201,7 @@ func requireOkResponse(tb testing.TB, res []byte, expectedMsgs int) {
11971201}
11981202
11991203func requireQueryError (t * testing.T , res []byte ) {
1204+ t .Helper ()
12001205 var result types.QueryResult
12011206 err := json .Unmarshal (res , & result )
12021207 require .NoError (t , err )
@@ -1205,6 +1210,7 @@ func requireQueryError(t *testing.T, res []byte) {
12051210}
12061211
12071212func requireQueryOk (t * testing.T , res []byte ) []byte {
1213+ t .Helper ()
12081214 var result types.QueryResult
12091215 err := json .Unmarshal (res , & result )
12101216 require .NoError (t , err )
@@ -1213,36 +1219,43 @@ func requireQueryOk(t *testing.T, res []byte) []byte {
12131219 return result .Ok
12141220}
12151221
1216- func createHackatomContract (t testing.TB , cache Cache ) []byte {
1217- return createContract (t , cache , "../../testdata/hackatom.wasm" )
1222+ func createHackatomContract (tb testing.TB , cache Cache ) []byte {
1223+ tb .Helper ()
1224+ return createContract (tb , cache , "../../testdata/hackatom.wasm" )
12181225}
12191226
1220- func createCyberpunkContract (t testing.TB , cache Cache ) []byte {
1221- return createContract (t , cache , "../../testdata/cyberpunk.wasm" )
1227+ func createCyberpunkContract (tb testing.TB , cache Cache ) []byte {
1228+ tb .Helper ()
1229+ return createContract (tb , cache , "../../testdata/cyberpunk.wasm" )
12221230}
12231231
1224- func createQueueContract (t testing.TB , cache Cache ) []byte {
1225- return createContract (t , cache , "../../testdata/queue.wasm" )
1232+ func createQueueContract (tb testing.TB , cache Cache ) []byte {
1233+ tb .Helper ()
1234+ return createContract (tb , cache , "../../testdata/queue.wasm" )
12261235}
12271236
1228- func createReflectContract (t testing.TB , cache Cache ) []byte {
1229- return createContract (t , cache , "../../testdata/reflect.wasm" )
1237+ func createReflectContract (tb testing.TB , cache Cache ) []byte {
1238+ tb .Helper ()
1239+ return createContract (tb , cache , "../../testdata/reflect.wasm" )
12301240}
12311241
1232- func createFloaty2 (t testing.TB , cache Cache ) []byte {
1233- return createContract (t , cache , "../../testdata/floaty_2.0.wasm" )
1242+ func createFloaty2 (tb testing.TB , cache Cache ) []byte {
1243+ tb .Helper ()
1244+ return createContract (tb , cache , "../../testdata/floaty_2.0.wasm" )
12341245}
12351246
1236- func createContract (t testing.TB , cache Cache , wasmFile string ) []byte {
1247+ func createContract (tb testing.TB , cache Cache , wasmFile string ) []byte {
1248+ tb .Helper ()
12371249 wasm , err := os .ReadFile (wasmFile )
1238- require .NoError (t , err )
1250+ require .NoError (tb , err )
12391251 checksum , err := StoreCode (cache , wasm , true )
1240- require .NoError (t , err )
1252+ require .NoError (tb , err )
12411253 return checksum
12421254}
12431255
12441256// exec runs the handle tx with the given signer
12451257func exec (t * testing.T , cache Cache , checksum []byte , signer types.HumanAddress , store types.KVStore , api * types.GoAPI , querier Querier , gasExpected uint64 ) types.ContractResult {
1258+ t .Helper ()
12461259 gasMeter := NewMockGasMeter (TESTING_GAS_LIMIT )
12471260 igasMeter := types .GasMeter (gasMeter )
12481261 env := MockEnvBin (t )
0 commit comments