Skip to content

Commit 42ae425

Browse files
committed
Bug fix
1 parent b675616 commit 42ae425

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/p_usd_tiered_sto.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,18 @@ contract("USDTieredSTO", async (accounts) => {
179179
.div(e18);
180180
if (_currencyTo == "USD") return tokenToUSD;
181181
if (_currencyTo == "ETH") {
182-
return await I_USDTieredSTO_Array[_stoID].convertFromUSD(ETH, tokenToUSD);
182+
return await I_USDTieredSTO_Array[_stoID].convertFromUSD.call(ETH, tokenToUSD);
183183
} else if (_currencyTo == "POLY") {
184-
return await I_USDTieredSTO_Array[_stoID].convertFromUSD(POLY, tokenToUSD);
184+
return await I_USDTieredSTO_Array[_stoID].convertFromUSD.call(POLY, tokenToUSD);
185185
}
186186
}
187187
if (_currencyFrom == "USD") {
188188
if (_currencyTo == "TOKEN") return _amount.div(USDTOKEN).mul(e18); // USD / USD/TOKEN = TOKEN
189189
if (_currencyTo == "ETH" || _currencyTo == "POLY")
190-
return await I_USDTieredSTO_Array[_stoID].convertFromUSD(_currencyTo == "ETH" ? ETH : POLY, _amount);
190+
return await I_USDTieredSTO_Array[_stoID].convertFromUSD.call(_currencyTo == "ETH" ? ETH : POLY, _amount);
191191
}
192192
if (_currencyFrom == "ETH" || _currencyFrom == "POLY") {
193-
let ethToUSD = await I_USDTieredSTO_Array[_stoID].convertToUSD(_currencyTo == "ETH" ? ETH : POLY, _amount);
193+
let ethToUSD = await I_USDTieredSTO_Array[_stoID].convertToUSD.call(_currencyTo == "ETH" ? ETH : POLY, _amount);
194194
if (_currencyTo == "USD") return ethToUSD;
195195
if (_currencyTo == "TOKEN") return ethToUSD.div(USDTOKEN).mul(e18); // USD / USD/TOKEN = TOKEN
196196
}
@@ -4596,7 +4596,7 @@ contract("USDTieredSTO", async (accounts) => {
45964596
it("should get the right conversion for ETH to USD", async () => {
45974597
// 20 ETH to 10000 USD
45984598
let ethInWei = new BN(web3.utils.toWei("20", "ether"));
4599-
let usdInWei = await I_USDTieredSTO_Array[0].convertToUSD(ETH, ethInWei);
4599+
let usdInWei = await I_USDTieredSTO_Array[0].convertToUSD.call(ETH, ethInWei);
46004600
assert.equal(
46014601
usdInWei.div(e18).toString(),
46024602
ethInWei
@@ -4609,7 +4609,7 @@ contract("USDTieredSTO", async (accounts) => {
46094609
it("should get the right conversion for POLY to USD", async () => {
46104610
// 40000 POLY to 10000 USD
46114611
let polyInWei = new BN(web3.utils.toWei("40000", "ether"));
4612-
let usdInWei = await I_USDTieredSTO_Array[0].convertToUSD(POLY, polyInWei);
4612+
let usdInWei = await I_USDTieredSTO_Array[0].convertToUSD.call(POLY, polyInWei);
46134613
assert.equal(
46144614
usdInWei.toString(),
46154615
polyInWei
@@ -4624,7 +4624,7 @@ contract("USDTieredSTO", async (accounts) => {
46244624
it("should get the right conversion for USD to ETH", async () => {
46254625
// 10000 USD to 20 ETH
46264626
let usdInWei = new BN(web3.utils.toWei("10000", "ether"));
4627-
let ethInWei = await I_USDTieredSTO_Array[0].convertFromUSD(ETH, usdInWei);
4627+
let ethInWei = await I_USDTieredSTO_Array[0].convertFromUSD.call(ETH, usdInWei);
46284628
assert.equal(
46294629
ethInWei.div(e18).toString(),
46304630
usdInWei
@@ -4637,7 +4637,7 @@ contract("USDTieredSTO", async (accounts) => {
46374637
it("should get the right conversion for USD to POLY", async () => {
46384638
// 10000 USD to 40000 POLY
46394639
let usdInWei = new BN(web3.utils.toWei("10000", "ether"));
4640-
let polyInWei = await I_USDTieredSTO_Array[0].convertFromUSD(POLY, usdInWei);
4640+
let polyInWei = await I_USDTieredSTO_Array[0].convertFromUSD.call(POLY, usdInWei);
46414641
assert.equal(
46424642
polyInWei.toString(),
46434643
usdInWei.mul(e18).div(USDPOLY).toString()

0 commit comments

Comments
 (0)