Skip to content

Commit

Permalink
fix: compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wei3erHase committed Aug 19, 2024
1 parent 4f1b773 commit e50d405
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions solidity/contracts/DataReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -59,19 +59,19 @@ contract DataReceiver is IDataReceiver, Governable {
// NOTE: memory to storage is not supported
// cachedObservations[_poolSalt][_poolNonce] = _observationsData;
for (uint256 _i; _i < _observationsData.length; ++_i) {
cachedObservations[_poolSalt][_poolNonce].push(_observationsData[_i]);
_cachedObservations[_poolSalt][_poolNonce].push(_observationsData[_i]);
}
emit ObservationsCached(_poolSalt, _poolNonce, msg.sender);
while (_currentNonce <= _poolNonce) {
// Try backfilling pending observations (from current to {sent|first empty} nonce)
IOracleSidechain.ObservationData[] memory _cachedObservations = cachedObservations[_poolSalt][_currentNonce];
IOracleSidechain.ObservationData[] memory _cache = _cachedObservations[_poolSalt][_currentNonce];
// If the struct is not empty, write it into the oracle
if (_cachedObservations.length > 0) {
if (_cache.length > 0) {
// Since observation nonce == oracle nonce, we can safely write the observations
_oracle.write(_cachedObservations, _currentNonce);
emit ObservationsAdded(_poolSalt, _currentNonce, _cachedObservations, msg.sender);
_oracle.write(_cache, _currentNonce);
emit ObservationsAdded(_poolSalt, _currentNonce, _cache, msg.sender);
// Clear out the written observations
delete cachedObservations[_poolSalt][_currentNonce];
delete _cachedObservations[_poolSalt][_currentNonce];
_currentNonce++;
} else {
// When an empty nonce is found, break the loop
Expand Down

0 comments on commit e50d405

Please sign in to comment.