Fix statuses
This commit is contained in:
parent
b34f37b5e7
commit
27faa31c7a
3 changed files with 6 additions and 11 deletions
|
@ -516,9 +516,8 @@ func (b *Client) parseTransactions(
|
|||
"block hash", block.Hash,
|
||||
"transaction hash", transaction.Hash,
|
||||
)
|
||||
status := SuccessStatus
|
||||
for _, op := range txOps {
|
||||
op.Status = &status
|
||||
op.Status = types.String(SkippedStatus)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -675,14 +674,13 @@ func (b *Client) parseOutputTransactionOperation(
|
|||
coinChange = nil
|
||||
}
|
||||
|
||||
status := SuccessStatus
|
||||
return &types.Operation{
|
||||
OperationIdentifier: &types.OperationIdentifier{
|
||||
Index: index,
|
||||
NetworkIndex: &networkIndex,
|
||||
},
|
||||
Type: OutputOpType,
|
||||
Status: &status,
|
||||
Status: types.String(SuccessStatus),
|
||||
Account: account,
|
||||
Amount: &types.Amount{
|
||||
Value: strconv.FormatInt(int64(amount), 10),
|
||||
|
@ -733,14 +731,13 @@ func (b *Client) parseInputTransactionOperation(
|
|||
return nil, fmt.Errorf("%w: unable to negate previous output", err)
|
||||
}
|
||||
|
||||
status := SuccessStatus
|
||||
return &types.Operation{
|
||||
OperationIdentifier: &types.OperationIdentifier{
|
||||
Index: index,
|
||||
NetworkIndex: &networkIndex,
|
||||
},
|
||||
Type: InputOpType,
|
||||
Status: &status,
|
||||
Status: types.String(SuccessStatus),
|
||||
Account: accountCoin.Account,
|
||||
Amount: &types.Amount{
|
||||
Value: newValue,
|
||||
|
@ -796,14 +793,13 @@ func (b *Client) coinbaseTxOperation(
|
|||
return nil, fmt.Errorf("%w: unable to get input metadata", err)
|
||||
}
|
||||
|
||||
status := SuccessStatus
|
||||
return &types.Operation{
|
||||
OperationIdentifier: &types.OperationIdentifier{
|
||||
Index: index,
|
||||
NetworkIndex: &networkIndex,
|
||||
},
|
||||
Type: CoinbaseOpType,
|
||||
Status: &status,
|
||||
Status: types.String(SuccessStatus),
|
||||
Metadata: metadata,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -255,7 +255,7 @@ func (i *Indexer) Sync(ctx context.Context) error {
|
|||
// If previously processed blocks exist in storage, they are fetched.
|
||||
// Otherwise, none are provided to the cache (the syncer will not attempt
|
||||
// a reorg if the cache is empty).
|
||||
pastBlocks := i.blockStorage.CreateBlockCache(ctx, int(head.Index))
|
||||
pastBlocks := i.blockStorage.CreateBlockCache(ctx, syncer.DefaultPastBlockLimit)
|
||||
|
||||
syncer := syncer.New(
|
||||
i.network,
|
||||
|
|
|
@ -487,7 +487,6 @@ func TestIndexer_Reorg(t *testing.T) {
|
|||
}
|
||||
|
||||
transactions := []*types.Transaction{}
|
||||
status := bitcoin.SuccessStatus
|
||||
for j := 0; j < 5; j++ {
|
||||
rawHash := fmt.Sprintf("block %d transaction %d", i, j)
|
||||
hash := fmt.Sprintf("%x", sha256.Sum256([]byte(rawHash)))
|
||||
|
@ -507,7 +506,7 @@ func TestIndexer_Reorg(t *testing.T) {
|
|||
Index: 0,
|
||||
NetworkIndex: &index0,
|
||||
},
|
||||
Status: &status,
|
||||
Status: types.String(bitcoin.SuccessStatus),
|
||||
Type: bitcoin.OutputOpType,
|
||||
Account: &types.AccountIdentifier{
|
||||
Address: rawHash,
|
||||
|
|
Loading…
Reference in a new issue