Skip to content

Commit

Permalink
updated spec files as per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
twothirtyfive committed Aug 27, 2024
1 parent 63fa332 commit 4895610
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 40 deletions.
12 changes: 6 additions & 6 deletions x/forwarding/spec/01-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The `ForwardingAccount` structure stores the data needed for forwarding. This in
- **BaseAccount**: inherits from `cosmos.auth.v1beta1.BaseAccount`
- **channel**: specifies the IBC channel through which tokens are forwarded
- **recipient**: the address that receives the forwarded tokens
- **created_at**: timestamp at creation
- **created_at**: block height at creation
- **fallback**: a fallback address to be used if forwarding to the primary recipient fails

#### State Update
Expand All @@ -41,14 +41,14 @@ The state is updated by the following messages:

### Genesis State

The genesis state of the `x/forwarding` module sets up the initial configuration, including which denominations are allowed for forwarding and the initial statistics related to registered accounts and forwarding transactions.
The genesis state of the `x/forwarding` module sets up the initial configuration, including which denominations are allowed for forwarding and the initial statistics related to registered accounts and forwarding actions.

#### Structure

```Go
{
"allowed_denoms": [
"uatom",
"ausdy",
"uusdc"
],
"num_of_accounts": {
Expand All @@ -60,7 +60,7 @@ The genesis state of the `x/forwarding` module sets up the initial configuration
"channel-1": "1"
},
"total_forwarded": {
"channel-0": "1000000uatom",
"channel-0": "1000000ausdy",
"channel-1": "500000uusdc"
}
}
Expand All @@ -70,8 +70,8 @@ The genesis state of the `x/forwarding` module sets up the initial configuration

- **allowed_denoms**: a list of denominations that are allowed to be forwarded
- **num_of_accounts**: a map linking channel IDs to the number of registered forwarding accounts
- **num_of_forwards**: a map linking channel IDs to the number of forwarding transactions
- **total_forwarded**: a map linking channel IDs to the total amount (of denom) forwarded through the channel
- **num_of_forwards**: a map linking channel IDs to the number of forwarding actions
- **total_forwarded**: a map linking channel IDs to the total amount (per denom) forwarded through the channel

### State Update

Expand Down
32 changes: 15 additions & 17 deletions x/forwarding/spec/02-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,45 @@

## Overview

The `x/forwarding` module defines several messages concerning management of forwarding accounts and allowed denominations for IBC packet forwarding. These messages allow users to register and clear forwarding accounts, and update the list of denominations that can be forwarded.
The `x/forwarding` module defines several messages concerning management of forwarding accounts and allowed denominations for automatic forwarding. These messages allow users to register and clear forwarding accounts, and an authority to update the list of denominations that can be forwarded.

### MsgRegisterAccount

When `MsgRegisterAccount` is submitted, it creates a new forwarding account on the specified IBC channel. The message ensures that IBC packets are routed to the `recipient` address, with a fallback option if the primary routing fails. The `signer` is the address of the account who controls the forwarding account. The `fallback` must be a native address.

When `MsgRegisterAccount` is submitted, it creates a new forwarding account for a specified IBC channel. The message ensures that received tokens are automatically routed to the `recipient` address, with a fallback option if the primary routing fails. The `signer` is the native address of the account registering the forwarding account. The `fallback` must be a native address.
#### Structure

```Go
{
"type": "noble/forwarding/MsgRegisterAccount",
"type": "noble/forwarding/RegisterAccount",
"value": {
"signer": "cosmos1...",
"signer": "noble1...",
"recipient": "cosmos1...",
"channel": "channel-0",
"fallback": "cosmos1..."
"fallback": "noble1..."
}
}
```

#### Fields

- **signer**: the address of the account that is registering the forwarding account
- **recipient**: the address where forwarded packets will be delivered
- **recipient**: the address where forwarded tokens will be sent
- **channel**: the IBC channel through which the forwarding occurs
- **fallback**: the fallback address to use if forwarding to the primary recipient fails


### MsgClearAccount

`MsgClearAccount` is used to clear a non-empty forwarding account, returning packets to the `fallback` address. If `fallback` is `false`, packets attempt to send at the end of the next block. The `signer` must have the necessary authority to perform this action.
`MsgClearAccount` is used to clear a non-empty forwarding account, returning tokens to the `fallback` address. If `fallback` is `false`, tokens attempt to send at the end of the current block.

#### Structure

```Go
{
"type": "noble/forwarding/MsgClearAccount",
"type": "noble/forwarding/ClearAccount",
"value": {
"signer": "cosmos1...",
"address": "cosmos1...",
"signer": "noble1...",
"address": "noble1...",
"fallback": true
}
}
Expand All @@ -51,22 +50,21 @@ When `MsgRegisterAccount` is submitted, it creates a new forwarding account on t

