* Updated ABI definitions & parsing * Run type generation * Definitions (should be ok-ish) * Cleanup names * Allow aliasses on structs (JSON parsing) * Cleanup json mapping passing * s/types/lookup/ * Parsing as per current output * InkSelector * MtRegistryIndex * String lookup tests * Remove serd ovverride comments (it works as-is) * inkRegistry tests * Extract primitive types * s/ty/id/ * Start of parsing into types (actually to be TypeDef) * Parsing * stringify struct fields * Small cleanups * Add type index to project lookup * Prefix with index * Fix interface generation * Latest contract metadata (#2118) * Add new (provisional) incrementer contract metadata * Update and regenerate type definitions * WIP: generate new format scale-info types * WIP: implementing variants * Implement variants * Fix up type resolution * Fix registry spec tests * Fix lints and some tests * Fix inkTypes tests * Fix some lints * Make imports same line like original * Comment out (temporarily) sanitize import to make CI pass * Sanitize * Remove indices * Remove index * Adjust ContractAbi interface (empty rpc) * linting * Pull in Andrew's changes * Cleanups * Some more cleanups * Update with v3 contracts * Adjust with actual types * Regenerate * Update ABI parsing (#2695) * Adjust ABI code * Cleanup * Merge non-code * Type naming * Simplify Base * Rename 1 * rename 2 * Rename 3 * Simplify * Add index to AbiMessage * Pass actual message or index for call * Rename param * Simplify * Expose call & exec * s/call/read/ * Cleanup asserts * AccountId as per spec * displayName is path * Update definitions * Flatten ABIType into TypeDef * Rewrite * Fix tests * Updates Co-authored-by: Andrew Jones <ascjones@gmail.com>
252 lines
5.0 KiB
JSON
252 lines
5.0 KiB
JSON
{
|
|
"metadataVersion": "0.1.0",
|
|
"source": {
|
|
"hash": "0x87175ad8e56de12e8bac275483adb1990a61c8b8caca9ddc18f1d5ad3b5dc976",
|
|
"language": "ink! 3.0.0",
|
|
"compiler": "rustc 1.48.0-nightly"
|
|
},
|
|
"contract": {
|
|
"name": "delegator",
|
|
"version": "3.0.0",
|
|
"authors": [
|
|
"Parity Technologies <admin@parity.io>"
|
|
]
|
|
},
|
|
"spec": {
|
|
"constructors": [
|
|
{
|
|
"args": [
|
|
{
|
|
"name": "init_value",
|
|
"type": {
|
|
"displayName": [
|
|
"i32"
|
|
],
|
|
"id": 4
|
|
}
|
|
},
|
|
{
|
|
"name": "accumulator_code_hash",
|
|
"type": {
|
|
"displayName": [
|
|
"Hash"
|
|
],
|
|
"id": 5
|
|
}
|
|
},
|
|
{
|
|
"name": "adder_code_hash",
|
|
"type": {
|
|
"displayName": [
|
|
"Hash"
|
|
],
|
|
"id": 5
|
|
}
|
|
},
|
|
{
|
|
"name": "subber_code_hash",
|
|
"type": {
|
|
"displayName": [
|
|
"Hash"
|
|
],
|
|
"id": 5
|
|
}
|
|
}
|
|
],
|
|
"docs": [
|
|
" Instantiate a delegator with the given sub-contract codes."
|
|
],
|
|
"name": [
|
|
"new"
|
|
],
|
|
"selector": "0xd183512b"
|
|
}
|
|
],
|
|
"docs": [],
|
|
"events": [],
|
|
"messages": [
|
|
{
|
|
"args": [],
|
|
"docs": [
|
|
" Returns the accumulator's value."
|
|
],
|
|
"mutates": false,
|
|
"name": [
|
|
"get"
|
|
],
|
|
"payable": false,
|
|
"returnType": {
|
|
"displayName": [
|
|
"i32"
|
|
],
|
|
"id": 4
|
|
},
|
|
"selector": "0x1e5ca456"
|
|
},
|
|
{
|
|
"args": [
|
|
{
|
|
"name": "by",
|
|
"type": {
|
|
"displayName": [
|
|
"i32"
|
|
],
|
|
"id": 4
|
|
}
|
|
}
|
|
],
|
|
"docs": [
|
|
" Delegates the call to either `Adder` or `Subber`."
|
|
],
|
|
"mutates": true,
|
|
"name": [
|
|
"change"
|
|
],
|
|
"payable": false,
|
|
"returnType": null,
|
|
"selector": "0x0af938f2"
|
|
},
|
|
{
|
|
"args": [],
|
|
"docs": [
|
|
" Switches the delegator."
|
|
],
|
|
"mutates": true,
|
|
"name": [
|
|
"switch"
|
|
],
|
|
"payable": false,
|
|
"returnType": null,
|
|
"selector": "0x5d37c38d"
|
|
}
|
|
]
|
|
},
|
|
"storage": {
|
|
"struct": {
|
|
"fields": [
|
|
{
|
|
"layout": {
|
|
"enum": {
|
|
"dispatch_key": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
"variants": {
|
|
"0": {
|
|
"fields": []
|
|
},
|
|
"1": {
|
|
"fields": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"name": "which"
|
|
},
|
|
{
|
|
"layout": {
|
|
"struct": {
|
|
"fields": [
|
|
{
|
|
"layout": {
|
|
"cell": {
|
|
"key": "0x0100000000000000000000000000000000000000000000000000000000000000",
|
|
"ty": 1
|
|
}
|
|
},
|
|
"name": "account_id"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "accumulator"
|
|
},
|
|
{
|
|
"layout": {
|
|
"struct": {
|
|
"fields": [
|
|
{
|
|
"layout": {
|
|
"cell": {
|
|
"key": "0x0200000000000000000000000000000000000000000000000000000000000000",
|
|
"ty": 1
|
|
}
|
|
},
|
|
"name": "account_id"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "adder"
|
|
},
|
|
{
|
|
"layout": {
|
|
"struct": {
|
|
"fields": [
|
|
{
|
|
"layout": {
|
|
"cell": {
|
|
"key": "0x0300000000000000000000000000000000000000000000000000000000000000",
|
|
"ty": 1
|
|
}
|
|
},
|
|
"name": "account_id"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"name": "subber"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"types": [
|
|
{
|
|
"def": {
|
|
"composite": {
|
|
"fields": [
|
|
{
|
|
"type": 2
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"path": [
|
|
"ink_env",
|
|
"types",
|
|
"AccountId"
|
|
]
|
|
},
|
|
{
|
|
"def": {
|
|
"array": {
|
|
"len": 32,
|
|
"type": 3
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"def": {
|
|
"primitive": "u8"
|
|
}
|
|
},
|
|
{
|
|
"def": {
|
|
"primitive": "i32"
|
|
}
|
|
},
|
|
{
|
|
"def": {
|
|
"composite": {
|
|
"fields": [
|
|
{
|
|
"type": 2
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"path": [
|
|
"ink_env",
|
|
"types",
|
|
"Hash"
|
|
]
|
|
}
|
|
]
|
|
} |