-
I'm testing this function: function Deposit(uint256 StopLoss) public payable {//Deposita quantity i es registre
//Pay subscription
if (msg.value == 0){
revert Quantity_zero();
}
//Add wallet to the s_Wallets
s_Wallets.push(payable(msg.sender));
//Start subscription time
Dades storage dades = s_Registre[msg.sender];
dades.Quantity += msg.value;
dades.Stop = StopLoss;
} When sending value and StopLoss argument it allways send me some error. describe("Subscription", async function () {//PriceConversion
it("Subscribes the deployer", async function () {
await MarketOrder.Deposit(1850, {value: ethers.utils.parseEther("5")})
const Quantity = await MarketOrder.CallQuantity()
console.log(`Q: ${Quantity}`)
const Stop = await MarketOrder.CallStop()
console.log(`S: ${Stop}`)
assert.equal(Quantity.toString(), 1850)
assert.equal(Stop.toString(), 5)
}
}) This is the error.
Does anyone know how to send argument + value properly?? I have tryed many codes but not working. |
Beta Was this translation helpful? Give feedback.
Answered by
obc92
Aug 17, 2022
Replies: 1 comment
-
Solved it, had a problem with the next function arguments. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
obc92
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Solved it, had a problem with the next function arguments.