Skip to content

Commit

Permalink
changelong
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnya97 committed Jul 9, 2018
1 parent d7158b7 commit 9f2f47a
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ BREAKING CHANGES
* [lcd] Switch key creation output to return bech32
* [x/stake] store-value for delegation, validator, ubd, and red do not hold duplicate information contained store-key
* [gaiad] genesis transactions now use bech32 addresses / pubkeys
* [types] Renamed `sdk.Address` to `sdk.AccAddress`/`sdk.ValAddress`
* [types] `sdk.AccAddress`/`sdk.ValAddress` natively marshals to Bech32 in String, Sprintf (when used with `%s`), and MarshalJSON

DEPRECATED
* [cli] Deprecate `--name` flag in commands that send txs, in favor of `--from`
Expand Down
14 changes: 7 additions & 7 deletions docs/core/app1.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type Msg interface {
// Signers returns the addrs of signers that must sign.
// CONTRACT: All signatures must be present to be valid.
// CONTRACT: Returns addrs in some deterministic order.
GetSigners() []Address
GetSigners() []AccAddress
}
```

Expand All @@ -43,8 +43,8 @@ For instance, take the simple token sending message type from app1.go:
```go
// MsgSend to send coins from Input to Output
type MsgSend struct {
From sdk.Address `json:"from"`
To sdk.Address `json:"to"`
From sdk.AccAddress `json:"from"`
To sdk.AccAddress `json:"to"`
Amount sdk.Coins `json:"amount"`
}

Expand All @@ -65,8 +65,8 @@ func (msg MsgSend) GetSignBytes() []byte {
}

// Implements Msg. Return the signer.
func (msg MsgSend) GetSigners() []sdk.Address {
return []sdk.Address{msg.From}
func (msg MsgSend) GetSigners() []sdk.AccAddress {
return []sdk.AccAddress{msg.From}
}
```

Expand Down Expand Up @@ -277,7 +277,7 @@ Coins](https://godoc.org/github.com/cosmos/cosmos-sdk/types#Coins).
Now we're ready to handle the two parts of the MsgSend:

```go
func handleFrom(store sdk.KVStore, from sdk.Address, amt sdk.Coins) sdk.Result {
func handleFrom(store sdk.KVStore, from sdk.AccAddress, amt sdk.Coins) sdk.Result {
// Get sender account from the store.
accBytes := store.Get(from)
if accBytes == nil {
Expand Down Expand Up @@ -315,7 +315,7 @@ func handleFrom(store sdk.KVStore, from sdk.Address, amt sdk.Coins) sdk.Result {
return sdk.Result{}
}

func handleTo(store sdk.KVStore, to sdk.Address, amt sdk.Coins) sdk.Result {
func handleTo(store sdk.KVStore, to sdk.AccAddress, amt sdk.Coins) sdk.Result {
// Add msg amount to receiver account
accBytes := store.Get(to)
var acc appAccount
Expand Down
8 changes: 4 additions & 4 deletions docs/core/app2.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Let's introduce a new message type for issuing coins:
// MsgIssue to allow a registered issuer
// to issue new coins.
type MsgIssue struct {
Issuer sdk.Address
Receiver sdk.Address
Issuer sdk.AccAddress
Receiver sdk.AccAddress
Coin sdk.Coin
}

Expand Down Expand Up @@ -71,7 +71,7 @@ func handleMsgIssue(keyIssue *sdk.KVStoreKey, keyAcc *sdk.KVStoreKey) sdk.Handle
}
}

func handleIssuer(store sdk.KVStore, issuer sdk.Address, coin sdk.Coin) sdk.Result {
func handleIssuer(store sdk.KVStore, issuer sdk.AccAddress, coin sdk.Coin) sdk.Result {
// the issuer address is stored directly under the coin denomination
denom := []byte(coin.Denom)
infoBytes := store.Get(denom)
Expand All @@ -95,7 +95,7 @@ func handleIssuer(store sdk.KVStore, issuer sdk.Address, coin sdk.Coin) sdk.Resu

// coinInfo stores meta data about a coin
type coinInfo struct {
Issuer sdk.Address `json:"issuer"`
Issuer sdk.AccAddress `json:"issuer"`
}
```

Expand Down
16 changes: 8 additions & 8 deletions docs/core/app3.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The `Account` interface captures this account model with getters and setters:
// Account is a standard account using a sequence number for replay protection
// and a pubkey for authentication.
type Account interface {
GetAddress() sdk.Address
SetAddress(sdk.Address) error // errors if already set.
GetAddress() sdk.AccAddress
SetAddress(sdk.AccAddress) error // errors if already set.

GetPubKey() crypto.PubKey // can return nil.
SetPubKey(crypto.PubKey) error
Expand Down Expand Up @@ -76,11 +76,11 @@ The default implementation of `Account` is the `BaseAccount`:
// Extend this by embedding this in your AppAccount.
// See the examples/basecoin/types/account.go for an example.
type BaseAccount struct {
Address sdk.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
PubKey crypto.PubKey `json:"public_key"`
AccountNumber int64 `json:"account_number"`
Sequence int64 `json:"sequence"`
Address sdk.AccAddress `json:"address"`
Coins sdk.Coins `json:"coins"`
PubKey crypto.PubKey `json:"public_key"`
AccountNumber int64 `json:"account_number"`
Sequence int64 `json:"sequence"`
}
```

Expand Down Expand Up @@ -260,7 +260,7 @@ The PubKey is required for signature verification, but it is only required in
the StdSignature once. From that point on, it will be stored in the account.

The fee is paid by the first address returned by `msg.GetSigners()` for the first `Msg`,
as provided by the `FeePayer(tx Tx) sdk.Address` function.
as provided by the `FeePayer(tx Tx) sdk.AccAddress` function.

## CoinKeeper

Expand Down

0 comments on commit 9f2f47a

Please sign in to comment.