Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: gfanton <[email protected]>
  • Loading branch information
gfanton committed Jan 20, 2025
1 parent 746128d commit eefbae9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
12 changes: 11 additions & 1 deletion examples/gno.land/r/sys/teams/z_1_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ func main() {
println("team address is not member:", !myteam.HasMember(teamAddress))
println("team address can add package:", myteam.CanAddPackage(teamAddress))
println("team address can add member alice:", myteam.CanAddMember(teamAddress, alice))

println("alice is not member:", !myteam.HasMember(alice))

println(" -> adding alice as member")
myteam.AddMember(alice)

println("alice is now a member:", myteam.HasMember(alice))
}

// Output:
// team address is team address: true
// team address is not member: true
// team address can add package: true
// team address can add member alice: true
// alice is not member: true
// -> adding alice as member
// alice is now a member: true
10 changes: 6 additions & 4 deletions examples/gno.land/r/sys/teams/z_9_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ func init() {
}

func main() {
println(" -> register myteam")

println("* registered myteam")
myteamUser := myteam.Address()

// Setup team user address
Expand All @@ -137,22 +136,25 @@ func main() {
// Register alice to the team
println(" -> adding alice as a member")
myteam.AddMember(alice)

println("alice is member:", myteam.HasMember(alice))
println("alice is level_1:", myteam.GetLevel(alice) == Level1)
println("alice can add package:", myteam.CanAddPackage(alice))
println("bob cannot add package:", !myteam.CanAddPackage(bob))

// Alice should not be able to add a member on level1
println("as level_1, alice cannot add bob as member:", !myteam.CanAddMember(alice, bob))

// Update alice to Level4
println(" -> setting alice to level 4")
myteam.SetLevel(alice, Level4)

println("alice is level_4:", myteam.GetLevel(alice) == Level4)
println("alice can add bob as member:", myteam.CanAddMember(alice, bob))

// Burn team address
println(" -> burn team address")
myteam.BurnTeamAddress()

println("myteamUser is not member:", !myteam.HasMember(myteamUser))
println("myteamUser is level_Unknown:", myteam.GetLevel(myteamUser) == LevelUnknown)
println("myteamUser cannot add package:", !myteam.CanAddPackage(myteamUser))
Expand All @@ -179,7 +181,7 @@ func main() {
}

// Output:
// -> register myteam
// * registered myteam
// myteamUser is team address: true
// myteamUser is not member: true
// myteamUser has not level: true
Expand Down

0 comments on commit eefbae9

Please sign in to comment.