Skip to content
This repository has been archived by the owner on Apr 8, 2022. It is now read-only.

Commit

Permalink
tests: Implement functional tests for programmable pools
Browse files Browse the repository at this point in the history
Implement functional tests for PP and create assets directory
which contains all smart contract related files
  • Loading branch information
altonen committed Nov 18, 2021
1 parent c1a4b94 commit 661f654
Show file tree
Hide file tree
Showing 7 changed files with 502 additions and 96 deletions.
Original file line number Diff line number Diff line change
@@ -1,46 +1,22 @@
{
"metadataVersion": "0.1.0",
"source": {
"hash": "0xd2d4276c5864e736fe51fd70c2e76ae600520dbead60bf3b8054f6d3d13e3dd7",
"hash": "0x241e86037e1803891112031bb03b7816d4b00d50effc920dae39c2004efb2ca4",
"language": "ink! 3.0.0-rc4",
"compiler": "rustc 1.56.0-nightly"
},
"contract": {
"name": "pooltest",
"name": "c2c_tester",
"version": "0.1.0",
"authors": [
"[your_name] <[your_email]>"
"RBB S.r.l"
]
},
"spec": {
"constructors": [
{
"args": [
{
"name": "init_value",
"type": {
"displayName": [
"bool"
],
"type": 1
}
}
],
"docs": [
"Constructor that initializes the `bool` value to the given `init_value`."
],
"name": [
"new"
],
"selector": "0x9bae9d5e"
},
{
"args": [],
"docs": [
"Constructor that initializes the `bool` value to `false`.",
"",
"Constructors can delegate to other constructors."
],
"docs": [],
"name": [
"default"
],
Expand All @@ -51,33 +27,37 @@
"events": [],
"messages": [
{
"args": [],
"docs": [
" A message that can be called on instantiated contracts.",
" This one flips the value of the stored `bool` from `true`",
" to `false` and vice versa."
"args": [
{
"name": "value",
"type": {
"displayName": [
"u32"
],
"type": 1
}
}
],
"docs": [],
"mutates": true,
"name": [
"flip"
"set_value"
],
"payable": false,
"returnType": null,
"selector": "0x633aa551"
"selector": "0xc6298215"
},
{
"args": [],
"docs": [
" Simply returns the current value of our `bool`."
],
"docs": [],
"mutates": false,
"name": [
"get"
],
"payable": false,
"returnType": {
"displayName": [
"bool"
"u32"
],
"type": 1
},
Expand All @@ -103,7 +83,7 @@
"types": [
{
"def": {
"primitive": "bool"
"primitive": "u32"
}
}
]
Expand Down
Binary file added test/functional/assets/c2c_tester.wasm
Binary file not shown.
216 changes: 216 additions & 0 deletions test/functional/assets/pooltester.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"metadataVersion": "0.1.0",
"source": {
"hash": "0x2d1e1ed093dfb95c258342e80e7e1800c8c87cf4459837291a35245d23d15038",
"language": "ink! 3.0.0-rc4",
"compiler": "rustc 1.56.0-nightly"
},
"contract": {
"name": "pooltester",
"version": "0.1.0",
"authors": [
"RBB S.r.l"
]
},
"spec": {
"constructors": [
{
"args": [
{
"name": "value",
"type": {
"displayName": [
"i64"
],
"type": 1
}
}
],
"docs": [],
"name": [
"new"
],
"selector": "0x9bae9d5e"
},
{
"args": [],
"docs": [],
"name": [
"default"
],
"selector": "0xed4b9d1b"
}
],
"docs": [],
"events": [],
"messages": [
{
"args": [],
"docs": [],
"mutates": true,
"name": [
"get"
],
"payable": false,
"returnType": {
"displayName": [
"i64"
],
"type": 1
},
"selector": "0x2f865bd9"
},
{
"args": [],
"docs": [],
"mutates": true,
"name": [
"flip"
],
"payable": false,
"returnType": null,
"selector": "0x633aa551"
},
{
"args": [
{
"name": "dest",
"type": {
"displayName": [
"AccountId"
],
"type": 2
}
}
],
"docs": [],
"mutates": true,
"name": [
"send_to_pubkey"
],
"payable": false,
"returnType": null,
"selector": "0xd10be299"
},
{
"args": [],
"docs": [],
"mutates": true,
"name": [
"fund"
],
"payable": false,
"returnType": null,
"selector": "0x4aafa343"
},
{
"args": [],
"docs": [],
"mutates": true,
"name": [
"send_to_self"
],
"payable": false,
"returnType": null,
"selector": "0xba6ee83a"
},
{
"args": [
{
"name": "dest",
"type": {
"displayName": [
"AccountId"
],
"type": 2
}
},
{
"name": "selector",
"type": {
"displayName": [],
"type": 5
}
},
{
"name": "value",
"type": {
"displayName": [
"i64"
],
"type": 1
}
}
],
"docs": [],
"mutates": true,
"name": [
"call_contract"
],
"payable": false,
"returnType": null,
"selector": "0xc7c0b7ca"
}
]
},
"storage": {
"struct": {
"fields": [
{
"layout": {
"cell": {
"key": "0x0000000000000000000000000000000000000000000000000000000000000000",
"ty": 1
}
},
"name": "value"
}
]
}
},
"types": [
{
"def": {
"primitive": "i64"
}
},
{
"def": {
"composite": {
"fields": [
{
"type": 3,
"typeName": "[u8; 32]"
}
]
}
},
"path": [
"ink_env",
"types",
"AccountId"
]
},
{
"def": {
"array": {
"len": 32,
"type": 4
}
}
},
{
"def": {
"primitive": "u8"
}
},
{
"def": {
"array": {
"len": 4,
"type": 4
}
}
}
]
}
Binary file added test/functional/assets/pooltester.wasm
Binary file not shown.
Binary file removed test/functional/code.wasm
Binary file not shown.
Loading

0 comments on commit 661f654

Please sign in to comment.