match DB model changes in indexers
This commit is contained in:
parent
73e148f759
commit
f513ac95d7
@ -191,7 +191,6 @@ func (sdi *StateDiffIndexer) processHeader(tx *BatchTx, header *types.Header, he
|
|||||||
headerID := header.Hash().String()
|
headerID := header.Hash().String()
|
||||||
mod := models.HeaderModel{
|
mod := models.HeaderModel{
|
||||||
CID: headerNode.Cid().String(),
|
CID: headerNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(headerNode.Cid()),
|
|
||||||
ParentHash: header.ParentHash.String(),
|
ParentHash: header.ParentHash.String(),
|
||||||
BlockNumber: header.Number.String(),
|
BlockNumber: header.Number.String(),
|
||||||
BlockHash: headerID,
|
BlockHash: headerID,
|
||||||
@ -238,7 +237,6 @@ func (sdi *StateDiffIndexer) processUncles(tx *BatchTx, headerID string, blockNu
|
|||||||
BlockNumber: blockNumber.String(),
|
BlockNumber: blockNumber.String(),
|
||||||
HeaderID: headerID,
|
HeaderID: headerID,
|
||||||
CID: unclesCID.String(),
|
CID: unclesCID.String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(unclesCID),
|
|
||||||
ParentHash: uncle.ParentHash.String(),
|
ParentHash: uncle.ParentHash.String(),
|
||||||
BlockHash: uncle.Hash().String(),
|
BlockHash: uncle.Hash().String(),
|
||||||
Reward: uncleReward.String(),
|
Reward: uncleReward.String(),
|
||||||
@ -299,9 +297,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
Src: shared.HandleZeroAddr(from),
|
Src: shared.HandleZeroAddr(from),
|
||||||
TxHash: trxID,
|
TxHash: trxID,
|
||||||
Index: int64(i),
|
Index: int64(i),
|
||||||
Data: trx.Data(),
|
|
||||||
CID: txNode.Cid().String(),
|
CID: txNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(txNode.Cid()),
|
|
||||||
Type: trx.Type(),
|
Type: trx.Type(),
|
||||||
Value: val,
|
Value: val,
|
||||||
}
|
}
|
||||||
@ -346,8 +342,6 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
Contract: contract,
|
Contract: contract,
|
||||||
ContractHash: contractHash,
|
ContractHash: contractHash,
|
||||||
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.rctLeafNodeCIDs[i]),
|
|
||||||
LogRoot: args.rctNodes[i].LogRoot.String(),
|
|
||||||
}
|
}
|
||||||
if len(receipt.PostState) == 0 {
|
if len(receipt.PostState) == 0 {
|
||||||
rctModel.PostStatus = receipt.Status
|
rctModel.PostStatus = receipt.Status
|
||||||
@ -376,9 +370,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
ReceiptID: trxID,
|
ReceiptID: trxID,
|
||||||
Address: l.Address.String(),
|
Address: l.Address.String(),
|
||||||
Index: int64(l.Index),
|
Index: int64(l.Index),
|
||||||
Data: l.Data,
|
|
||||||
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.logLeafNodeCIDs[i][idx]),
|
|
||||||
Topic0: topicSet[0],
|
Topic0: topicSet[0],
|
||||||
Topic1: topicSet[1],
|
Topic1: topicSet[1],
|
||||||
Topic2: topicSet[2],
|
Topic2: topicSet[2],
|
||||||
@ -417,11 +409,10 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStateCID,
|
CID: shared.RemovedNodeStateCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stateCIDStr, stateMhKey, err := tx.cacheRaw(ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
stateCIDStr, _, err := tx.cacheRaw(ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
||||||
}
|
}
|
||||||
@ -431,8 +422,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: stateCIDStr,
|
CID: stateCIDStr,
|
||||||
MhKey: stateMhKey,
|
Removed: false,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,8 +470,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStorageCID,
|
CID: shared.RemovedNodeStorageCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
if _, err := fmt.Fprintf(sdi.dump, "%+v\r\n", storageModel); err != nil {
|
if _, err := fmt.Fprintf(sdi.dump, "%+v\r\n", storageModel); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -499,8 +488,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: storageCIDStr,
|
CID: storageCIDStr,
|
||||||
MhKey: storageMhKey,
|
Removed: false,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
if _, err := fmt.Fprintf(sdi.dump, "%+v\r\n", storageModel); err != nil {
|
if _, err := fmt.Fprintf(sdi.dump, "%+v\r\n", storageModel); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -247,9 +247,8 @@ func (sdi *StateDiffIndexer) processHeader(header *types.Header, headerNode node
|
|||||||
}
|
}
|
||||||
headerID := header.Hash().String()
|
headerID := header.Hash().String()
|
||||||
sdi.fileWriter.upsertHeaderCID(models.HeaderModel{
|
sdi.fileWriter.upsertHeaderCID(models.HeaderModel{
|
||||||
NodeID: sdi.nodeID,
|
NodeIDs: []string{sdi.nodeID},
|
||||||
CID: headerNode.Cid().String(),
|
CID: headerNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(headerNode.Cid()),
|
|
||||||
ParentHash: header.ParentHash.String(),
|
ParentHash: header.ParentHash.String(),
|
||||||
BlockNumber: header.Number.String(),
|
BlockNumber: header.Number.String(),
|
||||||
BlockHash: headerID,
|
BlockHash: headerID,
|
||||||
@ -295,7 +294,6 @@ func (sdi *StateDiffIndexer) processUncles(headerID string, blockNumber *big.Int
|
|||||||
BlockNumber: blockNumber.String(),
|
BlockNumber: blockNumber.String(),
|
||||||
HeaderID: headerID,
|
HeaderID: headerID,
|
||||||
CID: unclesCID.String(),
|
CID: unclesCID.String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(unclesCID),
|
|
||||||
ParentHash: uncle.ParentHash.String(),
|
ParentHash: uncle.ParentHash.String(),
|
||||||
BlockHash: uncle.Hash().String(),
|
BlockHash: uncle.Hash().String(),
|
||||||
Reward: uncleReward.String(),
|
Reward: uncleReward.String(),
|
||||||
@ -352,9 +350,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(args processArgs) error {
|
|||||||
Src: shared.HandleZeroAddr(from),
|
Src: shared.HandleZeroAddr(from),
|
||||||
TxHash: txID,
|
TxHash: txID,
|
||||||
Index: int64(i),
|
Index: int64(i),
|
||||||
Data: trx.Data(),
|
|
||||||
CID: txNode.Cid().String(),
|
CID: txNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(txNode.Cid()),
|
|
||||||
Type: trx.Type(),
|
Type: trx.Type(),
|
||||||
Value: val,
|
Value: val,
|
||||||
}
|
}
|
||||||
@ -395,8 +391,6 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(args processArgs) error {
|
|||||||
Contract: contract,
|
Contract: contract,
|
||||||
ContractHash: contractHash,
|
ContractHash: contractHash,
|
||||||
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.rctLeafNodeCIDs[i]),
|
|
||||||
LogRoot: args.rctNodes[i].LogRoot.String(),
|
|
||||||
}
|
}
|
||||||
if len(receipt.PostState) == 0 {
|
if len(receipt.PostState) == 0 {
|
||||||
rctModel.PostStatus = receipt.Status
|
rctModel.PostStatus = receipt.Status
|
||||||
@ -423,9 +417,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(args processArgs) error {
|
|||||||
ReceiptID: txID,
|
ReceiptID: txID,
|
||||||
Address: l.Address.String(),
|
Address: l.Address.String(),
|
||||||
Index: int64(l.Index),
|
Index: int64(l.Index),
|
||||||
Data: l.Data,
|
|
||||||
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.logLeafNodeCIDs[i][idx]),
|
|
||||||
Topic0: topicSet[0],
|
Topic0: topicSet[0],
|
||||||
Topic1: topicSet[1],
|
Topic1: topicSet[1],
|
||||||
Topic2: topicSet[2],
|
Topic2: topicSet[2],
|
||||||
@ -463,11 +455,10 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStateCID,
|
CID: shared.RemovedNodeStateCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stateCIDStr, stateMhKey, err := sdi.fileWriter.upsertIPLDRaw(tx.BlockNumber, ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
stateCIDStr, _, err := sdi.fileWriter.upsertIPLDRaw(tx.BlockNumber, ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
||||||
}
|
}
|
||||||
@ -477,8 +468,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: stateCIDStr,
|
CID: stateCIDStr,
|
||||||
MhKey: stateMhKey,
|
Removed: false,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -524,13 +514,12 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStorageCID,
|
CID: shared.RemovedNodeStorageCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
sdi.fileWriter.upsertStorageCID(storageModel)
|
sdi.fileWriter.upsertStorageCID(storageModel)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
storageCIDStr, storageMhKey, err := sdi.fileWriter.upsertIPLDRaw(tx.BlockNumber, ipld2.MEthStorageTrie, multihash.KECCAK_256, storageNode.NodeValue)
|
storageCIDStr, _, err := sdi.fileWriter.upsertIPLDRaw(tx.BlockNumber, ipld2.MEthStorageTrie, multihash.KECCAK_256, storageNode.NodeValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating and cacheing storage node IPLD: %v", err)
|
return fmt.Errorf("error generating and cacheing storage node IPLD: %v", err)
|
||||||
}
|
}
|
||||||
@ -541,8 +530,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: storageCIDStr,
|
CID: storageCIDStr,
|
||||||
MhKey: storageMhKey,
|
Removed: false,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
sdi.fileWriter.upsertStorageCID(storageModel)
|
sdi.fileWriter.upsertStorageCID(storageModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -249,7 +249,6 @@ func (sdi *StateDiffIndexer) processHeader(tx *BatchTx, header *types.Header, he
|
|||||||
// index header
|
// index header
|
||||||
return headerID, sdi.dbWriter.upsertHeaderCID(tx.dbtx, models.HeaderModel{
|
return headerID, sdi.dbWriter.upsertHeaderCID(tx.dbtx, models.HeaderModel{
|
||||||
CID: headerNode.Cid().String(),
|
CID: headerNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(headerNode.Cid()),
|
|
||||||
ParentHash: header.ParentHash.String(),
|
ParentHash: header.ParentHash.String(),
|
||||||
BlockNumber: header.Number.String(),
|
BlockNumber: header.Number.String(),
|
||||||
BlockHash: headerID,
|
BlockHash: headerID,
|
||||||
@ -294,7 +293,6 @@ func (sdi *StateDiffIndexer) processUncles(tx *BatchTx, headerID string, blockNu
|
|||||||
BlockNumber: blockNumber.String(),
|
BlockNumber: blockNumber.String(),
|
||||||
HeaderID: headerID,
|
HeaderID: headerID,
|
||||||
CID: unclesCID.String(),
|
CID: unclesCID.String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(unclesCID),
|
|
||||||
ParentHash: uncle.ParentHash.String(),
|
ParentHash: uncle.ParentHash.String(),
|
||||||
BlockHash: uncle.Hash().String(),
|
BlockHash: uncle.Hash().String(),
|
||||||
Reward: uncleReward.String(),
|
Reward: uncleReward.String(),
|
||||||
@ -354,9 +352,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
Src: shared.HandleZeroAddr(from),
|
Src: shared.HandleZeroAddr(from),
|
||||||
TxHash: txID,
|
TxHash: txID,
|
||||||
Index: int64(i),
|
Index: int64(i),
|
||||||
Data: trx.Data(),
|
|
||||||
CID: txNode.Cid().String(),
|
CID: txNode.Cid().String(),
|
||||||
MhKey: shared.MultihashKeyFromCID(txNode.Cid()),
|
|
||||||
Type: trx.Type(),
|
Type: trx.Type(),
|
||||||
Value: val,
|
Value: val,
|
||||||
}
|
}
|
||||||
@ -401,8 +397,6 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
Contract: contract,
|
Contract: contract,
|
||||||
ContractHash: contractHash,
|
ContractHash: contractHash,
|
||||||
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
LeafCID: args.rctLeafNodeCIDs[i].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.rctLeafNodeCIDs[i]),
|
|
||||||
LogRoot: args.rctNodes[i].LogRoot.String(),
|
|
||||||
}
|
}
|
||||||
if len(receipt.PostState) == 0 {
|
if len(receipt.PostState) == 0 {
|
||||||
rctModel.PostStatus = receipt.Status
|
rctModel.PostStatus = receipt.Status
|
||||||
@ -432,9 +426,7 @@ func (sdi *StateDiffIndexer) processReceiptsAndTxs(tx *BatchTx, args processArgs
|
|||||||
ReceiptID: txID,
|
ReceiptID: txID,
|
||||||
Address: l.Address.String(),
|
Address: l.Address.String(),
|
||||||
Index: int64(l.Index),
|
Index: int64(l.Index),
|
||||||
Data: l.Data,
|
|
||||||
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
LeafCID: args.logLeafNodeCIDs[i][idx].String(),
|
||||||
LeafMhKey: shared.MultihashKeyFromCID(args.logLeafNodeCIDs[i][idx]),
|
|
||||||
Topic0: topicSet[0],
|
Topic0: topicSet[0],
|
||||||
Topic1: topicSet[1],
|
Topic1: topicSet[1],
|
||||||
Topic2: topicSet[2],
|
Topic2: topicSet[2],
|
||||||
@ -472,11 +464,10 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStateCID,
|
CID: shared.RemovedNodeStateCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
stateCIDStr, stateMhKey, err := tx.cacheRaw(ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
stateCIDStr, _, err := tx.cacheRaw(ipld2.MEthStateTrie, multihash.KECCAK_256, stateNode.NodeValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
return fmt.Errorf("error generating and cacheing state node IPLD: %v", err)
|
||||||
}
|
}
|
||||||
@ -486,8 +477,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: stateNode.Path,
|
Path: stateNode.Path,
|
||||||
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
StateKey: common.BytesToHash(stateNode.LeafKey).String(),
|
||||||
CID: stateCIDStr,
|
CID: stateCIDStr,
|
||||||
MhKey: stateMhKey,
|
Removed: false,
|
||||||
NodeType: stateNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -534,15 +524,14 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: shared.RemovedNodeStorageCID,
|
CID: shared.RemovedNodeStorageCID,
|
||||||
MhKey: shared.RemovedNodeMhKey,
|
Removed: true,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
if err := sdi.dbWriter.upsertStorageCID(tx.dbtx, storageModel); err != nil {
|
if err := sdi.dbWriter.upsertStorageCID(tx.dbtx, storageModel); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
storageCIDStr, storageMhKey, err := tx.cacheRaw(ipld2.MEthStorageTrie, multihash.KECCAK_256, storageNode.NodeValue)
|
storageCIDStr, _, err := tx.cacheRaw(ipld2.MEthStorageTrie, multihash.KECCAK_256, storageNode.NodeValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error generating and cacheing storage node IPLD: %v", err)
|
return fmt.Errorf("error generating and cacheing storage node IPLD: %v", err)
|
||||||
}
|
}
|
||||||
@ -553,8 +542,7 @@ func (sdi *StateDiffIndexer) PushStateNode(batch interfaces.Batch, stateNode sdt
|
|||||||
Path: storageNode.Path,
|
Path: storageNode.Path,
|
||||||
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
StorageKey: common.BytesToHash(storageNode.LeafKey).String(),
|
||||||
CID: storageCIDStr,
|
CID: storageCIDStr,
|
||||||
MhKey: storageMhKey,
|
Removed: true,
|
||||||
NodeType: storageNode.NodeType.Int(),
|
|
||||||
}
|
}
|
||||||
if err := sdi.dbWriter.upsertStorageCID(tx.dbtx, storageModel); err != nil {
|
if err := sdi.dbWriter.upsertStorageCID(tx.dbtx, storageModel); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user