Skip to content

Commit

Permalink
fix: test and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
karlem committed Oct 16, 2023
1 parent 0460118 commit fae2e46
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions core/types/liquidity_fee_stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

package types
package types_test

import (
"testing"

"github.com/stretchr/testify/require"

"code.vegaprotocol.io/vega/core/types"
"code.vegaprotocol.io/vega/libs/num"
v1 "code.vegaprotocol.io/vega/protos/vega/events/v1"
"github.com/stretchr/testify/require"
)

func TestLiquidityFeeStats(t *testing.T) {
market := "market1"
asset := "usdt"

stats := NewLiquidityFeeStats()
stats := types.NewLiquidityFeeStats()

stats.RegisterTotalFeesAmountPerParty(map[string]*num.Uint{
"a": num.UintFromUint64(2),
Expand Down Expand Up @@ -55,7 +57,7 @@ func TestLiquidityFeeStats(t *testing.T) {
require.Equal(t, expectedAmountsPerParty, statsProto.FeesPaidPerParty)
require.Equal(t, "19", statsProto.TotalFeesPaid)

stats = NewLiquidityFeeStats()
stats = types.NewLiquidityFeeStats()

statsProto = stats.ToProto(market, asset)
require.Equal(t, []*v1.PartyAmount{}, statsProto.FeesPaidPerParty)
Expand Down
12 changes: 6 additions & 6 deletions datanode/networkhistory/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,12 +378,12 @@ func TestMain(t *testing.M) {
log.Infof("%s", goldenSourceHistorySegment[4000].HistorySegmentID)
log.Infof("%s", goldenSourceHistorySegment[5000].HistorySegmentID)

panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[1000].HistorySegmentID, "QmYrVbhxx5LLwa51an7uBGsSNYRfNxLq8TmtHECCZ1dfHq", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2000].HistorySegmentID, "QmRtr3QBKdxaMutNpxz3jr2bb4AjcngkKQmqYRfgCULF4U", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2500].HistorySegmentID, "QmQ6TqEYwWoTdTJwmmNexPRtDQiRJHW21CFuSKMwdjEaCS", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[3000].HistorySegmentID, "QmShyPtkonnSofDj7EfdP6YieuX5Z3hah2wifrp1qFgQDE", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[4000].HistorySegmentID, "QmYyKDXtJBLCcg8qQGGwbahWme4vbaMgabthEFov3dNHFx", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[5000].HistorySegmentID, "QmWDXhoT1HJf81YGbRAY46jD1de8oqxb4vZ8H9TDADVxwY", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[1000].HistorySegmentID, "QmQhDsQ2B3DW8atmg8yoPvvAENeFxAK7Kh38hqceVucXKS", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2000].HistorySegmentID, "QmVt8swjn9PiBUcTm9GgqNtDuYYS7Cn9zCJgsWhh1fmbW5", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[2500].HistorySegmentID, "QmcRiZxgfi2puvBf45y9gj7NusMRNEQaJW7E15fotbY2qo", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[3000].HistorySegmentID, "QmXkUYKR4rn3YJVxyWhJRXejVdfNdoMwNvnMD3b3VSnXso", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[4000].HistorySegmentID, "QmPmUYmPbSPx2wqWhNdFS5yqceX2KbDwSbaZV2pV5wr8XP", snapshots)
panicIfHistorySegmentIdsNotEqual(goldenSourceHistorySegment[5000].HistorySegmentID, "QmcVLUZayWrqBtP5B8KC2sjCBb7kpHXeqJYcAqRGUKXLLN", snapshots)
}, postgresRuntimePath, sqlFs)

if exitCode != 0 {
Expand Down

0 comments on commit fae2e46

Please sign in to comment.