Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethengelman committed Aug 23, 2019
1 parent 58c23c6 commit 1b37863
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
1 change: 0 additions & 1 deletion cmd/composeAndExecute.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.


package cmd

import (
Expand Down
7 changes: 3 additions & 4 deletions pkg/datastore/postgres/repositories/address_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ package repositories

import (
"database/sql"

"github.com/ethereum/go-ethereum/common"
"github.com/jmoiron/sqlx"

"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
)

Expand Down Expand Up @@ -56,8 +58,5 @@ func (AddressRepository) GetOrCreateAddressInTransaction(tx *sqlx.Tx, address st
func (AddressRepository) GetAddressById(db *postgres.DB, id int) (string, error) {
var address string
getErr := db.Get(&address, `SELECT address FROM public.addresses WHERE id = $1`, id)
if getErr != nil {
return "", getErr
}
return address, nil
return address, getErr
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
package repositories_test

import (
"strings"

"github.com/jmoiron/sqlx"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
"github.com/vulcanize/vulcanizedb/pkg/fakes"
"github.com/vulcanize/vulcanizedb/test_config"
"strings"
)

var _ = Describe("address lookup", func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,28 @@ package repositories_test

import (
"encoding/json"
"math/big"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/vulcanize/vulcanizedb/pkg/core"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
"github.com/vulcanize/vulcanizedb/test_config"
"math/big"
)

var _ = Describe("Header Sync Receipt Repo", func() {
var (
rawHeader []byte
err error
timestamp string
db *postgres.DB
rawHeader []byte
err error
timestamp string
db *postgres.DB
receiptRepo repositories.HeaderSyncReceiptRepository
headerRepo repositories.HeaderRepository
header core.Header
headerRepo repositories.HeaderRepository
header core.Header
)

BeforeEach(func() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package repositories_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"

"github.com/vulcanize/vulcanizedb/pkg/core"
"github.com/vulcanize/vulcanizedb/pkg/datastore"
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
Expand Down Expand Up @@ -79,7 +80,8 @@ var _ = Describe("Watched Events Repository", func() {
Expect(err).ToNot(HaveOccurred())
blockId, err := blocksRepository.CreateOrUpdateBlock(core.Block{})
Expect(err).NotTo(HaveOccurred())
tx, _ := db.Beginx()
tx, txBeginErr := db.Beginx()
Expect(txBeginErr).NotTo(HaveOccurred())
receiptId, err := receiptRepository.CreateFullSyncReceiptInTx(blockId, core.Receipt{}, tx)
tx.Commit()
Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit 1b37863

Please sign in to comment.