Skip to content

Commit

Permalink
Merge pull request #60 from OpenSTFoundation/release-1.0
Browse files Browse the repository at this point in the history
Releasing v1.0.2 to master
  • Loading branch information
sunilkhedar authored May 17, 2018
2 parents af9985b + 71742e8 commit 60c09fc
Show file tree
Hide file tree
Showing 100 changed files with 358 additions and 145,805 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ package-lock.json

# OSX
.DS_Store
/.idea
/.idea
build/
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ before_install:
- sudo apt-get install software-properties-common
- sudo add-apt-repository -y ppa:ethereum/ethereum
- sudo apt-get update
- sudo bash test/scripts/install_geth_1_7_3.sh
- sudo bash test/scripts/install_geth_1_8_3.sh
- sudo apt-get install solc
- geth version
install:
Expand All @@ -35,12 +35,13 @@ script:
- sh ost_po_init_chain.sh
- nohup sh ost_po_run_chain.sh </dev/null >/dev/null 2>&1 &
- source ost_po_vars.sh
- sleep 10
- node ./../../tools/geth_checker.js
- node ./../../tools/deploy/price_oracle.js OST USD 0x12A05F200 travis
- source ost_po_vars.sh
- node set_price.js OST USD $OST_UTILITY_SET_PRICE 0x12A05F200
- cd ../..
- mocha test/services/price_oracle/
- mocha test/services/price_oracle/ --exit
- nohup sh tools/runTestRpc.sh </dev/null >/dev/null 2>&1 &
- truffle test test/contracts/price_oracle/base.js
after_script:
Expand Down
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## ost-price-oracle v1.0.2 (17 May 2018)

Changelog:

- Solidity/solc is upgraded to 0.4.23. All contracts compile warnings are handled and contracts are upgraded with latest syntax.
- Truffle package is upgraded to 4.1.8.
- New response helper integration. Standardized error codes are now being used in OST Price Oracle.
- OpenST base web3 integration. Web socket connection to geth is now being used and preferred over RPC connection.
- OpenST base integration with logger is done.
- Loggers updated from into to debug wherever necessary. Log level support was introduced and non-important logs were moved to debug log level.

## ost-price-oracle v1.0.1 (29 March 2018)

Changelog:

- Support for web socket is added.
- Geth version updated to 1.0.0-beta.33.

## ost-price-oracle v1.0.0 (14 March 2018)

