This repository has been archived by the owner on Aug 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- file event on the pit contract is overloaded and each implementation logs a note - existing Pit file transformer now specified as dealing with ilks
- Loading branch information
Showing
31 changed files
with
858 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DROP TABLE maker.pit_file; | ||
DROP TABLE maker.pit_file_ilk; | ||
DROP TABLE maker.pit_file_stability_fee; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
CREATE TABLE maker.pit_file ( | ||
CREATE TABLE maker.pit_file_ilk ( | ||
id SERIAL PRIMARY KEY, | ||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, | ||
ilk TEXT, | ||
what TEXT, | ||
risk NUMERIC, | ||
data NUMERIC, | ||
tx_idx INTEGER NOT NUll, | ||
raw_log JSONB, | ||
UNIQUE (header_id, tx_idx) | ||
); | ||
); | ||
|
||
CREATE TABLE maker.pit_file_stability_fee ( | ||
id SERIAL PRIMARY KEY, | ||
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE, | ||
what TEXT, | ||
data TEXT, | ||
tx_idx INTEGER NOT NULL, | ||
raw_log JSONB, | ||
UNIQUE (header_id, tx_idx) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
pkg/transformers/pit_file/debt_ceiling/debt_ceiling_suite_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package debt_ceiling_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func TestDebtCeiling(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "DebtCeiling Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package ilk_test | ||
|
||
import ( | ||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
"github.com/vulcanize/vulcanizedb/pkg/transformers/pit_file/ilk" | ||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared" | ||
"github.com/vulcanize/vulcanizedb/pkg/transformers/test_data" | ||
) | ||
|
||
var _ = Describe("Pit file ilk converter", func() { | ||
It("converts a log to an model", func() { | ||
converter := ilk.PitFileIlkConverter{} | ||
|
||
model, err := converter.ToModel(test_data.PitAddress, shared.PitABI, test_data.EthPitFileIlkLog) | ||
|
||
Expect(err).NotTo(HaveOccurred()) | ||
Expect(model).To(Equal(test_data.PitFileIlkModel)) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
pkg/transformers/pit_file/model.go → pkg/transformers/pit_file/ilk/model.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package pit_file | ||
package ilk | ||
|
||
type PitFileModel struct { | ||
type PitFileIlkModel struct { | ||
Ilk string | ||
What string | ||
Risk string | ||
Data string | ||
TransactionIndex uint `db:"tx_idx"` | ||
Raw []byte `db:"raw_log"` | ||
} |
20 changes: 10 additions & 10 deletions
20
pkg/transformers/pit_file/repository.go → pkg/transformers/pit_file/ilk/repository.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.