Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Use i instead of reqID
Browse files Browse the repository at this point in the history
  • Loading branch information
Peri committed Jun 1, 2020
1 parent 7cecba8 commit 47e338b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions chain/x/oracle/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,19 +700,19 @@ func TestRequestDataSuccess(t *testing.T) {
require.Equal(t, types.AttributeKeyID, string(events[0].Attributes[0].Key))
require.Equal(t, types.AttributeKeyValidator, string(events[0].Attributes[1].Key))

for reqID := 1; reqID <= 3; reqID++ {
ds, err := k.GetDataSource(ctx, types.DataSourceID(reqID))
for i := 1; i <= 3; i++ {
ds, err := k.GetDataSource(ctx, types.DataSourceID(i))
require.NoError(t, err)

require.Equal(t, types.EventTypeRawRequest, events[reqID].Type)
require.Equal(t, types.AttributeKeyDataSourceID, string(events[reqID].Attributes[0].Key))
require.Equal(t, strconv.Itoa(reqID), string(events[reqID].Attributes[0].Value))
require.Equal(t, types.AttributeKeyDataSourceHash, string(events[reqID].Attributes[1].Key))
require.Equal(t, ds.Filename, string(events[reqID].Attributes[1].Value))
require.Equal(t, types.AttributeKeyExternalID, string(events[reqID].Attributes[2].Key))
require.Equal(t, strconv.Itoa(reqID), string(events[reqID].Attributes[2].Value))
require.Equal(t, types.AttributeKeyCalldata, string(events[reqID].Attributes[3].Key))
require.Equal(t, "BTC", string(events[reqID].Attributes[3].Value))
require.Equal(t, types.EventTypeRawRequest, events[i].Type)
require.Equal(t, types.AttributeKeyDataSourceID, string(events[i].Attributes[0].Key))
require.Equal(t, strconv.Itoa(i), string(events[i].Attributes[0].Value))
require.Equal(t, types.AttributeKeyDataSourceHash, string(events[i].Attributes[1].Key))
require.Equal(t, ds.Filename, string(events[i].Attributes[1].Value))
require.Equal(t, types.AttributeKeyExternalID, string(events[i].Attributes[2].Key))
require.Equal(t, strconv.Itoa(i), string(events[i].Attributes[2].Value))
require.Equal(t, types.AttributeKeyCalldata, string(events[i].Attributes[3].Key))
require.Equal(t, "BTC", string(events[i].Attributes[3].Value))
}
}

Expand Down

0 comments on commit 47e338b

Please sign in to comment.