Merge PR #4787: Updated docs build process
This commit is contained in:
committed by
Alexander Bezobchuk
parent
d3aa9feaca
commit
450c8ced2c
@@ -19,7 +19,7 @@ The account interface exposes methods to read and write standard account informa
|
||||
Note that all of these methods operate on an account struct confirming to the interface
|
||||
- in order to write the account to the store, the account keeper will need to be used.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type Account interface {
|
||||
GetAddress() AccAddress
|
||||
SetAddress(AccAddress)
|
||||
@@ -43,7 +43,7 @@ type Account interface {
|
||||
A base account is the simplest and most common account type, which just stores all requisite
|
||||
fields directly in a struct.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type BaseAccount struct {
|
||||
Address AccAddress
|
||||
Coins Coins
|
||||
|
||||
@@ -12,7 +12,7 @@ to include in their proposed block transactions which fail `CheckTx`.
|
||||
|
||||
### Ante Handler
|
||||
|
||||
```golang
|
||||
```go
|
||||
anteHandler(ak AccountKeeper, fck FeeCollectionKeeper, tx sdk.Tx)
|
||||
if !tx.(StdTx)
|
||||
fail with "not a StdTx"
|
||||
|
||||
@@ -11,7 +11,7 @@ a struct which implements the `sdk.Tx` interface using `StdFee` and `StdSignatur
|
||||
A `StdFee` is simply the combination of a fee amount, in any number of denominations,
|
||||
and a gas limit (where dividing the amount by the gas limit gives a "gas price").
|
||||
|
||||
```golang
|
||||
```go
|
||||
type StdFee struct {
|
||||
Amount Coins
|
||||
Gas uint64
|
||||
@@ -24,7 +24,7 @@ A `StdSignature` is the combination of an optional public key and a cryptographi
|
||||
as a byte array. The SDK is agnostic to particular key or signature formats and supports any
|
||||
supported by the `PubKey` interface.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type StdSignature struct {
|
||||
PubKey PubKey
|
||||
Signature []byte
|
||||
@@ -36,7 +36,7 @@ type StdSignature struct {
|
||||
A `StdTx` is a struct which implements the `sdk.Tx` interface, and is likely to be generic
|
||||
enough to serve the purposes of many Cosmos SDK blockchains.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type StdTx struct {
|
||||
Msgs []sdk.Msg
|
||||
Fee StdFee
|
||||
@@ -53,7 +53,7 @@ will only be executable once on a particular blockchain.
|
||||
|
||||
`json.RawMessage` is preferred over using the SDK types for future compatibility.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type StdSignDoc struct {
|
||||
AccountNumber uint64
|
||||
ChainID string
|
||||
|
||||
@@ -7,7 +7,7 @@ The auth module only exposes one keeper, the account keeper, which can be used t
|
||||
Presently only one fully-permissioned account keeper is exposed, which has the ability to both read and write
|
||||
all fields of all accounts, and to iterate over all stored accounts.
|
||||
|
||||
```golang
|
||||
```go
|
||||
type AccountKeeper interface {
|
||||
// Return a new account with the next account number and the specified address. Does not save the new account to the store.
|
||||
NewAccountWithAddress(AccAddress) Account
|
||||
|
||||
@@ -365,30 +365,30 @@ V' = 0
|
||||
```
|
||||
|
||||
1. Immediately receives 1 coin
|
||||
```text
|
||||
```
|
||||
BC = 11
|
||||
```
|
||||
2. Time passes, 2 coins vest
|
||||
```text
|
||||
```
|
||||
V = 8
|
||||
V' = 2
|
||||
```
|
||||
3. Delegates 4 coins to validator A
|
||||
```text
|
||||
```
|
||||
DV = 4
|
||||
BC = 7
|
||||
```
|
||||
4. Sends 3 coins
|
||||
```text
|
||||
```
|
||||
BC = 4
|
||||
```
|
||||
5. More time passes, 2 more coins vest
|
||||
```text
|
||||
```
|
||||
V = 6
|
||||
V' = 4
|
||||
```
|
||||
6. Sends 2 coins. At this point the account cannot send anymore until further coins vest or it receives additional coins. It can still however, delegate.
|
||||
```text
|
||||
```
|
||||
BC = 2
|
||||
```
|
||||
|
||||
@@ -397,28 +397,28 @@ V' = 0
|
||||
Same initial starting conditions as the simple example.
|
||||
|
||||
1. Time passes, 5 coins vest
|
||||
```text
|
||||
```
|
||||
V = 5
|
||||
V' = 5
|
||||
```
|
||||
2. Delegate 5 coins to validator A
|
||||
```text
|
||||
```
|
||||
DV = 5
|
||||
BC = 5
|
||||
```
|
||||
3. Delegate 5 coins to validator B
|
||||
```text
|
||||
```
|
||||
DF = 5
|
||||
BC = 0
|
||||
```
|
||||
4. Validator A gets slashed by 50%, making the delegation to A now worth 2.5 coins
|
||||
5. Undelegate from validator A (2.5 coins)
|
||||
```text
|
||||
```
|
||||
DF = 5 - 2.5 = 2.5
|
||||
BC = 0 + 2.5 = 2.5
|
||||
```
|
||||
6. Undelegate from validator B (5 coins). The account at this point can only send 2.5 coins unless it receives more coins or until more coins vest. It can still however, delegate.
|
||||
```text
|
||||
```
|
||||
DV = 5 - 2.5 = 2.5
|
||||
DF = 2.5 - 2.5 = 0
|
||||
BC = 2.5 + 5 = 7.5
|
||||
|
||||
Reference in New Issue
Block a user