@@ -3880,109 +3880,6 @@ func (s *MessengerCommunitiesSuite) TestCommunityRekeyAfterBan() {
38803880 s .Require ().NoError (err )
38813881}
38823882
3883- func (s * MessengerCommunitiesSuite ) TestCommunityRekeyAfterBanDisableCompatibility () {
3884- messaging .SetRekeyCompatibility (false )
3885- s .owner .communitiesManager .RekeyInterval = 500 * time .Minute
3886-
3887- // Create a new community
3888- response , err := s .owner .CreateCommunity (
3889- & requests.CreateCommunity {
3890- Membership : protobuf .CommunityPermissions_AUTO_ACCEPT ,
3891- Name : "status" ,
3892- Color : "#57a7e5" ,
3893- Description : "status community description" ,
3894- },
3895- true ,
3896- )
3897- s .Require ().NoError (err )
3898- s .Require ().NotNil (response )
3899- s .Require ().Len (response .Communities (), 1 )
3900-
3901- // Check community is present in the DB and has default values we care about
3902- c , err := s .owner .GetCommunityByID (response .Communities ()[0 ].ID ())
3903- s .Require ().NoError (err )
3904- s .Require ().False (c .Encrypted ())
3905- // TODO some check that there are no keys for the community. Alt for s.Require().Zero(c.RekeyedAt().Unix())
3906-
3907- _ , err = s .owner .CreateCommunityTokenPermission (& requests.CreateCommunityTokenPermission {
3908- CommunityID : c .ID (),
3909- Type : protobuf .CommunityTokenPermission_BECOME_MEMBER ,
3910- TokenCriteria : []* protobuf.TokenCriteria {{
3911- ContractAddresses : map [uint64 ]string {3 : "0x933" },
3912- Type : protobuf .CommunityTokenType_ERC20 ,
3913- Symbol : "STT" ,
3914- Name : "Status Test Token" ,
3915- AmountInWei : "10000000000000000000" ,
3916- Decimals : 18 ,
3917- }},
3918- })
3919- s .Require ().NoError (err )
3920-
3921- c , err = s .owner .GetCommunityByID (c .ID ())
3922- s .Require ().NoError (err )
3923- s .Require ().True (c .Encrypted ())
3924-
3925- s .advertiseCommunityTo (c , s .owner , s .bob )
3926- s .advertiseCommunityTo (c , s .owner , s .alice )
3927-
3928- s .mockPermissionCheckerForAllMessenger ()
3929-
3930- s .joinCommunity (c , s .owner , s .bob )
3931- s .joinCommunity (c , s .owner , s .alice )
3932-
3933- // Check the Alice and Bob are members of the community
3934- c , err = s .owner .GetCommunityByID (c .ID ())
3935- s .Require ().NoError (err )
3936- s .Require ().True (c .HasMember (& s .alice .identity .PublicKey ))
3937- s .Require ().True (c .HasMember (& s .bob .identity .PublicKey ))
3938-
3939- // Make sure at least one key makes it to alice
3940- response , err = WaitOnMessengerResponse (s .alice ,
3941- func (r * MessengerResponse ) bool {
3942- keysCount , err := messaging.TestUtils {API : s .alice .messaging }.GetKeysForGroupCount (response .Communities ()[0 ].ID ())
3943- if err != nil || keysCount != 1 {
3944- return false
3945- }
3946- return true
3947-
3948- },
3949- "alice does not have enough keys" ,
3950- )
3951- s .Require ().NoError (err )
3952-
3953- response , err = s .owner .BanUserFromCommunity (context .Background (), & requests.BanUserFromCommunity {
3954- CommunityID : c .ID (),
3955- User : crypto .PubkeyToHexBytes (& s .bob .identity .PublicKey ),
3956- })
3957- s .Require ().NoError (err )
3958- s .Require ().Len (response .Communities (), 1 )
3959-
3960- s .Require ().False (response .Communities ()[0 ].HasMember (& s .bob .identity .PublicKey ))
3961-
3962- // Check bob has been banned
3963- response , err = WaitOnMessengerResponse (s .alice ,
3964- func (r * MessengerResponse ) bool {
3965- return len (r .Communities ()) == 1 && ! r .Communities ()[0 ].HasMember (& s .bob .identity .PublicKey )
3966-
3967- },
3968- "alice didn't receive updated description" ,
3969- )
3970- s .Require ().NoError (err )
3971-
3972- response , err = WaitOnMessengerResponse (s .alice ,
3973- func (r * MessengerResponse ) bool {
3974- keysCount , err := messaging.TestUtils {API : s .alice .messaging }.GetKeysForGroupCount (response .Communities ()[0 ].ID ())
3975- if err != nil || keysCount < 2 {
3976- return false
3977- }
3978- return true
3979-
3980- },
3981- "alice hasn't received updated key" ,
3982- )
3983- s .Require ().NoError (err )
3984- }
3985-
39863883func (s * MessengerCommunitiesSuite ) TestRetrieveBigCommunity () {
39873884 bigEmoji := make ([]byte , 4 * 1024 * 1024 ) // 4 MB
39883885 description := & requests.CreateCommunity {
0 commit comments