geolocation: add CLI to update user payment token account#3601
Open
geolocation: add CLI to update user payment token account#3601
Conversation
2e6e026 to
00250a1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
user updatesubcommand todoublezero-geolocationthat submits the existing on-chainUpdateGeolocationUserinstruction (previously unreachable from the CLI)--user <code-or-pubkey>(resolved viaGetGeolocationUserCommand, mirroringdelete) and--token-account <pubkey>, then issues the update against the resolved codeGeoCliCommandtrait withupdate_geolocation_userso the new CLI path goes through the same mockable boundary as the rest of the geolocation CLIDiff Breakdown
Almost entirely additive: one new CLI command file (production + tests) plus thin wiring in four existing files (trait method, subcommand enum, dispatch, mod declaration).
Key files (click to expand)
smartcontract/cli/src/geolocation/user/update.rs— newUpdateGeolocationUserCliCommand(clap struct +execute) and a unit test asserting the command resolves the user and emits the expected SDK callsmartcontract/cli/src/geoclicommand.rs— addsupdate_geolocation_userto theGeoCliCommandtrait andGeoCliCommandImplclient/doublezero-geolocation-cli/src/cli/user.rs— adds theUpdatevariant toUserCommandsand re-exports the new CLI structclient/doublezero-geolocation-cli/src/main.rs— dispatchesUserCommands::Updatetoargs.execute(&client, &mut handle)smartcontract/cli/src/geolocation/user/mod.rs— registers the newupdatemoduleTesting Verification
test_cli_update_geolocation_userverifies the CLI resolves a user by code and submitsUpdateGeolocationUserCommand { code, token_account: Some(..) }cargo test -p doublezero_cli geolocation::user— 28/28 passing including the new testcargo build -p doublezero_cli -p doublezero-geolocation-clicleancargo clippy -p doublezero_cli -p doublezero-geolocation-cli --all-targets -- -Dclippy::all -Dwarningsclean