OST Price Oracle 1.0.0 is the first release of ost-price-oracle. It provides `PriceOracle` contract which accepts and exposes a price for a certain base currency in a certain quote currency.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ npm install @ostdotcom/ost-price-oracle --save
### Set Initial Setup Variables:
```bash
export OST_UTILITY_GETH_RPC_PROVIDER='http://127.0.0.1:8545'
export OST_UTILITY_GETH_WS_PROVIDER='ws://127.0.0.1:18545'
export OST_UTILITY_DEPLOYER_ADDR='0xa4ff1bb9d240921e2c4ebf2ec7e62d90714ec2d1' # An Address having balance
export OST_UTILITY_DEPLOYER_PASSPHRASE='testtest' # deployer passphrase
export OST_UTILITY_OPS_ADDR='0xbd0a2ae58648a2c39238ea4da56954502398b1cb' # An Address having balance
Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.2
32 changes: 32 additions & 0 deletions config/api_error_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"contract_address_invalid": {
"http_code": "422",
"code": "contract_address_invalid",
"message": "Contract address is invalid"
},
"base_currency_invalid": {
"http_code": "422",
"code": "base_currency_invalid",
"message": "Base currency is invalid"
},
"quote_currency_invalid": {
"http_code": "422",
"code": "quote_currency_invalid",
"message": "Quote currency is invalid"
},
"zero_price_invalid": {
"http_code": "422",
"code": "zero_price_invalid",
"message": "Zero price is invalid"
},
"price_invalid": {
"http_code": "422",
"code": "price_invalid",
"message": "Price is not a valid integer"
},
"gas_price_invalid": {
"http_code": "422",
"code": "gas_price_invalid",
"message": "Gas price is not valid"
}
}
2 changes: 2 additions & 0 deletions config/core_constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ define('OST_UTILITY_GAS_LIMIT', 4700000);

// Chain Geth Provider
define('OST_UTILITY_GETH_RPC_PROVIDER', process.env.OST_UTILITY_GETH_RPC_PROVIDER);
define('OST_UTILITY_GETH_WS_PROVIDER', process.env.OST_UTILITY_GETH_WS_PROVIDER);

// Define Price Oracles
if (process.env.OST_UTILITY_PRICE_ORACLES != undefined &&
Expand All @@ -32,3 +33,4 @@ if (process.env.OST_UTILITY_PRICE_ORACLES != undefined &&
define('OST_UTILITY_PRICE_ORACLES', JSON.parse(process.env.OST_UTILITY_PRICE_ORACLES));
}

define("DEBUG_ENABLED", process.env.OST_DEBUG_ENABLED);
6 changes: 6 additions & 0 deletions config/param_error_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Dummy": {
"parameter": "Dummy",
"message": "Dummy"
}
}
8 changes: 4 additions & 4 deletions contracts/OpsManaged.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

// Copyright 2017 OpenST Ltd.
//
Expand Down Expand Up @@ -36,7 +36,7 @@ contract OpsManaged is Owned {
event OpsAddressChanged(address indexed _newAddress);


function OpsManaged() public
constructor() public
Owned()
{
}
Expand Down Expand Up @@ -89,7 +89,7 @@ contract OpsManaged is Owned {

adminAddress = _adminAddress;

AdminAddressChanged(_adminAddress);
emit AdminAddressChanged(_adminAddress);

return true;
}
Expand All @@ -103,7 +103,7 @@ contract OpsManaged is Owned {

opsAddress = _opsAddress;

OpsAddressChanged(_opsAddress);
emit OpsAddressChanged(_opsAddress);

return true;
}
Expand Down
8 changes: 4 additions & 4 deletions contracts/Owned.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

// Copyright 2017 OpenST Ltd.
//
Expand Down Expand Up @@ -34,7 +34,7 @@ contract Owned {
event OwnershipTransferCompleted(address indexed _newOwner);


function Owned() public {
constructor() public {
owner = msg.sender;
}

Expand All @@ -53,7 +53,7 @@ contract Owned {
function initiateOwnershipTransfer(address _proposedOwner) public onlyOwner returns (bool) {
proposedOwner = _proposedOwner;

OwnershipTransferInitiated(_proposedOwner);
emit OwnershipTransferInitiated(_proposedOwner);

return true;
}
Expand All @@ -65,7 +65,7 @@ contract Owned {
owner = proposedOwner;
proposedOwner = address(0);

OwnershipTransferCompleted(owner);
emit OwnershipTransferCompleted(owner);

return true;
}
Expand Down
6 changes: 3 additions & 3 deletions contracts/PriceOracle.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* solhint-disable-next-line compiler-fixed */
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

// Copyright 2017 OST.com Ltd.
//
Expand Down Expand Up @@ -58,7 +58,7 @@ contract PriceOracle is OpsManaged, PriceOracleInterface {
/// @dev constructor function
/// @param _baseCurrency baseCurrency
/// @param _quoteCurrency quoteCurrency
function PriceOracle(
constructor(
bytes3 _baseCurrency,
bytes3 _quoteCurrency
)
Expand Down Expand Up @@ -93,7 +93,7 @@ contract PriceOracle is OpsManaged, PriceOracleInterface {
oracleExpirationHeight = block.number + priceValidityDuration();

// Event Emitted
PriceUpdated(_price, oracleExpirationHeight);
emit PriceUpdated(_price, oracleExpirationHeight);

// Return
return (oracleExpirationHeight);
Expand Down
5 changes: 2 additions & 3 deletions contracts/PriceOracleMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* solhint-disable-next-line compiler-fixed */
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

// Copyright 2017 OST.com Ltd.
//
Expand Down Expand Up @@ -33,14 +33,13 @@ contract PriceOracleMock is PriceOracle {
/// @dev Takes _baseCurrency, _quoteCurrency
/// @param _baseCurrency base currency
/// @param _quoteCurrency quote currency
function PriceOracleMock(
constructor(
bytes3 _baseCurrency,
bytes3 _quoteCurrency)
public
PriceOracle(
_baseCurrency,
_quoteCurrency)
OpsManaged()
{ }

/// @dev Returns mock PRICE_VALIDITY_DURATION
Expand Down
2 changes: 1 addition & 1 deletion contracts/openst-payments/PriceOracleInterface.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* solhint-disable-next-line compiler-fixed */
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

// Copyright 2018 OpenST Ltd.
//
Expand Down
2 changes: 1 addition & 1 deletion contracts/truffle/Migrations.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pragma solidity ^0.4.17;
pragma solidity ^0.4.23;

contract Migrations {
address public owner;
Expand Down
Loading

0 comments on commit 60c09fc

Please sign in to comment.