Skip to content

geolocation: add CLI to update user payment token account#3601

Merged
ben-dz merged 1 commit intomainfrom
bdz/geolocation-update-pament-acct
Apr 29, 2026
Merged

geolocation: add CLI to update user payment token account#3601
ben-dz merged 1 commit intomainfrom
bdz/geolocation-update-pament-acct

Conversation

@ben-dz
Copy link
Copy Markdown
Contributor

@ben-dz ben-dz commented Apr 29, 2026

Summary of Changes

  • Add user update subcommand to doublezero-geolocation that submits the existing on-chain UpdateGeolocationUser instruction (previously unreachable from the CLI)
  • Subcommand takes --user <code-or-pubkey> (resolved via GetGeolocationUserCommand, mirroring delete) and --token-account <pubkey>, then issues the update against the resolved code
  • Extends the GeoCliCommand trait with update_geolocation_user so the new CLI path goes through the same mockable boundary as the rest of the geolocation CLI

Diff Breakdown

Category Files Lines (+/-) Net
Core logic 1 +35 / -0 +35
Scaffolding 4 +15 / -1 +14
Tests 1 +67 / -0 +67

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 — new UpdateGeolocationUserCliCommand (clap struct + execute) and a unit test asserting the command resolves the user and emits the expected SDK call
  • smartcontract/cli/src/geoclicommand.rs — adds update_geolocation_user to the GeoCliCommand trait and GeoCliCommandImpl
  • client/doublezero-geolocation-cli/src/cli/user.rs — adds the Update variant to UserCommands and re-exports the new CLI struct
  • client/doublezero-geolocation-cli/src/main.rs — dispatches UserCommands::Update to args.execute(&client, &mut handle)
  • smartcontract/cli/src/geolocation/user/mod.rs — registers the new update module

Testing Verification

  • New unit test test_cli_update_geolocation_user verifies the CLI resolves a user by code and submits UpdateGeolocationUserCommand { code, token_account: Some(..) }
  • cargo test -p doublezero_cli geolocation::user — 28/28 passing including the new test
  • cargo build -p doublezero_cli -p doublezero-geolocation-cli clean
  • cargo clippy -p doublezero_cli -p doublezero-geolocation-cli --all-targets -- -Dclippy::all -Dwarnings clean

@ben-dz ben-dz requested a review from nikw9944 April 29, 2026 13:47
@ben-dz ben-dz force-pushed the bdz/geolocation-update-pament-acct branch from 2e6e026 to 00250a1 Compare April 29, 2026 13:49
@ben-dz ben-dz merged commit 7e00df6 into main Apr 29, 2026
36 checks passed
@ben-dz ben-dz deleted the bdz/geolocation-update-pament-acct branch April 29, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants