Skip to content

Commit

Permalink
fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jleni committed Oct 2, 2020
1 parent b372d72 commit 44ca294
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
11 changes: 5 additions & 6 deletions rosetta/examples/create_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"net/http"
"strconv"
"time"
//filtypes "github.com/filecoin-project/lotus/chain/types"
)

const ServerURL = "http://localhost:8080"
Expand Down Expand Up @@ -94,7 +93,7 @@ func main() {
Metadata: mtx,
}

txBase64, err := r.ConstructPayment(pr)
txJSON, err := r.ConstructPayment(pr)
if err != nil {
panic(err)
}
Expand All @@ -104,15 +103,15 @@ func main() {
panic(err)
}

sig, err := r.SignTx(txBase64, sk)
signedTxJSON, err := r.SignTxJSON(txJSON, sk)
if err != nil {
panic(err)
}

fmt.Println(sig)
fmt.Println(signedTxJSON)
requestSubmit := &types.ConstructionSubmitRequest{
NetworkIdentifier: Network,
SignedTransaction: sig,
SignedTransaction: signedTxJSON,
}

respSubmit, err1, err2 := rosettaClient.ConstructionAPI.ConstructionSubmit(ctx, requestSubmit)
Expand All @@ -130,7 +129,7 @@ func main() {

fmt.Println(respSubmit.TransactionIdentifier.Hash)

hash, err := r.Hash(sig)
hash, err := r.Hash(signedTxJSON)
if err != nil {
panic(err)
}
Expand Down
16 changes: 8 additions & 8 deletions rosetta/tests/rosetta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ func TestSendTransaction(t *testing.T) {
Metadata: mtx,
}

txBase64, err := r.ConstructPayment(pr)
txJSON, err := r.ConstructPayment(pr)
if err != nil {
t.Fatal(err)
}
Expand All @@ -265,14 +265,14 @@ func TestSendTransaction(t *testing.T) {
t.Fatal(err)
}

sig, err := r.SignTx(txBase64, sk)
signedTxJSON, err := r.SignTxJSON(txJSON, sk)
if err != nil {
t.Fatal(err)
}

requestSubmit := &types.ConstructionSubmitRequest{
NetworkIdentifier: NetworkID,
SignedTransaction: sig,
SignedTransaction: signedTxJSON,
}

respSubmit, err1, err2 := rosettaClient.ConstructionAPI.ConstructionSubmit(ctx, requestSubmit)
Expand All @@ -288,7 +288,7 @@ func TestSendTransaction(t *testing.T) {
t.Fatal("Panicking")
}

hash, err := r.Hash(sig)
hash, err := r.Hash(signedTxJSON)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -349,7 +349,7 @@ func TestSendTransaction(t *testing.T) {
Metadata: mtx,
}

txBase64, err = r.ConstructPayment(pr)
txJSON, err = r.ConstructPayment(pr)
if err != nil {
t.Fatal(err)
}
Expand All @@ -359,14 +359,14 @@ func TestSendTransaction(t *testing.T) {
t.Fatal(err)
}

sig, err = r.SignTx(txBase64, sk)
signedTxJSON, err = r.SignTxJSON(txJSON, sk)
if err != nil {
t.Fatal(err)
}

requestSubmit = &types.ConstructionSubmitRequest{
NetworkIdentifier: NetworkID,
SignedTransaction: sig,
SignedTransaction: signedTxJSON,
}

respSubmit, err1, err2 = rosettaClient.ConstructionAPI.ConstructionSubmit(ctx, requestSubmit)
Expand All @@ -382,7 +382,7 @@ func TestSendTransaction(t *testing.T) {
t.Fatal("Panicking")
}

hash, err = r.Hash(sig)
hash, err = r.Hash(signedTxJSON)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 44ca294

Please sign in to comment.