Add solang tests, re-organize sample layouts (#2760)
* Add solang tests, re-organize sample layouts * Extra lines
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
// Copyright 2017-2020 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as delegator } from './delegator.json';
|
||||
export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
export * from './ink';
|
||||
export * from './solang';
|
||||
export * from './user';
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright 2017-2020 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as delegator } from './delegator.json';
|
||||
export { default as dns } from './dns.json';
|
||||
export { default as erc20 } from './erc20.json';
|
||||
export { default as erc721 } from './erc721.json';
|
||||
export { default as flipper } from './flipper.json';
|
||||
export { default as incrementer } from './incrementer.json';
|
||||
export { default as multisigPlain } from './multisig_plain.json';
|
||||
@@ -0,0 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/api-contract authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
export { default as ints256 } from './ints256.json';
|
||||
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"contract": {
|
||||
"authors": [
|
||||
"Sean Young <sean@mess.org>"
|
||||
],
|
||||
"description": "Test 256 bits types",
|
||||
"name": "ints256",
|
||||
"version": "0.0.1"
|
||||
},
|
||||
"metadataVersion": "0.1.0",
|
||||
"source": {
|
||||
"compiler": "solang 0.1.4",
|
||||
"hash": "0xa85fb5c61a09d71dce84c15a8bd87e6f4eafac498a1aec3869e8cf7ea4389697",
|
||||
"language": "Solidity 0.1.4"
|
||||
},
|
||||
"spec": {
|
||||
"constructors": [
|
||||
{
|
||||
"args": [],
|
||||
"docs": [
|
||||
""
|
||||
],
|
||||
"name": "new",
|
||||
"selector": "0x861731d5"
|
||||
}
|
||||
],
|
||||
"events": [],
|
||||
"messages": [
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"name": "a",
|
||||
"type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
"Multiply two 256 bit values\n\n"
|
||||
],
|
||||
"mutates": false,
|
||||
"name": "multiply",
|
||||
"payable": false,
|
||||
"return_type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
},
|
||||
"selector": "0x165c4a16"
|
||||
},
|
||||
{
|
||||
"args": [
|
||||
{
|
||||
"name": "a",
|
||||
"type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "b",
|
||||
"type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
}
|
||||
}
|
||||
],
|
||||
"docs": [
|
||||
"Add two 256 bit values\n\n"
|
||||
],
|
||||
"mutates": false,
|
||||
"name": "add",
|
||||
"payable": false,
|
||||
"return_type": {
|
||||
"display_name": [
|
||||
"u256"
|
||||
],
|
||||
"type": 1
|
||||
},
|
||||
"selector": "0x771602f7"
|
||||
}
|
||||
]
|
||||
},
|
||||
"storage": {
|
||||
"struct": {
|
||||
"fields": []
|
||||
}
|
||||
},
|
||||
"types": [
|
||||
{
|
||||
"def": {
|
||||
"primitive": "u256"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/// @title Test 256 bits types
|
||||
/// @author Sean Young <sean@mess.org>
|
||||
contract ints256 {
|
||||
/// Multiply two 256 bit values
|
||||
function multiply(uint256 a, uint256 b) public pure returns (uint256) {
|
||||
return a * b;
|
||||
}
|
||||
|
||||
/// Add two 256 bit values
|
||||
function add(uint256 a, uint256 b) public pure returns (uint256) {
|
||||
return a + b;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Reference in New Issue
Block a user