Skip to content

Commit

Permalink
changelog for txnbuild 1.1 (#1231)
Browse files Browse the repository at this point in the history
* horizonclient/txnbuild README fixes (#1210)

* fix client links in top-level readme

* update clients README

* mark old client deprecated in godoc short summary

* fix code of conduct, standardise example

* fix code of conduct/contributing links

* txnbuild: enables multiple signatures (#1198)

This PR enables multiple signatures on a transaction in the new Go SDK. It also lets every `Operation` type have a different source account than its `Transaction`. These changes are intertwined. Without multiple signatures, every operation in a transaction must share the transaction's source account. Differing source accounts are the most common use case for multiple signatures, and they also test it with greatest completeness.

* root repo changelog links to sub-projects (#1214)

* keystore: add update-keys endpoints to spec (#1215)

We need an endpoint to update the encrypted seed when users forget their
passwords.

* move keystore to exp to fix build (#1223)

* Add minimal files to fix build (#1225)

* changelog for txnbuild 1.1
  • Loading branch information
ire-and-curses authored May 2, 2019
1 parent 2bf2dcd commit 593f5ab
Show file tree
Hide file tree
Showing 32 changed files with 691 additions and 162 deletions.
49 changes: 21 additions & 28 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
# Changelog

All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

As this project is pre 1.0, breaking changes may happen for minor version
bumps. A breaking change will get clearly notified in this log.

NOTE: this changelog represents the changes that are associated with the library code in this repo (rather than the tools or services in this repo).

## [Unreleased]

### Added

- xdr: added support for new signer types
- build: `Signer` learned support for new signer types
- strkey: added support for new signer types
- network: Added the `HashTransaction` helper func to get the hash of a transaction targeted to a specific stellar network.
- trades: Added Server-Sent Events endpoint to support streaming of trades
- trades: add `base_offer_id` and `counter_offer_id` to trade resources.
- trade aggregation: Added an optional `offset` parameter that lets you offset the bucket timestamps in hour-long increments. Can only be used if the `resolution` parameter is greater than 1 hour. `offset` must also be in whole-hours and less than 24 hours.


### Changed:

- build: _BREAKING CHANGE_: A transaction built and signed using the `build` package no longer default to the test network.
- trades for offer endpoint will query for trades that match the given offer on either side of trades, rather than just the "sell" offer.

[Unreleased]: https://github.com/stellar/go/commits/master
This repository adheres to [Semantic Versioning](http://semver.org/).

This monorepo contains a number of projects, individually versioned and released. Please consult the relevant changelog:

* `horizon server` ([changelog](./services/horizon/CHANGELOG.md))
* `horizonclient` ([changelog](./clients/horizonclient/CHANGELOG.md))
* `txnbuild` ([changelog](./txnbuild/CHANGELOG.md))
* `bridge` ([changelog](./services/bridge/CHANGELOG.md))
* `compliance` ([changelog](./services/compliance/CHANGELOG.md))
* `federation` ([changelog](./services/federation/CHANGELOG.md))
* `bifrost` ([changelog](./services/bifrost/CHANGELOG.md))
* `ticker` (experimental) ([changelog](./exp/ticker/CHANGELOG.md))
* `stellar-vanity-gen` ([changelog](./tools/stellar-vanity-gen/CHANGELOG.md))
* `stellar-sign` ([changelog](./tools/stellar-sign/CHANGELOG.md))
* `stellar-archivist` ([changelog](./tools/stellar-archivist/CHANGELOG.md))
* `stellar-hd-wallet` ([changelog](./tools/stellar-hd-wallet/CHANGELOG.md))

If a project is pre-v1.0, breaking changes may happen for minor version
bumps. A breaking change will be clearly notified in the corresponding changelog.

Official project releases may be found here: https://github.com/stellar/go/releases
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ This repo is the home for all of the public go code produced by SDF. In additio
## Package Index

* [Horizon Server](services/horizon): Full-featured API server for Stellar network
* [Go Clients (Horizon SDK)](clients): Go SDK for making requests to Horizon Server
* [Go Horizon SDK - horizonclient](clients/horizonclient): Client for Horizon server (queries and transaction submission)
* [Go Horizon SDK - txnbuild](txnbuild): Construct Stellar transactions and operations
* [Bifrost](services/bifrost): Bitcoin/Ethereum -> Stellar bridge
* Servers for Anchors & Financial Institutions
* [Bridge Server](services/bridge): send payments and take action when payments are received
Expand Down
13 changes: 9 additions & 4 deletions clients/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Clients package

Packages contained by this package provide client libraries for accessing the ecosystem of stellar services. At present, it only contains a simple horizon client library, but in the future it will contain clients to interact with stellar-core, federation, the bridge server and more.
Packages here provide client libraries for accessing the ecosystem of Stellar services.

See [godoc](https://godoc.org/github.com/stellar/go/clients) for details about each package.
* `horizonclient` - programmatic client access to Horizon (use in conjunction with [txnbuild](../txnbuild))
* `stellartoml` - parse Stellar.toml files from the internet
* `federation` - resolve federation addresses into stellar account IDs, suitable for use within a transaction
* `horizon` (DEPRECATED) - the original Horizon client, now superceded by `horizonclient`

## Adding new client packages
See [GoDoc](https://godoc.org/github.com/stellar/go/clients) for more details.

## For developers: Adding new client packages

Ideally, each one of our client packages will have commonalities in their API to ease the cost of learning each. It's recommended that we follow a pattern similar to the `net/http` package's client shape:

A type, `Client`, is the central type of any client package, and its methods should provide the bulk of the functionality for the package. A `DefaultClient` var is provided for consumers that don't need client-level customization of behavior. Each method on the `Client` type should have a corresponding func at the package level that proxies a call through to the default client. For example, `http.Get()` is the equivalent of `http.DefaultClient.Get()`.
A type, `Client`, is the central type of any client package, and its methods should provide the bulk of the functionality for the package. A `DefaultClient` var is provided for consumers that don't need client-level customization of behavior. Each method on the `Client` type should have a corresponding func at the package level that proxies a call through to the default client. For example, `http.Get()` is the equivalent of `http.DefaultClient.Get()`.
7 changes: 2 additions & 5 deletions clients/horizon/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// Package horizon provides client access to a horizon server, allowing an
// application to post transactions and lookup ledger information.
// Package horizon is DEPRECATED in favour of clients/horizonclient! It used to provide client access to a horizon
// server, allowing an application to post transactions and lookup ledger information.
//
// Create an instance of `Client` to customize the server used, or alternatively
// use `DefaultTestNetClient` or `DefaultPublicNetClient` to access the SDF run
// horizon servers.
// Deprecated: clients/horizon package with all its exported methods and variables will no longer be
// maintained. It will be removed in future versions of the SDK.
// Use clients/horizonclient (https://godoc.org/github.com/stellar/go/clients/horizonclient) instead.
Expand Down
14 changes: 8 additions & 6 deletions clients/horizonclient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,30 @@ This library is aimed at developers building Go applications that interact with
import hClient "github.com/stellar/go/clients/horizonclient"
...

// use the default pubnet client
// Use the default pubnet client
client := hClient.DefaultPublicNetClient
// create an account request

// Create an account request
accountRequest := hClient.AccountRequest{AccountID: "GCLWGQPMKXQSPF776IU33AH4PZNOOWNAWGGKVTBQMIC5IMKUNP3E6NVU"}

// load the account detail from the network
// Load the account detail from the network
account, err := client.AccountDetail(accountRequest)
if err != nil {
fmt.Println(err)
return
}
// account contains information about the stellar account
// Account contains information about the stellar account
fmt.Print(account)

```
For more examples, refer to the [documentation](https://godoc.org/github.com/stellar/go/clients/horizonclient).

## Running the tests
Run the unit tests from the package directory: `go test`

## Contributing
Please read [CONTRIBUTING](../../CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Please read [Code of Conduct](https://github.com/stellar/.github/blob/master/CODE_OF_CONDUCT.md) to understand this project's communication rules.

To submit improvements and fixes to this library, please see [CONTRIBUTING](../CONTRIBUTING.md).

## License
This project is licensed under the Apache License - see the [LICENSE](../../LICENSE-APACHE.txt) file for details.
33 changes: 31 additions & 2 deletions services/keystore/spec.md → exp/services/keystore/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ interface EncryptedKeyData {
Store Keys Request:

```typescript
interface StoreKeyRequest {
interface StoreKeysRequest {
encryptedKeys: EncryptedKey[];
}
```

Store Keys Response:

```typescript
interface StoreKeyResponse {
interface StoreKeysResponse {
encryptedKeys: EncryptedKeyData[];
}
```
Expand Down Expand Up @@ -144,6 +144,35 @@ TBD
```
</details>

### /update-keys

Update Keys Request:

```typescript
interface UpdateKeysRequest {
encryptedKeys: EncryptedKey[];
}
```

Update Keys Response:

```typescript
interface UpdateKeysResponse {
encryptedKeys: EncryptedKeyData[];
}
```
<details><summary>Errors</summary>

TBD
```json
{
"code": "some error code",
"message": "some error message",
"retriable": false,
}
```
</details>

### /remove-key

Remove Key Request:
Expand Down
3 changes: 3 additions & 0 deletions tools/horizon-cmp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2019-04-25

Initial version
6 changes: 6 additions & 0 deletions tools/horizon-cmp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Horizon cmp

Tool that compares the responses of two Horizon servers and shows the diffs.
Useful for checking for regressions.

TODO: add more info
3 changes: 3 additions & 0 deletions tools/horizon-verify/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 2019-04-25

Initial version
9 changes: 9 additions & 0 deletions tools/horizon-verify/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Horizon verify

Tool that checks some invariants about Horizon responses:

- successful response codes when getting transactions from ledgers
- successful transaction counts are correct
- failed transaction counts are correct

TODO: add more info
12 changes: 12 additions & 0 deletions txnbuild/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this
file. This project adheres to [Semantic Versioning](http://semver.org/).

## [v1.1.0](https://github.com/stellar/go/releases/tag/horizonclient-v1.1.0) - 2019-02-02

* Support for multiple signatures ([#1198](https://github.com/stellar/go/pull/1198))

## [v1.0.0](https://github.com/stellar/go/releases/tag/horizonclient-v1.0) - 2019-04-26

* Initial release
6 changes: 4 additions & 2 deletions txnbuild/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This project is maintained by the Stellar Development Foundation.

```
```golang
import (
"log"

Expand Down Expand Up @@ -79,7 +79,9 @@ To see the SDK in action, build and run the demo:


## Contributing
Please read [CONTRIBUTING](../../CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
Please read [Code of Conduct](https://github.com/stellar/.github/blob/master/CODE_OF_CONDUCT.md) to understand this project's communication rules.

To submit improvements and fixes to this library, please see [CONTRIBUTING](../CONTRIBUTING.md).

## License
This project is licensed under the Apache License - see the [LICENSE](../../LICENSE-APACHE.txt) file for details.
11 changes: 8 additions & 3 deletions txnbuild/account_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
// AccountMerge represents the Stellar merge account operation. See
// https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type AccountMerge struct {
Destination string
Destination string
SourceAccount Account
}

// BuildXDR for AccountMerge returns a fully configured XDR Operation.
Expand All @@ -22,6 +23,10 @@ func (am *AccountMerge) BuildXDR() (xdr.Operation, error) {

opType := xdr.OperationTypeAccountMerge
body, err := xdr.NewOperationBody(opType, xdrOp)

return xdr.Operation{Body: body}, errors.Wrap(err, "failed to build XDR OperationBody")
if err != nil {
return xdr.Operation{}, errors.Wrap(err, "failed to build XDR OperationBody")
}
op := xdr.Operation{Body: body}
SetOpSourceAccount(&op, am.SourceAccount)
return op, nil
}
15 changes: 10 additions & 5 deletions txnbuild/allow_trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
// AllowTrust represents the Stellar allow trust operation. See
// https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type AllowTrust struct {
Trustor string
Type Asset
Authorize bool
Trustor string
Type Asset
Authorize bool
SourceAccount Account
}

// BuildXDR for AllowTrust returns a fully configured XDR Operation.
Expand Down Expand Up @@ -44,6 +45,10 @@ func (at *AllowTrust) BuildXDR() (xdr.Operation, error) {

opType := xdr.OperationTypeAllowTrust
body, err := xdr.NewOperationBody(opType, xdrOp)

return xdr.Operation{Body: body}, errors.Wrap(err, "failed to build XDR OperationBody")
if err != nil {
return xdr.Operation{}, errors.Wrap(err, "failed to build XDR OperationBody")
}
op := xdr.Operation{Body: body}
SetOpSourceAccount(&op, at.SourceAccount)
return op, nil
}
11 changes: 8 additions & 3 deletions txnbuild/bump_sequence.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import (
// BumpSequence represents the Stellar bump sequence operation. See
// https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type BumpSequence struct {
BumpTo int64
BumpTo int64
SourceAccount Account
}

// BuildXDR for BumpSequence returns a fully configured XDR Operation.
func (bs *BumpSequence) BuildXDR() (xdr.Operation, error) {
opType := xdr.OperationTypeBumpSequence
xdrOp := xdr.BumpSequenceOp{BumpTo: xdr.SequenceNumber(bs.BumpTo)}
body, err := xdr.NewOperationBody(opType, xdrOp)

return xdr.Operation{Body: body}, errors.Wrap(err, "failed to build XDR OperationBody")
if err != nil {
return xdr.Operation{}, errors.Wrap(err, "failed to build XDR OperationBody")
}
op := xdr.Operation{Body: body}
SetOpSourceAccount(&op, bs.SourceAccount)
return op, nil
}
13 changes: 9 additions & 4 deletions txnbuild/change_trust.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
// ChangeTrust represents the Stellar change trust operation. See
// https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type ChangeTrust struct {
Line Asset
Limit string
Line Asset
Limit string
SourceAccount Account
}

// RemoveTrustlineOp returns a ChangeTrust operation to remove the trustline of the described asset,
Expand Down Expand Up @@ -43,6 +44,10 @@ func (ct *ChangeTrust) BuildXDR() (xdr.Operation, error) {
Limit: xdrLimit,
}
body, err := xdr.NewOperationBody(opType, xdrOp)

return xdr.Operation{Body: body}, errors.Wrap(err, "failed to build XDR OperationBody")
if err != nil {
return xdr.Operation{}, errors.Wrap(err, "failed to build XDR OperationBody")
}
op := xdr.Operation{Body: body}
SetOpSourceAccount(&op, ct.SourceAccount)
return xdr.Operation{Body: body}, nil
}
5 changes: 4 additions & 1 deletion txnbuild/cmd/demo/operations/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ func deleteTrustline(source *hProtocol.Account, asset txnbuild.Asset, signer Acc
}

func deleteOffer(source *hProtocol.Account, offerID int64, signer Account) (string, error) {
deleteOffer := txnbuild.DeleteOfferOp(offerID)
deleteOffer, err := txnbuild.DeleteOfferOp(offerID)
if err != nil {
return "", errors.Wrap(err, "building offer")
}

tx := txnbuild.Transaction{
SourceAccount: source,
Expand Down
13 changes: 9 additions & 4 deletions txnbuild/create_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
// CreateAccount represents the Stellar create account operation. See
// https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type CreateAccount struct {
Destination string
Amount string
Destination string
Amount string
SourceAccount Account
}

// BuildXDR for CreateAccount returns a fully configured XDR Operation.
Expand All @@ -29,6 +30,10 @@ func (ca *CreateAccount) BuildXDR() (xdr.Operation, error) {

opType := xdr.OperationTypeCreateAccount
body, err := xdr.NewOperationBody(opType, xdrOp)

return xdr.Operation{Body: body}, errors.Wrap(err, "failed to build XDR OperationBody")
if err != nil {
return xdr.Operation{}, errors.Wrap(err, "failed to build XDR OperationBody")
}
op := xdr.Operation{Body: body}
SetOpSourceAccount(&op, ca.SourceAccount)
return op, nil
}
Loading

0 comments on commit 593f5ab

Please sign in to comment.