Skip to content

Commit

Permalink
fix: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyRo1 committed Nov 4, 2024
1 parent 599a3ed commit 969d705
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion solidity/src/Hyperlane.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ contract Hyperlane is IHyperlane {
index += 1;
require(hyMsg.version == VERSION, "unsupported version");


// Parse Signatures
uint256 signersLen = encodedHyMsg.toUint8(index);
index += 1;
Expand Down
3 changes: 2 additions & 1 deletion solidity/src/PragmaDecoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ abstract contract PragmaDecoder {
/// @return publishTime The timestamp of the feed data.
function extractDataInfoFromUpdate(bytes calldata updateData, uint256 offset, bytes32 checkpointRoot)
internal
pure
returns (uint256 endOffset, ParsedData memory parsedData, bytes32 feedId, uint64 publishTime)
{
unchecked {
Expand Down Expand Up @@ -208,7 +209,7 @@ abstract contract PragmaDecoder {
// Extract header metadata
offset = extractMetadataFromheader(updateData, offset);
// Extract merkle root and number of updates from update data.

bytes32 checkpointRoot;

(offset, checkpointRoot, numUpdates) = extractCheckpointRootAndNumUpdates(updateData, offset);
Expand Down
7 changes: 3 additions & 4 deletions solidity/test/PragmaDecoder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ contract PragmaHarnessTest is Test {
hex"0100000130030100c1ec5070f1a4868b8e6bfa5bbd31ac77605c5af1a739bc4e7758d4ca1d88fa8835c1460646b647c4c4403b324c2297a04d70b84888dc873021f80d6d70ed015e1c00031b8b00611a3d0060240f2bccef7e64f920eec05c5bfffbc48c6ceaa4efca8748772b60cbafc30536953cdd0dd5b8e24428e4fb6eab5c143daba15f62b24606e50d822508faefd53032e26a3b1d1510dfe82a2ab8d6c0fc0f010dcdd3c410ba2f9fdad3479b1400031b8b15704e0efd1955cfe1c1182ba083bd5309707bdd795397cbbbb106cfc9b29bb00100010000000000000000000000000000000000000000000000000000004254432f5553440000000067225b110008080000000000000000000000000000000000000000000000000000068aa5cb9d630000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004254432f5553440000000067225b11";
uint8 numUpdates = pragmaHarness.exposed_updateDataInfoFromUpdate(encodedUpdate);
assertEq(numUpdates, 1, "Number of updates should be 1");
bytes32 feedId= bytes32(0x000000000000000000000000000000000000000000000000004254432f555344);
bytes32 feedId = bytes32(0x000000000000000000000000000000000000000000000000004254432f555344);
SpotMedian memory spotMedian = pragmaHarness.exposed_spotMedianFeeds(feedId);
assertEq(spotMedian.metadata.timestamp,uint64(0x67225b11), "Timestamp should match");
assertEq(spotMedian.metadata.timestamp, uint64(0x67225b11), "Timestamp should match");
assertEq(spotMedian.metadata.numberOfSources, 8, "Number of sources should be 8");
assertEq(spotMedian.metadata.decimals, 8, "Decimals should be 8");
assertEq(spotMedian.metadata.feedId, feedId, "Feed ID should match");
assertEq(spotMedian.price, 0x68aa5cb9d63, "Price should match");
assertEq(spotMedian.volume, 0, "Volume should match");

}

function testUpdateDataInfoFromUpdateSpotMedian() public {
Expand Down Expand Up @@ -195,7 +194,7 @@ contract PragmaUpgradeableTest is Test {
user = address(0x1);
}

function testInitialState() public {
function testInitialState() public view {
assertEq(pragma_.owner(), owner);
assertEq(pragma_.validTimePeriodSeconds(), 120);
assertEq(pragma_.singleUpdateFeeInWei(), 0.1 ether);
Expand Down
1 change: 0 additions & 1 deletion solidity/test/mocks/PragmaUpgraded.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ contract PragmaUpgraded is Initializable, UUPSUpgradeable, OwnableUpgradeable, I
) public initializer {
__Ownable_init(initial_owner);
__UUPSUpgradeable_init();
// __PragmaDecoder_init(_hyperlane, _dataSourceEmitterChainIds, _dataSourceEmitterAddresses);
__Pragma_init(_validTimePeriodSeconds, _singleUpdateFeeInWei);
}

Expand Down
4 changes: 2 additions & 2 deletions solidity/test/utils/HyperlaneTestUtils.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract contract HyperlaneTestUtils is Test {
bytes32 messageId,
bytes memory payload,
uint8 numSigners
) public view returns (bytes memory updateData) {
) public pure returns (bytes memory updateData) {
bytes32[5] memory r = [
bytes32(0x83db08d4e1590714aef8600f5f1e3c967ab6a3b9f93bb4242de0306510e688ea),
bytes32(0xf81a5dd3f871ad2d27a3b538e73663d723f8263fb3d289514346d43d000175f5),
Expand Down Expand Up @@ -95,7 +95,7 @@ contract HyperlaneTestUtilsTest is Test, HyperlaneTestUtils {
string memory reason,
bytes memory updateData,
IHyperlane hyperlane
) private view {
) private pure {
assertTrue(valid);
assertEq(reason, "");
assertEq(hyMsg.nonce, TEST_NONCE, "Nonce does not correspond");
Expand Down
2 changes: 2 additions & 0 deletions solidity/test/utils/TestConstants.sol
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pragma solidity ^0.8.0;

/// @title Constants
/// @author Pragma Labs
/// @custom:contact security@pragma.build
Expand Down

0 comments on commit 969d705

Please sign in to comment.