@@ -42,6 +42,8 @@ TEST CASES - inflation splitting
4242* Produce a valid bundle with no funders, 10% inflation splitting and pool-0 = 0.1 weight and pool-1 = 1.0 weight
4343* Produce a valid bundle with no funders, 10% inflation splitting and pool-0 = 1.0 weight and pool-1 = 1.0 weight
4444
45+ * Check if already existing pool accounts would cause a panic
46+
4547*/
4648
4749/*
@@ -2033,4 +2035,22 @@ var _ = Describe("inflation splitting", Ordered, func() {
20332035 Expect (s .App ().FundersKeeper .GetTotalActiveFunding (s .Ctx (), fundingState .PoolId )).To (BeZero ())
20342036 Expect (fundingState .ActiveFunderAddresses ).To (BeEmpty ())
20352037 })
2038+
2039+ It ("Check if already existing pool accounts would cause a panic" , func () {
2040+ // ARRANGE
2041+ // this is the address of pool/1
2042+ found := s .App ().AccountKeeper .HasAccount (s .Ctx (), sdk .MustAccAddressFromBech32 ("kyve1zqdz48xggheknnh4yrz5xx9h5jtg9kvjd24lud" ))
2043+ Expect (found ).To (BeFalse ())
2044+
2045+ err := s .App ().BankKeeper .SendCoins (s .Ctx (), sdk .MustAccAddressFromBech32 (i .ALICE ), sdk .MustAccAddressFromBech32 ("kyve1zqdz48xggheknnh4yrz5xx9h5jtg9kvjd24lud" ), i .KYVECoins (1 * i .T_KYVE ))
2046+ Expect (err ).NotTo (HaveOccurred ())
2047+
2048+ // ACT
2049+ s .App ().PoolKeeper .EnsurePoolAccount (s .Ctx (), 1 )
2050+
2051+ // ASSERT
2052+ account := s .App ().AccountKeeper .GetAccount (s .Ctx (), sdk .MustAccAddressFromBech32 ("kyve1zqdz48xggheknnh4yrz5xx9h5jtg9kvjd24lud" ))
2053+ _ , ok := account .(sdk.ModuleAccountI )
2054+ Expect (ok ).To (BeTrue ())
2055+ })
20362056})
0 commit comments