Skip to content

Commit

Permalink
examples: added docs to ethers v6 test
Browse files Browse the repository at this point in the history
  • Loading branch information
CedarMist committed Feb 19, 2024
1 parent 45c32fc commit e3f7086
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/ethersv6-ts-esm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ async function testTheContract(contract:BaseContract, signerAddr?:string)
assert( addr === ZeroAddress );
}

// Verifies that calling a function which does require(false,"ThisIsAnError")
// Will return the correct error message in the exception to Ethers
try {
await contract.getFunction("testViewRevert()").staticCall();
assert(false);
Expand All @@ -25,6 +27,8 @@ async function testTheContract(contract:BaseContract, signerAddr?:string)
assert(e.reason == 'ThisIsAnError');
}

// Verifies that calling a function which does revert CustomError(someInteger)
// Will return the correctly encoded custom error type to Ethers
try {
await contract.getFunction("testCustomRevert()").staticCall();
assert(false);
Expand Down

0 comments on commit e3f7086

Please sign in to comment.