Skip to content

Commit eb08152

Browse files
committed
Index AddSubnetValidatorTx
1 parent de73b95 commit eb08152

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

indexer/pchain/batch_indexer.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ func (xi *txBatchIndexer) addTx(container *indexer.Container, blockType database
154154
err = xi.updateExportTx(dbTx, unsignedTx)
155155
case *txs.AdvanceTimeTx:
156156
xi.updateAdvanceTimeTx(dbTx, unsignedTx)
157+
case *txs.BaseTx:
158+
err = xi.updateGeneralBaseTx(dbTx, database.PChainBaseTx, unsignedTx)
159+
160+
// We do not save specific info for the following transaction types.
161+
// We may change this in the future if we need to index more data.
157162
case *txs.CreateChainTx:
158163
err = xi.updateGeneralBaseTx(dbTx, database.PChainCreateChainTx, &unsignedTx.BaseTx)
159164
case *txs.CreateSubnetTx:
@@ -162,10 +167,8 @@ func (xi *txBatchIndexer) addTx(container *indexer.Container, blockType database
162167
err = xi.updateGeneralBaseTx(dbTx, database.PChainRemoveSubnetValidatorTx, &unsignedTx.BaseTx)
163168
case *txs.TransformSubnetTx:
164169
err = xi.updateGeneralBaseTx(dbTx, database.PChainTransformSubnetTx, &unsignedTx.BaseTx)
165-
case *txs.BaseTx:
166-
err = xi.updateGeneralBaseTx(dbTx, database.PChainBaseTx, unsignedTx)
167-
// We leave out the following transaction types as they are rejected by Flare nodes
168-
// - AddSubnetValidatorTx
170+
case *txs.AddSubnetValidatorTx:
171+
err = xi.updateGeneralBaseTx(dbTx, database.PChainAddSubnetValidatorTx, &unsignedTx.BaseTx)
169172
default:
170173
err = fmt.Errorf("p-chain transaction %v with type %T in block %d is not indexed", dbTx.TxID, unsignedTx, height)
171174
}

0 commit comments

Comments
 (0)