Skip to content

Commit

Permalink
Remove depositer param from public depositTo function (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymogg authored Mar 14, 2021
1 parent fbd61e1 commit cb003be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions contracts/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ contract Account is IAccount, Ownable {
* @param amount The amount of base tokens to be deposited into the Tracer Market account
* @param market The address of the tracer market that the margin tokens will be deposited into
* @param user the user whos account the deposit is being made into
* @param depositer the address who is depositing the funds
*/
function depositTo(uint256 amount, address market, address user, address depositer) external override {
_deposit(amount, market, user, depositer);
function depositTo(uint256 amount, address market, address user) external override {
_deposit(amount, market, user, msg.sender);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion contracts/Interfaces/IAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./Types.sol";
interface IAccount {
function deposit(uint256 amount, address market) external;

function depositTo(uint256 amount, address market, address user, address depositer) external;
function depositTo(uint256 amount, address market, address user) external;

function withdraw(uint256 amount, address market) external;

Expand Down
4 changes: 2 additions & 2 deletions test-ts/functional/Insurance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe("Insurance", async () => {
await tracerBaseToken.transfer(insurance.address, web3.utils.toWei("5"))

//Deposit into insurance pool and sync holdings
await account.depositTo(web3.utils.toWei("5"), tracers[0].address, insurance.address, accounts[0])
await account.depositTo(web3.utils.toWei("5"), tracers[0].address, insurance.address)
await insurance.updatePoolAmount(tracers[0].address)

//Insurance state: margin: 10, outstandingPoolTokens: 5. (2:1)
Expand Down Expand Up @@ -145,7 +145,7 @@ describe("Insurance", async () => {
let tracerBaseToken = await TestToken.at(tracerMarginAddr)

//Sync the insurance pool with its margin holding
await account.depositTo(web3.utils.toWei("5"), tracers[0].address, insurance.address, accounts[0])
await account.depositTo(web3.utils.toWei("5"), tracers[0].address, insurance.address)
await insurance.updatePoolAmount(tracers[0].address)

//Insurance state: margin: 10, outstandingPoolTokens: 5
Expand Down

0 comments on commit cb003be

Please sign in to comment.