-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(cmd): Add support for registry operations #47
Conversation
51f62dd
to
7fc47e9
Compare
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.
Few questions:
- Where is nodeRegister operation?
- Should we move
oasis inspect registry
to something likeoasis registry show
instead? Alsooasis registry dump
would come in handy.
Node registration happens automatically by oasis-node so manual registration should never be needed. Good point about the registry inspect functions. By dump you probably mean something like the current |
7fc47e9
to
baf2c9a
Compare
Moved the |
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.
Good job!
cobra.CheckErr("account does not support signing consensus transactions") | ||
} | ||
if !signer.Public().Equal(descriptor.ID) { | ||
cobra.CheckErr(fmt.Errorf("entity ID (%s) does not correspond to selected account (%s)", |
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.
cobra.CheckErr(fmt.Errorf("entity ID (%s) does not correspond to selected account (%s)", | |
cobra.CheckErr(fmt.Errorf("entity ID '%s' does not correspond to selected account '%s' (%s)", |
} | ||
if !signer.Public().Equal(descriptor.ID) { | ||
cobra.CheckErr(fmt.Errorf("entity ID (%s) does not correspond to selected account (%s)", | ||
descriptor.ID, signer.Public())) |
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.
descriptor.ID, signer.Public())) | |
descriptor.ID, npa.AccountName, signer.Public())) |
acc := common.LoadAccount(cfg, npa.AccountName) | ||
signer := acc.ConsensusSigner() | ||
if signer == nil { | ||
cobra.CheckErr("account does not support signing consensus transactions") |
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.
cobra.CheckErr("account does not support signing consensus transactions") | |
cobra.CheckErr(fmt.Errorf("account '%s' does not support signing consensus transactions", npa.AccountName)) |
tx := registry.NewDeregisterEntityTx(0, nil) | ||
|
||
acc := common.LoadAccount(cfg, npa.AccountName) | ||
sigTx, err := common.SignConsensusTransaction(ctx, npa, acc, conn, tx) |
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.
It would be nice if PrettyPrinter omitted the
Body:
{}
chunk if Body is empty. But this needs to be fixed in SDK.
registryRuntimeRegisterCmd.Flags().AddFlagSet(common.SelectorFlags) | ||
registryRuntimeRegisterCmd.Flags().AddFlagSet(common.TransactionFlags) | ||
|
||
registryShowCmd.Flags().AddFlagSet(common.SelectorFlags) |
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.
oasis registry show
only requires --network
flag afaik.
Ah, crap, automerge was enabled. Can you make a short followup? |
Yeah will do. |
No description provided.