-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] Add integration test for sales and purchasing
- Loading branch information
1 parent
a87986c
commit d6393de
Showing
2 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import dagger/contracts | ||
import dagger/contracts/testtoken | ||
|
||
proc mint*(signer: Signer, amount = 1_000_000.u256) {.async.} = | ||
## Mints a considerable amount of tokens and approves them for transfer to | ||
## the Storage contract. | ||
let token = TestToken.new(!deployment().address(TestToken), signer) | ||
let storage = Storage.new(!deployment().address(Storage), signer) | ||
await token.mint(await signer.getAddress(), amount) | ||
await token.approve(storage.address, amount) | ||
|
||
proc deposit*(signer: Signer) {.async.} = | ||
## Deposits sufficient collateral into the Storage contract. | ||
let storage = Storage.new(!deployment().address(Storage), signer) | ||
await storage.deposit(await storage.collateralAmount()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters