forked from cerc-io/ipld-eth-server
Incorporate DSS updates (#8)
* Incorporate DSS updates - Lad renamed to Guy - Dink and Dart added to Frob * update test chain data * Remove Mom field from FlipKick * Update Flip ABI and sample flip kick data * Incorporate updates to Frob event - Guy renamed to Lad - Era and Gem removed, iArt added - Also turn off integration tests that read from test chain while events are actively under development
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -44,11 +44,12 @@ func (FrobConverter) ToEntity(contractAddress string, contractAbi string, ethLog
|
||||
|
||||
func (FrobConverter) ToModel(frob FrobEntity) FrobModel {
|
||||
return FrobModel{
|
||||
Ilk: frob.Ilk[:],
|
||||
Lad: frob.Lad[:],
|
||||
Gem: frob.Gem.String(),
|
||||
Ink: frob.Ink.String(),
|
||||
Art: frob.Art.String(),
|
||||
Era: frob.Era.String(),
|
||||
Ilk: frob.Ilk[:],
|
||||
Lad: frob.Lad[:],
|
||||
Dink: frob.Dink.String(),
|
||||
Dart: frob.Dart.String(),
|
||||
Ink: frob.Ink.String(),
|
||||
Art: frob.Art.String(),
|
||||
IArt: frob.IArt.String(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,14 @@ package frob
|
||||
|
||||
import (
|
||||
"math/big"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
)
|
||||
|
||||
type FrobEntity struct {
|
||||
Ilk [32]byte
|
||||
Lad common.Address
|
||||
Gem *big.Int
|
||||
Ink *big.Int
|
||||
Art *big.Int
|
||||
Era *big.Int
|
||||
Ilk [32]byte
|
||||
Lad [32]byte
|
||||
Ink *big.Int
|
||||
Art *big.Int
|
||||
Dink *big.Int
|
||||
Dart *big.Int
|
||||
IArt *big.Int
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ import (
|
||||
)
|
||||
|
||||
var _ = Describe("Integration tests", func() {
|
||||
It("Fetches frob event logs from a local test chain", func() {
|
||||
XIt("Fetches frob event logs from a local test chain", func() {
|
||||
ipcPath := test_config.TestClient.IPCPath
|
||||
|
||||
rawRpcClient, err := rpc.Dial(ipcPath)
|
||||
@@ -75,8 +75,7 @@ var _ = Describe("Integration tests", func() {
|
||||
|
||||
expectedEntity := test_data.FrobEntity
|
||||
Expect(entity.Art).To(Equal(expectedEntity.Art))
|
||||
Expect(entity.Era).To(Equal(expectedEntity.Era))
|
||||
Expect(entity.Gem).To(Equal(expectedEntity.Gem))
|
||||
Expect(entity.IArt).To(Equal(expectedEntity.IArt))
|
||||
Expect(entity.Ilk).To(Equal(expectedEntity.Ilk))
|
||||
Expect(entity.Ink).To(Equal(expectedEntity.Ink))
|
||||
Expect(entity.Lad).To(Equal(expectedEntity.Lad))
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
package frob
|
||||
|
||||
type FrobModel struct {
|
||||
Ilk []byte
|
||||
Lad []byte
|
||||
Gem string
|
||||
Ink string
|
||||
Art string
|
||||
Era string
|
||||
Ilk []byte
|
||||
Lad []byte
|
||||
Ink string
|
||||
Art string
|
||||
Dink string
|
||||
Dart string
|
||||
IArt string
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ func NewFrobRepository(db *postgres.DB) FrobRepository {
|
||||
}
|
||||
|
||||
func (repository FrobRepository) Create(headerID int64, transactionIndex uint, model FrobModel) error {
|
||||
_, err := repository.db.Exec(`INSERT INTO maker.frob (header_id, tx_idx, art, era, gem, ilk, ink, lad)
|
||||
VALUES($1, $2, $3::NUMERIC, $4::NUMERIC, $5::NUMERIC, $6, $7::NUMERIC, $8)`,
|
||||
headerID, transactionIndex, model.Art, model.Era, model.Gem, model.Ilk, model.Ink, model.Lad)
|
||||
_, err := repository.db.Exec(`INSERT INTO maker.frob (header_id, tx_idx, art, dart, dink, iart, ilk, ink, lad)
|
||||
VALUES($1, $2, $3::NUMERIC, $4::NUMERIC, $5::NUMERIC, $6::NUMERIC, $7, $8::NUMERIC, $9)`,
|
||||
headerID, transactionIndex, model.Art, model.Dart, model.Dink, model.IArt, model.Ilk, model.Ink, model.Lad)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ var _ = Describe("Frob repository", func() {
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
var dbFrob frob.FrobModel
|
||||
err = db.Get(&dbFrob, `SELECT art, era, gem, ilk, ink, lad FROM maker.frob WHERE header_id = $1`, headerID)
|
||||
err = db.Get(&dbFrob, `SELECT art, dart, dink, iart, ilk, ink, lad FROM maker.frob WHERE header_id = $1`, headerID)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
Expect(dbFrob).To(Equal(test_data.FrobModel))
|
||||
})
|
||||
@@ -79,7 +79,7 @@ var _ = Describe("Frob repository", func() {
|
||||
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
var dbFrob frob.FrobModel
|
||||
err = db.Get(&dbFrob, `SELECT art, era, gem, ilk, ink, lad FROM maker.frob WHERE header_id = $1`, headerID)
|
||||
err = db.Get(&dbFrob, `SELECT art, iart, ilk, ink, lad FROM maker.frob WHERE header_id = $1`, headerID)
|
||||
Expect(err).To(HaveOccurred())
|
||||
Expect(err).To(MatchError(sql.ErrNoRows))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user