Skip to content

Commit

Permalink
fix: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tasos Bitsios committed Jan 14, 2025
1 parent f6cd5a2 commit a02839d
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
21 changes: 10 additions & 11 deletions ui/internal/test/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ import (
func GetState(client api.ClientWithResponsesInterface) *algod.StateModel {
sm := &algod.StateModel{
Status: algod.Status{
State: algod.StableState,
Version: "v-test",
Network: "v-test-network",
UpgradeNextProtocolVoteBefore: 0,
UpgradeVoteRounds: 0,
UpgradeYesVotes: 0,
UpgradeNoVotes: 0,
UpgradeVotes: 0,
UpgradeVotesRequired: 0,
NeedsUpdate: false,
LastRound: 0,
State: algod.StableState,
Version: "v-test",
Network: "v-test-network",
UpgradeVoteRounds: 0,
UpgradeYesVotes: 0,
UpgradeNoVotes: 0,
UpgradeVotes: 0,
UpgradeVotesRequired: 0,
NeedsUpdate: false,
LastRound: 0,

Client: client,
HttpPkg: new(api.HttpPkg),
Expand Down
11 changes: 10 additions & 1 deletion ui/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 1,
UpgradeVoteRounds: 10000,
UpgradeYesVotes: 841,
UpgradeNoVotes: 841,
Expand All @@ -35,6 +36,7 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 1,
UpgradeVoteRounds: 10000,
UpgradeYesVotes: 841,
UpgradeNoVotes: 841,
Expand All @@ -52,6 +54,7 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 1,
UpgradeVoteRounds: 10000,
UpgradeYesVotes: 841,
UpgradeNoVotes: 841,
Expand All @@ -69,13 +72,17 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 204444,
UpgradeVoteRounds: 10000,
UpgradeYesVotes: 841,
UpgradeNoVotes: 841,
UpgradeVotes: 1682,
UpgradeVotesRequired: 9000,
NeedsUpdate: true,
LastRound: 0,
LastRound: 100,
},
Metrics: algod.Metrics{
RoundTime: time.Duration(2.89 * float64(time.Second)),
},
TerminalWidth: 80,
TerminalHeight: 40,
Expand All @@ -86,6 +93,7 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 1,
UpgradeVoteRounds: 0,
UpgradeYesVotes: 0,
UpgradeNoVotes: 0,
Expand All @@ -103,6 +111,7 @@ var protocolViewSnapshots = map[string]ProtocolViewModel{
State: algod.SyncingState,
Version: "v0.0.0-test",
Network: "test-v1",
NextVersionRound: 1,
UpgradeVoteRounds: 0,
UpgradeYesVotes: 0,
UpgradeNoVotes: 0,
Expand Down
2 changes: 1 addition & 1 deletion ui/testdata/Test_ProtocolSnapshot/NoVoteOrUpgrade.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
│ Network: test-v1 │
│ │
│ Protocol Upgrade: No │
╰──────────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
│ Protocol Upgrade: No │
│ │
│ │
╰──────────────────────────────────────────────────────────────────────────────╯
╰──────────────────────────────────────────────────────────────────────────────╯
4 changes: 2 additions & 2 deletions ui/testdata/Test_ProtocolSnapshot/Visible.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
│ │
│ Network: test-v1 │
│ │
│ Consensus Upgrade Voting: true
╰──────────────────────────────────────────────────────────────────────────────╯
│ Consensus Upgrade: Voting 16% complete, 50% Yes
╰──────────────────────────────────────────────────────────────────────────────╯
2 changes: 1 addition & 1 deletion ui/testdata/Test_ProtocolSnapshot/VisibleSmall.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
│ Node: v0.0.0-test │
│ Network: test-v1 │
│ Protocol Upgrade: No │
│ Upgrade Available: true
│ Upgrade Available: Scheduled 6 days 1 hour
│ │
╰──────────────────────────────────────────────────────────────────────────────╯

0 comments on commit a02839d

Please sign in to comment.