Skip to content
This repository has been archived by the owner on Sep 12, 2019. It is now read-only.

Commit

Permalink
Update github.com/stellar/go
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekn committed Feb 5, 2018
1 parent 0e8648c commit d7c16dd
Show file tree
Hide file tree
Showing 367 changed files with 31,600 additions and 2,941 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,21 @@ func (rh *RequestHandler) Builder(w http.ResponseWriter, r *http.Request) {
mutators = append(mutators, operation.Body.ToTransactionMutator())
}

tx := b.Transaction(mutators...)
tx, err := b.Transaction(mutators...)

if tx.Err != nil {
if err != nil {
log.WithFields(log.Fields{"err": err, "request": request}).Error("TransactionBuilder returned error")
server.Write(w, protocols.InternalServerError)
return
}

txe := tx.Sign(request.Signers...)
txe, err := tx.Sign(request.Signers...)
if err != nil {
log.WithFields(log.Fields{"err": err, "request": request}).Error("Error signing transaction")
server.Write(w, protocols.InternalServerError)
return
}

txeB64, err := txe.Base64()
if err != nil {
log.WithFields(log.Fields{"err": err, "request": request}).Error("Error encoding transaction envelope")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func TestRequestHandlerAuth(t *testing.T) {

attachHash := sha256.Sum256([]byte("{}"))

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -121,6 +121,7 @@ func TestRequestHandlerAuth(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)
require.NoError(t, err)

txB64, err := xdr.MarshalBase64(txBuilder.TX)
require.NoError(t, err)
Expand Down Expand Up @@ -167,7 +168,7 @@ func TestRequestHandlerAuth(t *testing.T) {
attachmentJSON, err := attachment.Marshal()
require.NoError(t, err)

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -177,6 +178,7 @@ func TestRequestHandlerAuth(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)
require.NoError(t, err)

txB64, err := xdr.MarshalBase64(txBuilder.TX)
require.NoError(t, err)
Expand Down Expand Up @@ -224,7 +226,7 @@ func TestRequestHandlerAuth(t *testing.T) {
attachmentJSON, err := attachment.Marshal()
require.NoError(t, err)

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -234,7 +236,7 @@ func TestRequestHandlerAuth(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)

require.NoError(t, err)
txB64, err := xdr.MarshalBase64(txBuilder.TX)
require.NoError(t, err)
txHash, err := txBuilder.HashHex()
Expand Down Expand Up @@ -325,7 +327,7 @@ func TestRequestHandlerAuth(t *testing.T) {
require.NoError(t, err)
attachHashB64 := base64.StdEncoding.EncodeToString(attachHash[:])

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -335,7 +337,7 @@ func TestRequestHandlerAuth(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)

require.NoError(t, err)
txB64, _ := xdr.MarshalBase64(txBuilder.TX)
txHash, _ := txBuilder.HashHex()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestRequestHandlerSend(t *testing.T) {
attachHash, err := attachment.Hash()
require.NoError(t, err)

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -168,7 +168,7 @@ func TestRequestHandlerSend(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)

require.NoError(t, err)
txB64, err := xdr.MarshalBase64(txBuilder.TX)
require.NoError(t, err)

Expand Down Expand Up @@ -275,7 +275,7 @@ func TestRequestHandlerSend(t *testing.T) {
attachHash, err := attachment.Hash()
require.NoError(t, err)

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -292,6 +292,7 @@ func TestRequestHandlerSend(t *testing.T) {
},
}),
)
require.NoError(t, err)

txB64, _ := xdr.MarshalBase64(txBuilder.TX)

Expand Down Expand Up @@ -398,7 +399,7 @@ func TestRequestHandlerSend(t *testing.T) {
attachHash, err := attachment.Hash()
require.NoError(t, err)

txBuilder := build.Transaction(
txBuilder, err := build.Transaction(
build.SourceAccount{"GAW77Z6GPWXSODJOMF5L5BMX6VMYGEJRKUNBC2CZ725JTQZORK74HQQD"},
build.Sequence{0},
build.TestNetwork,
Expand All @@ -408,7 +409,7 @@ func TestRequestHandlerSend(t *testing.T) {
build.CreditAmount{"USD", "GAMVF7G4GJC4A7JMFJWLUAEIBFQD5RT3DCB5DC5TJDEKQBBACQ4JZVEE", "20"},
),
)

require.NoError(t, err)
txB64, err := xdr.MarshalBase64(txBuilder.TX)
require.NoError(t, err)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ func (ts *TransactionSubmitter) SubmitTransaction(paymentID *string, seed string
mutators = append(mutators, memoMutator)
}

txBuilder := build.Transaction(mutators...)
txBuilder, err := build.Transaction(mutators...)

if txBuilder.Err != nil {
err = txBuilder.Err
if err != nil {
return
}

Expand Down Expand Up @@ -271,9 +270,8 @@ func BuildTransaction(accountID, networkPassphrase string, operation, memo inter
mutators = append(mutators, memoMutator)
}

txBuilder := build.Transaction(mutators...)

return txBuilder.TX, txBuilder.Err
txBuilder, err := build.Transaction(mutators...)
return txBuilder.TX, err
}

// TransactionHash returns transaction hash for a given Transaction based on the network
Expand Down
8 changes: 7 additions & 1 deletion vendor/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@
"revision": "c9d3cc542ad199f62c0264286be537f9bce6063c",
"branch": "master"
},
{
"importpath": "github.com/go-errors/errors",
"repository": "https://github.com/go-errors/errors",
"revision": "3afebba5a48dbc89b574d890b6b34d9ee10b4785",
"branch": "master"
},
{
"importpath": "github.com/go-ini/ini",
"repository": "https://github.com/go-ini/ini",
Expand Down Expand Up @@ -476,7 +482,7 @@
{
"importpath": "github.com/stellar/go",
"repository": "https://github.com/stellar/go",
"revision": "78d294bf7c2afe35e0cfef5c1e6e61aa38b1c04c",
"revision": "2dacfed8b9dc4ce7b42b606cd27857e99b03cc1e",
"branch": "master"
},
{
Expand Down
7 changes: 7 additions & 0 deletions vendor/src/github.com/go-errors/errors/LICENSE.MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright (c) 2015 Conrad Irwin <conrad@bugsnag.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
61 changes: 61 additions & 0 deletions vendor/src/github.com/go-errors/errors/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Package errors adds stacktrace support to errors in go.

This is particularly useful when you want to understand the state of execution
when an error was returned unexpectedly.

It provides the type \*Error which implements the standard golang error
interface, so you can use this library interchangably with code that is
expecting a normal error return.

Usage
=====

Full documentation is available on
[godoc](https://godoc.org/github.com/go-errors/errors), but here's a simple
example:

```go
package crashy

import "github.com/go-errors/errors"

var Crashed = errors.Errorf("oh dear")

func Crash() error {
return errors.New(Crashed)
}
```

This can be called as follows:

```go
package main

import (
"crashy"
"fmt"
"github.com/go-errors/errors"
)

func main() {
err := crashy.Crash()
if err != nil {
if errors.Is(err, crashy.Crashed) {
fmt.Println(err.(*errors.Error).ErrorStack())
} else {
panic(err)
}
}
}
```

Meta-fu
=======

This package was original written to allow reporting to
[Bugsnag](https://bugsnag.com/) from
[bugsnag-go](https://github.com/bugsnag/bugsnag-go), but after I found similar
packages by Facebook and Dropbox, it was moved to one canonical location so
everyone can benefit.

This package is licensed under the MIT license, see LICENSE.MIT for details.
89 changes: 89 additions & 0 deletions vendor/src/github.com/go-errors/errors/cover.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
mode: set
github.com/go-errors/errors/stackframe.go:27.51,30.25 2 1
github.com/go-errors/errors/stackframe.go:33.2,38.8 3 1
github.com/go-errors/errors/stackframe.go:30.25,32.3 1 0
github.com/go-errors/errors/stackframe.go:43.47,44.31 1 1
github.com/go-errors/errors/stackframe.go:47.2,47.48 1 1
github.com/go-errors/errors/stackframe.go:44.31,46.3 1 1
github.com/go-errors/errors/stackframe.go:52.42,56.16 3 1
github.com/go-errors/errors/stackframe.go:60.2,60.60 1 1
github.com/go-errors/errors/stackframe.go:56.16,58.3 1 0
github.com/go-errors/errors/stackframe.go:64.55,67.16 2 1
github.com/go-errors/errors/stackframe.go:71.2,72.61 2 1
github.com/go-errors/errors/stackframe.go:76.2,76.66 1 1
github.com/go-errors/errors/stackframe.go:67.16,69.3 1 0
github.com/go-errors/errors/stackframe.go:72.61,74.3 1 0
github.com/go-errors/errors/stackframe.go:79.56,91.63 3 1
github.com/go-errors/errors/stackframe.go:95.2,95.53 1 1
github.com/go-errors/errors/stackframe.go:100.2,101.18 2 1
github.com/go-errors/errors/stackframe.go:91.63,94.3 2 1
github.com/go-errors/errors/stackframe.go:95.53,98.3 2 1
github.com/go-errors/errors/error.go:70.32,73.23 2 1
github.com/go-errors/errors/error.go:80.2,85.3 3 1
github.com/go-errors/errors/error.go:74.2,75.10 1 1
github.com/go-errors/errors/error.go:76.2,77.28 1 1
github.com/go-errors/errors/error.go:92.43,95.23 2 1
github.com/go-errors/errors/error.go:104.2,109.3 3 1
github.com/go-errors/errors/error.go:96.2,97.11 1 1
github.com/go-errors/errors/error.go:98.2,99.10 1 1
github.com/go-errors/errors/error.go:100.2,101.28 1 1
github.com/go-errors/errors/error.go:115.39,117.19 1 1
github.com/go-errors/errors/error.go:121.2,121.29 1 1
github.com/go-errors/errors/error.go:125.2,125.43 1 1
github.com/go-errors/errors/error.go:129.2,129.14 1 1
github.com/go-errors/errors/error.go:117.19,119.3 1 1
github.com/go-errors/errors/error.go:121.29,123.3 1 1
github.com/go-errors/errors/error.go:125.43,127.3 1 1
github.com/go-errors/errors/error.go:135.53,137.2 1 1
github.com/go-errors/errors/error.go:140.34,142.2 1 1
github.com/go-errors/errors/error.go:146.34,149.42 2 1
github.com/go-errors/errors/error.go:153.2,153.20 1 1
github.com/go-errors/errors/error.go:149.42,151.3 1 1
github.com/go-errors/errors/error.go:158.39,160.2 1 1
github.com/go-errors/errors/error.go:164.46,165.23 1 1
github.com/go-errors/errors/error.go:173.2,173.19 1 1
github.com/go-errors/errors/error.go:165.23,168.32 2 1
github.com/go-errors/errors/error.go:168.32,170.4 1 1
github.com/go-errors/errors/error.go:177.37,178.42 1 1
github.com/go-errors/errors/error.go:181.2,181.41 1 1
github.com/go-errors/errors/error.go:178.42,180.3 1 1
github.com/go-errors/errors/parse_panic.go:10.39,12.2 1 1
github.com/go-errors/errors/parse_panic.go:16.46,24.34 5 1
github.com/go-errors/errors/parse_panic.go:70.2,70.43 1 1
github.com/go-errors/errors/parse_panic.go:73.2,73.55 1 0
github.com/go-errors/errors/parse_panic.go:24.34,27.23 2 1
github.com/go-errors/errors/parse_panic.go:27.23,28.42 1 1
github.com/go-errors/errors/parse_panic.go:28.42,31.5 2 1
github.com/go-errors/errors/parse_panic.go:31.6,33.5 1 0
github.com/go-errors/errors/parse_panic.go:35.5,35.29 1 1
github.com/go-errors/errors/parse_panic.go:35.29,36.86 1 1
github.com/go-errors/errors/parse_panic.go:36.86,38.5 1 1
github.com/go-errors/errors/parse_panic.go:40.5,40.32 1 1
github.com/go-errors/errors/parse_panic.go:40.32,41.18 1 1
github.com/go-errors/errors/parse_panic.go:45.4,46.46 2 1
github.com/go-errors/errors/parse_panic.go:51.4,53.23 2 1
github.com/go-errors/errors/parse_panic.go:57.4,58.18 2 1
github.com/go-errors/errors/parse_panic.go:62.4,63.17 2 1
github.com/go-errors/errors/parse_panic.go:41.18,43.10 2 1
github.com/go-errors/errors/parse_panic.go:46.46,49.5 2 1
github.com/go-errors/errors/parse_panic.go:53.23,55.5 1 0
github.com/go-errors/errors/parse_panic.go:58.18,60.5 1 0
github.com/go-errors/errors/parse_panic.go:63.17,65.10 2 1
github.com/go-errors/errors/parse_panic.go:70.43,72.3 1 1
github.com/go-errors/errors/parse_panic.go:80.85,82.29 2 1
github.com/go-errors/errors/parse_panic.go:85.2,85.15 1 1
github.com/go-errors/errors/parse_panic.go:88.2,90.63 2 1
github.com/go-errors/errors/parse_panic.go:94.2,94.53 1 1
github.com/go-errors/errors/parse_panic.go:99.2,101.36 2 1
github.com/go-errors/errors/parse_panic.go:105.2,106.15 2 1
github.com/go-errors/errors/parse_panic.go:109.2,112.49 3 1
github.com/go-errors/errors/parse_panic.go:116.2,117.16 2 1
github.com/go-errors/errors/parse_panic.go:121.2,126.8 1 1
github.com/go-errors/errors/parse_panic.go:82.29,84.3 1 0
github.com/go-errors/errors/parse_panic.go:85.15,87.3 1 1
github.com/go-errors/errors/parse_panic.go:90.63,93.3 2 1
github.com/go-errors/errors/parse_panic.go:94.53,97.3 2 1
github.com/go-errors/errors/parse_panic.go:101.36,103.3 1 0
github.com/go-errors/errors/parse_panic.go:106.15,108.3 1 0
github.com/go-errors/errors/parse_panic.go:112.49,114.3 1 1
github.com/go-errors/errors/parse_panic.go:117.16,119.3 1 0
Loading

0 comments on commit d7c16dd

Please sign in to comment.