Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions contract/vm_dummy/test_files/all_types.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
state.var {
name = state.value(),
list = state.array(),
values = state.map()
}

-- value type

function value_set(new_name)
name:set(new_name)
contract.event("value_set", new_name)
end

function value_get()
return name:get()
end

-- map type

function map_set(key, val)
values[key] = val
contract.event("map_set", key, val)
end

function map_get(key)
return values[key]
end

-- array type

function array_append(val)
list:append(val)
contract.event("array_append", val)
end

function array_set(idx, val)
list[idx] = val
contract.event("array_set", idx, val)
end

function array_get(idx)
return list[idx]
end

function array_length()
return list:length()
end

-- write functions
abi.register(value_set, map_set, array_append, array_set)
-- read-only functions
abi.register_view(value_get, map_get, array_get, array_length)
16 changes: 10 additions & 6 deletions tests/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ function set_version() {
echo "now test hardfork version $version"
# get the current block number / height
block_no=$(../bin/aergocli blockchain | jq .height | sed 's/"//g')
# increment 2 numbers
block_no=$((block_no+2))
# increment 3 numbers
block_no=$((block_no+3))
# terminate the server process(es)
stop_nodes
# save the hardfork config on the config file(s)
Expand Down Expand Up @@ -150,8 +150,9 @@ echo "creating user account..."

# run the integration tests - version 2
if [ "$short_tests" = true ]; then
check ./test-contract-deploy.sh
check ./test-aergocli.sh
else
check ./test-aergocli.sh
check ./test-gas-deploy.sh
check ./test-gas-op.sh
check ./test-gas-bf.sh
Expand All @@ -168,8 +169,9 @@ set_version 3

# run the integration tests - version 3
if [ "$short_tests" = true ]; then
check ./test-contract-deploy.sh
check ./test-aergocli.sh
else
check ./test-aergocli.sh
check ./test-max-call-depth.sh
check ./test-gas-deploy.sh
check ./test-gas-op.sh
Expand All @@ -188,8 +190,9 @@ set_version 4

# run the integration tests - version 4
if [ "$short_tests" = true ]; then
check ./test-contract-deploy.sh
check ./test-aergocli.sh
else
check ./test-aergocli.sh
check ./test-max-call-depth.sh
check ./test-gas-deploy.sh
check ./test-gas-op.sh
Expand All @@ -210,8 +213,9 @@ set_version 5

# run the integration tests - version 5
if [ "$short_tests" = true ]; then
check ./test-contract-deploy.sh
check ./test-aergocli.sh
else
check ./test-aergocli.sh
check ./test-max-call-depth.sh
check ./test-gas-deploy.sh
check ./test-gas-op.sh
Expand Down
Loading