-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes stellar-deprecated/horizon#390, add inflation destination effect
- Loading branch information
Showing
4 changed files
with
89 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package ingest | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stellar/go/services/horizon/internal/db2/history" | ||
"github.com/stellar/go/services/horizon/internal/test" | ||
) | ||
|
||
func Test_ingestSignerEffects(t *testing.T) { | ||
tt := test.Start(t).ScenarioWithoutHorizon("set_options") | ||
defer tt.Finish() | ||
|
||
s := ingest(tt) | ||
tt.Require.NoError(s.Err) | ||
|
||
q := &history.Q{Session: tt.HorizonSession()} | ||
|
||
// Regression: https://github.com/stellar/horizon/issues/390 doesn't produce a signer effect when | ||
// inflation has changed | ||
var effects []history.Effect | ||
err := q.Effects().ForLedger(3).Select(&effects) | ||
tt.Require.NoError(err) | ||
|
||
if tt.Assert.Len(effects, 1) { | ||
tt.Assert.NotEqual(history.EffectSignerUpdated, effects[0].Type) | ||
} | ||
} | ||
|
||
func Test_ingestOperationEffects(t *testing.T) { | ||
tt := test.Start(t).ScenarioWithoutHorizon("set_options") | ||
defer tt.Finish() | ||
|
||
s := ingest(tt) | ||
tt.Require.NoError(s.Err) | ||
|
||
// ensure inflation destination change is correctly recorded | ||
q := &history.Q{Session: tt.HorizonSession()} | ||
var effects []history.Effect | ||
err := q.Effects().ForLedger(3).Select(&effects) | ||
tt.Require.NoError(err) | ||
|
||
if tt.Assert.Len(effects, 1) { | ||
tt.Assert.Equal(history.EffectAccountInflationDestinationUpdated, effects[0].Type) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters