Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Apr 29, 2024
1 parent ae77bd6 commit c592eb1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go/enclave/enclave.go
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ func (e *enclaveImpl) GetCode(ctx context.Context, address gethcommon.Address, b
return nil, responses.ToInternalError(fmt.Errorf("requested GetCode with the enclave stopping"))
}

stateDB, err := e.registry.GetBatchState(ctx, batchHash, true)
stateDB, err := e.registry.GetBatchState(ctx, batchHash, false)
if err != nil {
return nil, responses.ToInternalError(fmt.Errorf("could not create stateDB. Cause: %w", err))
}
Expand Down
4 changes: 2 additions & 2 deletions go/enclave/events/subscription_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (s *SubscriptionManager) RemoveSubscription(id gethrpc.ID) {
// FilterLogsForReceipt removes the logs that the sender of a transaction is not allowed to view
func FilterLogsForReceipt(ctx context.Context, receipt *types.Receipt, account *gethcommon.Address, registry components.BatchRegistry) ([]*types.Log, error) {
var filteredLogs []*types.Log
stateDB, err := registry.GetBatchState(ctx, &receipt.BlockHash, true)
stateDB, err := registry.GetBatchState(ctx, &receipt.BlockHash, false)
if err != nil {
return nil, fmt.Errorf("could not create state DB to filter logs. Cause: %w", err)
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func (s *SubscriptionManager) GetSubscribedLogsForBatch(ctx context.Context, bat

// the stateDb is needed to extract the user addresses from the topics
h := batch.Hash()
stateDB, err := s.registry.GetBatchState(ctx, &h, true)
stateDB, err := s.registry.GetBatchState(ctx, &h, false)
if err != nil {
return nil, fmt.Errorf("could not create state DB to filter logs. Cause: %w", err)
}
Expand Down
4 changes: 2 additions & 2 deletions go/enclave/l2chain/l2_chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (oc *obscuroChain) AccountOwner(ctx context.Context, address gethcommon.Add
}

func (oc *obscuroChain) GetBalanceAtBlock(ctx context.Context, accountAddr gethcommon.Address, blockNumber *gethrpc.BlockNumber) (*hexutil.Big, error) {
chainState, err := oc.Registry.GetBatchStateAtHeight(ctx, blockNumber, true)
chainState, err := oc.Registry.GetBatchStateAtHeight(ctx, blockNumber, false)
if err != nil {
return nil, fmt.Errorf("unable to get blockchain state - %w", err)
}
Expand Down Expand Up @@ -215,7 +215,7 @@ func (oc *obscuroChain) GetChainStateAtTransaction(ctx context.Context, batch *c

// Returns whether the account is a contract
func (oc *obscuroChain) isAccountContractAtBlock(ctx context.Context, accountAddr gethcommon.Address, blockNumber *gethrpc.BlockNumber) (bool, error) {
chainState, err := oc.Registry.GetBatchStateAtHeight(ctx, blockNumber, true)
chainState, err := oc.Registry.GetBatchStateAtHeight(ctx, blockNumber, false)
if err != nil {
return false, fmt.Errorf("unable to get blockchain state - %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion go/enclave/rpc/GetTransactionCount.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func GetTransactionCountExecute(builder *CallBuilder[uint64, string], rpc *Encry
// todo - we should return an error when head state is not available, but for current test situations with race
// conditions we allow it to return zero while head state is uninitialized
h := l2Head.Hash()
s, err := rpc.registry.GetBatchState(builder.ctx, &h, true)
s, err := rpc.registry.GetBatchState(builder.ctx, &h, false)
if err != nil {
return err
}
Expand Down

0 comments on commit c592eb1

Please sign in to comment.