Skip to content
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

fix(account): Fix delegate/undelegate ParaTime param #82

Merged
merged 1 commit into from May 30, 2023

Conversation

matevz
Copy link
Member

@matevz matevz commented May 29, 2023

Fixes regression introduced in 9ad0ac8 in account delegate/undelegate where we removed the --paratime and --no-paratime parameters. The default ParaTime was always considered then, which isn't supported yet, but will be in the future.

This PR reintroduces --paratime and --no-paratime parameters.

Before:

$ oasis account undelegate 20000000000 oasis1qpkl3vykn9mf4xcq9eevmey4ffrzf0ajtcpvd7sk
Unlock your account.
? Passphrase: 
Error: delegations within ParaTimes are not supported; use --no-paratime
$ oasis account undelegate 20000000000 oasis1qpkl3vykn9mf4xcq9eevmey4ffrzf0ajtcpvd7sk --no-paratime
Error: unknown flag: --no-paratime
Usage:
  oasis account undelegate <shares> <from> [flags]

Flags:
      --account string       explicitly set account to use
      --format string        transaction output format (for offline/unsigned modes) [json, cbor] (default "json")
      --gas-limit uint       override gas limit to use (disable estimation) (default 18446744073709551615)
      --gas-price string     override gas price to use
  -h, --help                 help for undelegate
      --network string       explicitly set network to use
      --nonce uint           override nonce to use (default 18446744073709551615)
      --offline              do not perform any operations requiring network access
  -o, --output-file string   output transaction into specified file instead of broadcasting
      --unsigned             do not sign transaction
  -y, --yes                  answer yes to all questions

Global Flags:
      --config string   config file to use

After:

$ oasis account undelegate 20000000000 oasis1qpkl3vykn9mf4xcq9eevmey4ffrzf0ajtcpvd7sk
Unlock your account.
? Passphrase: 
Error: delegations within ParaTimes are not supported; use --no-paratime
$ oasis account undelegate 20000000000 oasis1qpkl3vykn9mf4xcq9eevmey4ffrzf0ajtcpvd7sk --no-paratime
Unlock your account.
? Passphrase: 
You are about to sign the following transaction:
Method: staking.ReclaimEscrow
Body:
  From:   oasis1qpkl3vykn9mf4xcq9eevmey4ffrzf0ajtcpvd7sk
  Shares: 20000000000
Nonce:  0
Fee:
  Amount: 0.0 TEST
  Gas limit: 1275
  (gas price: 0.0 TEST per gas unit)

Network:  testnet
ParaTime: none (consensus layer)
Account:  oscar
? Sign this transaction? (y/N)

Copy link
Member

@kostko kostko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delegations within paratimes will soon be supported though so we should think about how to support both modes properly to avoid weirdness later where the default behavior would change.

@matevz matevz enabled auto-merge May 30, 2023 10:52
@matevz matevz merged commit 9c75f75 into master May 30, 2023
2 checks passed
@matevz matevz deleted the matevz/fix/delegate-fix branch May 30, 2023 11:19
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.

None yet

2 participants