mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
ABI and AST tests.
This commit is contained in:
parent
c5eedc9e0b
commit
467d420f7e
58
test/libsolidity/ABIJson/global_struct.sol
Normal file
58
test/libsolidity/ABIJson/global_struct.sol
Normal file
@ -0,0 +1,58 @@
|
||||
pragma experimental ABIEncoderV2;
|
||||
struct S { uint a; }
|
||||
contract C {
|
||||
function f(S calldata s) external view {}
|
||||
function g(S memory s) public view {}
|
||||
}
|
||||
// ----
|
||||
// :C
|
||||
// [
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "components":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "a",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "internalType": "struct S",
|
||||
// "name": "s",
|
||||
// "type": "tuple"
|
||||
// }
|
||||
// ],
|
||||
// "name": "g",
|
||||
// "outputs": [],
|
||||
// "payable": false,
|
||||
// "stateMutability": "view",
|
||||
// "type": "function"
|
||||
// },
|
||||
// {
|
||||
// "constant": true,
|
||||
// "inputs":
|
||||
// [
|
||||
// {
|
||||
// "components":
|
||||
// [
|
||||
// {
|
||||
// "internalType": "uint256",
|
||||
// "name": "a",
|
||||
// "type": "uint256"
|
||||
// }
|
||||
// ],
|
||||
// "internalType": "struct S",
|
||||
// "name": "s",
|
||||
// "type": "tuple"
|
||||
// }
|
||||
// ],
|
||||
// "name": "f",
|
||||
// "outputs": [],
|
||||
// "payable": false,
|
||||
// "stateMutability": "view",
|
||||
// "type": "function"
|
||||
// }
|
||||
// ]
|
32
test/libsolidity/ASTJSON/global_enum.json
Normal file
32
test/libsolidity/ASTJSON/global_enum.json
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"absolutePath" : "a",
|
||||
"exportedSymbols" :
|
||||
{
|
||||
"E" :
|
||||
[
|
||||
2
|
||||
]
|
||||
},
|
||||
"id" : 3,
|
||||
"nodeType" : "SourceUnit",
|
||||
"nodes" :
|
||||
[
|
||||
{
|
||||
"canonicalName" : "E",
|
||||
"id" : 2,
|
||||
"members" :
|
||||
[
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "A",
|
||||
"nodeType" : "EnumValue",
|
||||
"src" : "9:1:1"
|
||||
}
|
||||
],
|
||||
"name" : "E",
|
||||
"nodeType" : "EnumDefinition",
|
||||
"src" : "0:12:1"
|
||||
}
|
||||
],
|
||||
"src" : "0:13:1"
|
||||
}
|
3
test/libsolidity/ASTJSON/global_enum.sol
Normal file
3
test/libsolidity/ASTJSON/global_enum.sol
Normal file
@ -0,0 +1,3 @@
|
||||
enum E { A }
|
||||
|
||||
// ----
|
41
test/libsolidity/ASTJSON/global_enum_legacy.json
Normal file
41
test/libsolidity/ASTJSON/global_enum_legacy.json
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"absolutePath" : "a",
|
||||
"exportedSymbols" :
|
||||
{
|
||||
"E" :
|
||||
[
|
||||
2
|
||||
]
|
||||
}
|
||||
},
|
||||
"children" :
|
||||
[
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"canonicalName" : "E",
|
||||
"name" : "E"
|
||||
},
|
||||
"children" :
|
||||
[
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"name" : "A"
|
||||
},
|
||||
"id" : 1,
|
||||
"name" : "EnumValue",
|
||||
"src" : "9:1:1"
|
||||
}
|
||||
],
|
||||
"id" : 2,
|
||||
"name" : "EnumDefinition",
|
||||
"src" : "0:12:1"
|
||||
}
|
||||
],
|
||||
"id" : 3,
|
||||
"name" : "SourceUnit",
|
||||
"src" : "0:13:1"
|
||||
}
|
58
test/libsolidity/ASTJSON/global_struct.json
Normal file
58
test/libsolidity/ASTJSON/global_struct.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"absolutePath" : "a",
|
||||
"exportedSymbols" :
|
||||
{
|
||||
"S" :
|
||||
[
|
||||
3
|
||||
]
|
||||
},
|
||||
"id" : 4,
|
||||
"nodeType" : "SourceUnit",
|
||||
"nodes" :
|
||||
[
|
||||
{
|
||||
"canonicalName" : "S",
|
||||
"id" : 3,
|
||||
"members" :
|
||||
[
|
||||
{
|
||||
"constant" : false,
|
||||
"id" : 2,
|
||||
"name" : "a",
|
||||
"nodeType" : "VariableDeclaration",
|
||||
"overrides" : null,
|
||||
"scope" : 3,
|
||||
"src" : "11:9:1",
|
||||
"stateVariable" : false,
|
||||
"storageLocation" : "default",
|
||||
"typeDescriptions" :
|
||||
{
|
||||
"typeIdentifier" : "t_uint256",
|
||||
"typeString" : "uint256"
|
||||
},
|
||||
"typeName" :
|
||||
{
|
||||
"id" : 1,
|
||||
"name" : "uint256",
|
||||
"nodeType" : "ElementaryTypeName",
|
||||
"src" : "11:7:1",
|
||||
"typeDescriptions" :
|
||||
{
|
||||
"typeIdentifier" : "t_uint256",
|
||||
"typeString" : "uint256"
|
||||
}
|
||||
},
|
||||
"value" : null,
|
||||
"visibility" : "internal"
|
||||
}
|
||||
],
|
||||
"name" : "S",
|
||||
"nodeType" : "StructDefinition",
|
||||
"scope" : 4,
|
||||
"src" : "0:23:1",
|
||||
"visibility" : "public"
|
||||
}
|
||||
],
|
||||
"src" : "0:24:1"
|
||||
}
|
3
test/libsolidity/ASTJSON/global_struct.sol
Normal file
3
test/libsolidity/ASTJSON/global_struct.sol
Normal file
@ -0,0 +1,3 @@
|
||||
struct S { uint256 a; }
|
||||
|
||||
// ----
|
64
test/libsolidity/ASTJSON/global_struct_legacy.json
Normal file
64
test/libsolidity/ASTJSON/global_struct_legacy.json
Normal file
@ -0,0 +1,64 @@
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"absolutePath" : "a",
|
||||
"exportedSymbols" :
|
||||
{
|
||||
"S" :
|
||||
[
|
||||
3
|
||||
]
|
||||
}
|
||||
},
|
||||
"children" :
|
||||
[
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"canonicalName" : "S",
|
||||
"name" : "S",
|
||||
"scope" : 4,
|
||||
"visibility" : "public"
|
||||
},
|
||||
"children" :
|
||||
[
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"constant" : false,
|
||||
"name" : "a",
|
||||
"overrides" : null,
|
||||
"scope" : 3,
|
||||
"stateVariable" : false,
|
||||
"storageLocation" : "default",
|
||||
"type" : "uint256",
|
||||
"value" : null,
|
||||
"visibility" : "internal"
|
||||
},
|
||||
"children" :
|
||||
[
|
||||
{
|
||||
"attributes" :
|
||||
{
|
||||
"name" : "uint256",
|
||||
"type" : "uint256"
|
||||
},
|
||||
"id" : 1,
|
||||
"name" : "ElementaryTypeName",
|
||||
"src" : "11:7:1"
|
||||
}
|
||||
],
|
||||
"id" : 2,
|
||||
"name" : "VariableDeclaration",
|
||||
"src" : "11:9:1"
|
||||
}
|
||||
],
|
||||
"id" : 3,
|
||||
"name" : "StructDefinition",
|
||||
"src" : "0:23:1"
|
||||
}
|
||||
],
|
||||
"id" : 4,
|
||||
"name" : "SourceUnit",
|
||||
"src" : "0:24:1"
|
||||
}
|
Loading…
Reference in New Issue
Block a user