Skip to content

Commit

Permalink
add to other tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Gololicic committed Oct 30, 2023
1 parent f1d8e39 commit 6fde9ad
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions integration/tests/access/access_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,25 @@ func (s *AccessAPISuite) testExecuteScriptWithSimpleContract(client *client.Clie
script := lib.ReadCounterScript(serviceAccount.Address, serviceAccount.Address).ToCadence()

s.Run("execute at latest block", func() {
result, err := client.ExecuteScriptAtLatestBlock(s.ctx, []byte(script), nil)
result, err := s.waitScriptExecutionUntilIndexed(func() (cadence.Value, error) {
return client.ExecuteScriptAtLatestBlock(s.ctx, []byte(script), nil)
})
s.Require().NoError(err)
s.Assert().Equal(lib.CounterInitializedValue, result.(cadence.Int).Int())
})

s.Run("execute at block height", func() {
result, err := client.ExecuteScriptAtBlockHeight(s.ctx, header.Height, []byte(script), nil)
result, err := s.waitScriptExecutionUntilIndexed(func() (cadence.Value, error) {
return client.ExecuteScriptAtBlockHeight(s.ctx, header.Height, []byte(script), nil)
})
s.Require().NoError(err)

s.Assert().Equal(lib.CounterInitializedValue, result.(cadence.Int).Int())
})

s.Run("execute at block ID", func() {
result, err := client.ExecuteScriptAtBlockID(s.ctx, header.ID, []byte(script), nil)
result, err := s.waitScriptExecutionUntilIndexed(func() (cadence.Value, error) {
return client.ExecuteScriptAtBlockID(s.ctx, header.ID, []byte(script), nil)
})
s.Require().NoError(err)
s.Assert().Equal(lib.CounterInitializedValue, result.(cadence.Int).Int())
})
Expand Down

0 comments on commit 6fde9ad

Please sign in to comment.