Skip to content

Commit

Permalink
fix: migrations and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guidiaz committed Aug 5, 2024
1 parent 54d9f7a commit 7a70235
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 308 deletions.
2 changes: 0 additions & 2 deletions contracts/core/trustable/WitOracleTrustableBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ abstract contract WitOracleTrustableBase

_require(address(registry).code.length > 0, "inexistent registry");
_require(registry.specs() == type(WitOracleRadonRegistry).interfaceId, "uncompliant registry");
_require(address(factory).code.length > 0, "inexistent factory");
_require(address(factory.witOracle()) == address(this), "discordant factory");

// Set reporters, if any
__setReporters(_newReporters);
Expand Down
4 changes: 2 additions & 2 deletions contracts/core/trustless/WitOracleRadonRegistryDefault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ contract WitOracleRadonRegistryDefault
// --- Implementation of 'IWitOracleRadonRegistry' -----------------------------------------------------------------------

function bytecodeOf(bytes32 _radHash)
public view
override
public view override
radonRequestExists(_radHash)
returns (bytes memory)
{
return __database().radsBytecode[_radHash];
Expand Down
2 changes: 1 addition & 1 deletion migrations/scripts/3_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = async function (_, network, [, from]) {
libs: specs.WitOracleRequestFactory.libs,
immutables: specs.WitOracleRequestFactory.immutables,
intrinsics: {
types: ["address", "address", "bool", "bytes32"],
types: ["address", "bool", "bytes32"],
values: [
/* _witOracle */ await determineProxyAddr(from, specs.WitOracle?.vanity || 3),
/* _upgradable */ true,
Expand Down
2 changes: 1 addition & 1 deletion migrations/scripts/4_proxies.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ module.exports = async function (_, network, [, from, reporter]) {

const singletons = [
"WitOracleRadonRegistry",
"WitOracleRequestFactory",
"WitOracle",
"WitOracleRequestFactory",
"WitPriceFeeds",
]

Expand Down
4 changes: 2 additions & 2 deletions test/TestWitOracleRadonEncodingLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ contract TestWitOracleRadonEncodingLib {
Witnet.RadonRetrieval memory source;
source.method = Witnet.RadonRetrievalMethods.HttpGet;
source.url = "https://data.messar.io/api/v1/assets/\\0\\/metrics/market-data?fields=market_data/price_\\1\\";
source.script = hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b";
source.radonScript = hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b";
bytes memory bytecode = WitOracleRadonEncodingLib.encode(source);
// emit Log(bytecode);
Assert.equal(
Expand All @@ -106,7 +106,7 @@ contract TestWitOracleRadonEncodingLib {
source.headers = new string[2][](2);
source.headers[0] = [ "user-agent", "witnet-rust" ];
source.headers[1] = [ "content-type", "text/html; charset=utf-8" ];
source.script = hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b";
source.radonScript = hex"861877821866646461746182186664706f6f6c8218646b746f6b656e3150726963658218571a000f4240185b";
bytes memory bytecode = WitOracleRadonEncodingLib.encode(source);
// emit Log(bytecode);
Assert.equal(
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/mocks/WitMockedRandomness.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
º// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: MIT

pragma solidity >=0.7.0 <0.9.0;
pragma experimental ABIEncoderV2;
Expand Down
Loading

0 comments on commit 7a70235

Please sign in to comment.