- **signer**: the address of the account that is clearing the forwarding account
- **address**: the address of the forwarding account to be cleared
- **fallback**: a boolean indicating whether to use the fallback address for remaining packets
- **fallback**: a boolean indicating whether to use the fallback address for receiving tokens


### MsgSetAllowedDenoms

`MsgSetAllowedDenoms` is used to configure or update the list of token denominations that are allowed for IBC packet forwarding. This is important for maintaining control over which assets are eligible for forwarding, ensuring that only approved tokens are transferred.

`MsgSetAllowedDenoms` is used to configure or update the list of token denominations that are allowed for automatic forwarding. This is important for maintaining control over which assets are eligible for forwarding, ensuring that only approved tokens are routed.
#### Structure

```Go
{
"type": "noble/forwarding/MsgSetAllowedDenoms",
"type": "noble/forwarding/SetAllowedDenoms",
"value": {
"signer": "cosmos1...",
"signer": "noble1...",
"denoms": [
"uatom",
"ausdy",
"uusdc"
]
}
Expand Down
12 changes: 6 additions & 6 deletions x/forwarding/spec/03-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ The `x/forwarding` module emits events for actions such as registration or clear
{
"type": "noble/forwarding/v1/AccountRegistered",
"attributes": {
"address": "cosmos1...",
"address": "noble1...",
"channel": "channel-0",
"recipient": "cosmos1...",
"fallback": "cosmos1..."
"fallback": "noble1..."
}
}
```
Expand All @@ -43,8 +43,8 @@ The `x/forwarding` module emits events for actions such as registration or clear
{
"type": "noble/forwarding/v1/AccountCleared",
"attributes": {
"address": "cosmos1...",
"recipient": "cosmos1..."
"address": "noble1...",
"recipient": "noble1..."
}
}
```
Expand All @@ -68,8 +68,8 @@ The `x/forwarding` module emits events for actions such as registration or clear
{
"type": "noble/forwarding/v1/AllowedDenomsConfigured",
"attributes": {
"previous_denoms": ["uatom", "uusdc"],
"current_denoms": ["uatom", "uusdc", "uiris"]
"previous_denoms": ["ausdy", "uusdc"],
"current_denoms": ["ausdy", "uusdc", "ueure"]
}
}
```
Expand Down
14 changes: 7 additions & 7 deletions x/forwarding/spec/04-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr
"type": "noble/forwarding/v1/QueryDenomsResponse",
"value": {
"allowed_denoms": [
"uatom",
"ausdy",
"uusdc"
]
}
Expand All @@ -47,7 +47,7 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr
"value": {
"channel": "channel-0",
"recipient": "cosmos1...",
"fallback": "cosmos1..."
"fallback": "noble1..."
}
}
```
Expand All @@ -58,15 +58,15 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr
{
"type": "noble/forwarding/v1/QueryAddressResponse",
"value": {
"address": "cosmos1...",
"address": "noble1...",
"exists": true
}
}
```

#### Fields

- **channel**: the IBC channel through which packets are forwarded
- **channel**: the IBC channel through which tokens are forwarded
- **recipient**: the recipient address
- **fallback**: the fallback address to use if forwarding to the primary recipient fails
- **address**: the forwarding account's address
Expand Down Expand Up @@ -95,7 +95,7 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr
"channel-0": {
"num_of_accounts": "1",
"num_of_forwards": "1",
"total_forwarded": "1000000uatom"
"total_forwarded": "1000000ausdy"
},
"channel-1": {
"num_of_accounts": "1",
Expand Down Expand Up @@ -136,7 +136,7 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr
"num_of_forwards": "100",
"total_forwarded": [
{
"denom": "uatom",
"denom": "ausdy",
"amount": "1000000"
}
]
Expand All @@ -148,5 +148,5 @@ The `x/forwarding` module provides several gRPC and REST query endpoints to retr

- **channel**: the IBC channel for which statistics are being retrieved
- **num_of_accounts**: the number of registered accounts on the channel
- **num_of_forwards**: the number of forwarded packets on the channel
- **num_of_forwards**: the number of forwarded tokens on the channel
- **total_forwarded**: the total amount of assets forwarded on the channel, delineated by denomination
8 changes: 4 additions & 4 deletions x/forwarding/spec/05-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ The CLI commands for the `x/forwarding` module allow users to query information

### Query Commands

#### Query Denoms
#### Query Allowed Denoms

Queries the list of allowed denominations.

```Go
noble forwarding query denoms
nobled query forwarding denoms
```

#### Query Forwarding Address

Queries the address of a forwarding account based on the specified IBC channel, recipient, and fallback address.

```Go
noble forwarding query address [channel] [recipient] [fallback]
noble forwarding query address channel-0 cosmos1... cosmos1...
nobled query forwarding address [channel] [recipient] [fallback]
nobled query forwarding address channel-0 cosmos1... noble1...
```

#### Query Forwarding Stats
Expand Down

0 comments on commit 4895610

Please sign in to comment.