(VDB-249) Update numerical values for Vat.fold
- convert rate to ray
This commit is contained in:
parent
b922e73bf9
commit
4a5765b20d
@ -27,7 +27,7 @@ import (
|
||||
|
||||
var _ = Describe("VatFold Transformer", func() {
|
||||
It("transforms VatFold log events", func() {
|
||||
blockNumber := int64(9051149)
|
||||
blockNumber := int64(9367233)
|
||||
config := vat_fold.VatFoldConfig
|
||||
config.StartingBlockNumber = blockNumber
|
||||
config.EndingBlockNumber = blockNumber
|
||||
@ -61,6 +61,6 @@ var _ = Describe("VatFold Transformer", func() {
|
||||
dbResult := dbResults[0]
|
||||
Expect(dbResult.Ilk).To(Equal("REP"))
|
||||
Expect(dbResult.Urn).To(Equal(common.HexToAddress("0x0000000000000000000000003728e9777b2a0a611ee0f89e00e01044ce4736d1").String()))
|
||||
Expect(dbResult.Rate).To(Equal("0"))
|
||||
Expect(dbResult.Rate).To(Equal("0.000000000000000000000000000"))
|
||||
})
|
||||
})
|
||||
|
@ -47,7 +47,7 @@ var rawVatFoldLog, _ = json.Marshal(EthVatFoldLog)
|
||||
var VatFoldModel = vat_fold.VatFoldModel{
|
||||
Ilk: "REP",
|
||||
Urn: "0x3728e9777B2a0a611ee0F89e00E01044ce4736d1",
|
||||
Rate: "2",
|
||||
Rate: "0.000000000000000000000000002",
|
||||
LogIndex: EthVatFoldLog.Index,
|
||||
TransactionIndex: EthVatFoldLog.TxIndex,
|
||||
Raw: rawVatFoldLog,
|
||||
|
@ -20,6 +20,7 @@ import (
|
||||
"errors"
|
||||
"github.com/ethereum/go-ethereum/common"
|
||||
"github.com/ethereum/go-ethereum/core/types"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared"
|
||||
"github.com/vulcanize/vulcanizedb/pkg/transformers/shared/constants"
|
||||
)
|
||||
|
||||
@ -35,7 +36,7 @@ func (VatFoldConverter) ToModels(ethLogs []types.Log) ([]interface{}, error) {
|
||||
|
||||
ilk := string(bytes.Trim(ethLog.Topics[1].Bytes(), "\x00"))
|
||||
urn := common.BytesToAddress(ethLog.Topics[2].Bytes()).String()
|
||||
rate := ethLog.Topics[3].Big().String()
|
||||
rate := shared.ConvertToRay(ethLog.Topics[3].Big().String())
|
||||
raw, err := json.Marshal(ethLog)
|
||||
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user