-
Notifications
You must be signed in to change notification settings - Fork 7
feat (geo-resto): Add geo-resto package for location-based experiences #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Can you fix the CI? |
feat: implement GetLocationsByCategory function in LocationManager fix: rename GetLocationsByUser to GetUserLocations in location tests
|
@leohhhn yes i'm working on it with the refactor to use txlink |
|
Still need to finish implementing some functions and all the txlink like discussed during the meeting and find a suitable replacement at my zk proof idea |
| type AuthManager struct { | ||
| trustedVerifiers map[string]bool // Trusted verifier addresses | ||
| adminAddresses map[string]bool // Admin addresses | ||
| rateLimitTracker map[string]int64 // Tracks last action time for a user and action | ||
| accessTokens map[string]int64 // token -> expiration time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use map in Gno. Please switch to avl.Tree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole file and functionality already exists in packages like p/nt/ownable & gno.land/p/nt/ownable/exts/authorizable. Please remove this code and use existing libraries. This will shorten your code, make it more readable, and increase the reusability value and trust of your code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still unresolved
| // VerifyEventAccess verifies access to a password-protected event | ||
| func (am *AuthManager) VerifyEventAccess(eventID, password string, user address) bool { | ||
| event := eventManager.GetEvent(eventID) | ||
| if event == nil { | ||
| return false | ||
| } | ||
|
|
||
| // If no password required, access is granted | ||
| if event.Password == "" { | ||
| return true | ||
| } | ||
|
|
||
| // Verify password | ||
| hashedPassword := am.hashString(password) | ||
| return hashedPassword == event.Password | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing in the password like this will make it available to everyone as transaction data is public. Please figure out a different way to do this.
leohhhn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should use less AI in your code, especially when starting out with new tech. It seems you do not understand some basic concepts of blockchains & Gno currently. I suggest you read the documentation, see existing examples and common patterns, and try writing your code manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not need to exist. The package itself has tests for what it does.
|
@recule556688, I see you haven't done anything since the review I left 7 days ago. Can you take a look at the comments? |
… deterministic outcome
… quick action links in renderer
… and remove trusted verifiers
…RemoveTrustedVerifier methods
Description:
This pull request introduces the initial, work-in-progress implementation of the geo-resto package.
This is a foundational contribution for a location-based application realm and is not yet feature-complete. The goal is to get the initial structure and code into the repository.
Current state:
Known limitations and next steps:
This is the first step, and more development is needed to make it a fully functional realm.