-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Reinis Martinsons <[email protected]>
- Loading branch information
1 parent
0e585b1
commit c6d2a02
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: AGPL-3.0-only | ||
pragma solidity 0.8.17; | ||
|
||
import {IPyth} from "oev-contracts/interfaces/pyth/IPyth.sol"; | ||
|
||
contract PythSourceMock is IPyth { | ||
int64 public price; | ||
uint64 public conf; | ||
int32 public expo; | ||
uint256 public publishTime; | ||
|
||
function setLatestPrice(int64 _price, uint64 _conf, int32 _expo, uint256 _publishTime) public { | ||
price = _price; | ||
conf = _conf; | ||
expo = _expo; | ||
publishTime = _publishTime; | ||
} | ||
|
||
function getPrice(bytes32 id) external view returns (IPyth.Price memory) { | ||
return getPriceUnsafe(id); | ||
} | ||
|
||
function getPriceUnsafe(bytes32 id) public view returns (IPyth.Price memory) { | ||
return IPyth.Price({price: price, conf: conf, expo: expo, publishTime: publishTime}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters