Skip to content

Commit

Permalink
test: add some comments to GetIDsTest for clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
tzdybal committed Oct 20, 2023
1 parent 1d811f5 commit fd059e7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/test_suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func GetIDsTest(t *testing.T, da da.DA) {

found := false
end := time.Now().Add(1 * time.Second)

// To Keep It Simple: we assume working with DA used exclusively for this test (mock, devnet, etc)
// As we're the only user, we don't need to handle external data (that could be submitted in real world).
// There is no notion of height, so we need to scan the DA to get test data back.
for i := uint64(1); !found && !time.Now().After(end); i++ {
ret, err := da.GetIDs(i)
if err != nil {
Expand All @@ -122,6 +126,8 @@ func GetIDsTest(t *testing.T, da da.DA) {
blobs, err := da.Get(ret)
assert.NoError(t, err)

// Submit ensures atomicity of batch, so it makes sense to compare actual blobs (bodies) only when lengths
// of slices is the same.
if len(blobs) == len(msgs) {
found = true
for b := 0; b < len(blobs); b++ {
Expand Down

0 comments on commit fd059e7

Please sign in to comment.