Skip to content

Commit

Permalink
chore: add spec files, tx short description
Browse files Browse the repository at this point in the history
  • Loading branch information
johnletey committed May 3, 2024
1 parent 3efce91 commit 34385f2
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
[![codecov](https://img.shields.io/codecov/c/gh/noble-assets/authority?token=QNKNK03VIR&labelColor=black)](https://codecov.io/gh/noble-assets/authority)

This repository includes the `x/authority` Cosmos SDK module implementation.

For more information, refer to the modules [spec](../x/authority/spec) files.
2 changes: 1 addition & 1 deletion x/authority/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func GetTxCmd() *cobra.Command {
func NewCmdExecute() *cobra.Command {
cmd := &cobra.Command{
Use: "execute [path to underlying tx file]",
Short: "",
Short: "Execute arbitrary messages as authority module",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down
16 changes: 16 additions & 0 deletions x/authority/spec/01_state.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# State

## Authority

The authority field is of type bytes, specifically a Noble address, stored via an [`collections.Item`][item].
It is used to store the current underlying authority address of this module.

```go
var AuthorityKey = []byte("authority")
```

It is updated by the following messages:

- [`noble.authority.v1.UpdateAuthority`](./02_messages.md#update-authority)

[item]: https://docs.cosmos.network/main/build/packages/collections#item
91 changes: 91 additions & 0 deletions x/authority/spec/02_messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Messages

## Execute

`noble.authority.v1.MsgExecute`

A message to execute arbitrary messages on behalf of the `x/authority` module.
If other module authorities are configured to this module, this can be used to
execute admin messages such as updating params, software ugprades, etc.

```shell
auth_info:
fee:
amount: []
gas_limit: "200000"
granter: ""
payer: ""
signer_infos: []
tip: null
body:
extension_options: []
memo: ""
messages:
- '@type': /noble.authority.v1.MsgExecute
messages: [...]
signer: noble1authority
non_critical_extension_options: []
timeout_height: "0"
signatures: []
```

### Arguments

- `messages` — An array of encoded messages to execute.

### Requirements

- Signer must be the current underlying [`authority`](./01_state.md#authority).

### State Changes

This message doesn't affect any `x/authority` state.

However, the executed messages may contain state changes.

### Events Emitted

This message emits no events.

## Update Authority

`noble.authority.v1.MsgUpdateAuthority`

A message that updates the underlying authority of this module.

```shell
auth_info:
fee:
amount: []
gas_limit: "200000"
granter: ""
payer: ""
signer_infos: []
tip: null
body:
extension_options: []
memo: ""
messages:
- '@type': /noble.authority.v1.MsgUpdateAuthority
new_authority: noble1demo
signer: noble1authority
non_critical_extension_options: []
timeout_height: "0"
signatures: []
```

### Arguments

- `new_authority` — The Noble address to transfer underlying authority to.

### Requirements

- Signer must be the current underlying [`authority`](./01_state.md#authority).

### State Changes

- [`authority`](./01_state.md#authority)

### Events Emitted

This message emits no events.

0 comments on commit 34385f2

Please sign in to comment.