-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from Aniket-Engg/userdefinedtype
Userdefinedtype tested
- Loading branch information
Showing
9 changed files
with
109 additions
and
13 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
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,5 @@ | ||
pragma solidity ^0.5.1; | ||
|
||
interface Itest { | ||
function set(uint) external; | ||
} |
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,13 @@ | ||
pragma solidity >=0.4.0 <0.7.0; | ||
|
||
contract Sample2 { | ||
uint public n; | ||
|
||
function set(uint _n) public returns (uint) { | ||
n = _n; | ||
} | ||
|
||
function get() public view returns (uint) { | ||
return n; | ||
} | ||
} |
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,12 @@ | ||
pragma solidity ^0.5.1; | ||
|
||
import "./Itest.sol"; | ||
|
||
contract SampleWithUserDefinedType { | ||
|
||
uint age; | ||
constructor (Itest it, uint _age) public{ | ||
Itest iaddr = it; | ||
age = _age; | ||
} | ||
} |
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,14 @@ | ||
pragma solidity ^0.5.1; | ||
|
||
interface Itest { | ||
function set(uint) external; | ||
} | ||
|
||
contract SampleWithUserDefinedType { | ||
|
||
uint age; | ||
constructor (Itest it, uint _age) public{ | ||
Itest iaddr = it; | ||
age = _age; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,9 @@ | ||
'use strict'; | ||
|
||
module.exports = async (contract) => { | ||
module.exports = (contract) => { | ||
for (const node of contract.subNodes) { | ||
if (node.type == 'FunctionDefinition' && node.name === '' && node.stateMutability === 'payable') { | ||
if (node.type == 'FunctionDefinition' && node.name === '' && node.stateMutability === 'payable') | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; |