-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 'from' in 'eth_call' #375
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -32,7 +32,7 @@ import {Utils} from '../helpers/utils'; | |
|
||
describe('ERC20 Acceptance Tests', async function () { | ||
this.timeout(240 * 1000); // 240 seconds | ||
const {servicesNode, relay, logger} = global; | ||
const {servicesNode, relay} = global; | ||
|
||
// cached entities | ||
const accounts: AliasAccount[] = []; | ||
|
@@ -175,7 +175,8 @@ describe('ERC20 Acceptance Tests', async function () { | |
if (testTitles[i].testName !== HTS) { | ||
describe('when the spender has enough allowance', function () { | ||
before(async function () { | ||
await contract.connect(tokenOwnerWallet).approve(spender, initialSupply); | ||
const tx = await contract.connect(tokenOwnerWallet).approve(spender, initialSupply); | ||
await tx.wait(); | ||
}); | ||
|
||
describe('when the token owner has enough balance', function () { | ||
|
@@ -190,6 +191,7 @@ describe('ERC20 Acceptance Tests', async function () { | |
|
||
it('transfers the requested amount', async function () { | ||
tx = await contract.connect(spenderWallet).transferFrom(tokenOwner, to, initialSupply); | ||
await tx.wait(); | ||
const ownerBalance = await contract.balanceOf(tokenOwner); | ||
const toBalance = await contract.balanceOf(to); | ||
expect(ownerBalance.toString()).to.be.equal('0'); | ||
|
@@ -336,7 +338,7 @@ describe('ERC20 Acceptance Tests', async function () { | |
const receipt = await relay.provider.getTransactionReceipt(contract.deployTransaction.hash); | ||
contract = new ethers.Contract(receipt.to, contractJson.abi, accounts[0].wallet); | ||
return contract; | ||
}; | ||
} | ||
|
||
const createHTS = async(tokenName, symbol, adminAccount, initialSupply, abi, associatedAccounts) => { | ||
const htsResult = await servicesNode.createHTS({ | ||
|
@@ -356,8 +358,6 @@ describe('ERC20 Acceptance Tests', async function () { | |
// Setup initial balance of token owner account | ||
await servicesNode.transferHTSToken(accounts[0].accountId, htsResult.receipt.tokenId, initialSupply, htsResult.client); | ||
const evmAddress = Utils.idToEvmAddress(htsResult.receipt.tokenId.toString()); | ||
const contract = new ethers.Contract(evmAddress, abi, accounts[0].wallet); | ||
|
||
return contract; | ||
return new ethers.Contract(evmAddress, abi, accounts[0].wallet); | ||
}; | ||
}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: new line since you're here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For completeness of coverage this methods should be checking that the result is expected.
Given the return above i think the expected result would be
0x0
or0x
.Should make this change for the 4 tests added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done