-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66cbf37
commit 218f22e
Showing
4 changed files
with
58 additions
and
11 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
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,24 @@ | ||
// This test uses the Tractor SDK and core Tractor code. It represents how an end user would interact with Tractor. | ||
|
||
import { ethers } from "ethers"; | ||
import { Blueprint, Requisition } from "./types"; | ||
import { createBlueprint_mow } from "./examples"; | ||
import { Tractor } from "./tractor"; | ||
import { getTestUtils } from "src/utils/TestUtils/provider"; | ||
|
||
const { sdk, account, utils } = getTestUtils(); | ||
|
||
describe("tractor mow", async () => { | ||
it("throws if tractor operate fails", async () => { | ||
let publisher: ethers.Wallet = ethers.Wallet.createRandom(); | ||
const blueprint: Blueprint = createBlueprint_mow(publisher.address); | ||
const blueprintHash: string = await Tractor.getBlueprintHash(blueprint); | ||
const requisition: Requisition = { | ||
blueprint: blueprint, | ||
blueprintHash: blueprintHash, | ||
signature: await publisher.signMessage(blueprintHash) | ||
}; | ||
|
||
await sdk.contracts.beanstalk.runBlueprint(requisition).then((txn) => txn.wait()); | ||
}); | ||
}); |
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
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