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

EPE-972:Add support for std::tuple in eosio.cdt #1215

Open
wants to merge 3 commits into
base: release/1.8.x
Choose a base branch
from
Open
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
80 changes: 80 additions & 0 deletions tests/toolchain/abigen-pass/nested_container.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
"version": "eosio::abi/1.2",
"types": [],
"structs": [
{
"name": "map2map",
"base": "",
"fields": [
{
"name": "m",
"type": "pair_string_string[]"
},
{
"name": "m2m",
"type": "pair_string_pair_string_string[][]"
}
]
},
{
"name": "pair_string_pair_string_string",
"base": "",
"fields": [
{
"name": "key",
"type": "string"
},
{
"name": "value",
"type": "pair_string_string[]"
}
]
},
{
"name": "pair_string_string",
"base": "",
"fields": [
{
"name": "key",
"type": "string"
},
{
"name": "value",
"type": "string"
}
]
},
{
"name": "settuple2",
"base": "",
"fields": [
{
"name": "user",
"type": "name"
},
{
"name": "tp2",
"type": "tuple_int32_float64_string_int32[]"
}
]
}
],
"actions": [
{
"name": "map2map",
"type": "map2map",
"ricardian_contract": ""
},
{
"name": "settuple2",
"type": "settuple2",
"ricardian_contract": ""
}
],
"tables": [],
"kv_tables": {},
"ricardian_clauses": [],
"variants": [],
"action_results": []
}
20 changes: 20 additions & 0 deletions tests/toolchain/abigen-pass/nested_container.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <eosio/eosio.hpp>
#include <tuple>
#include <vector>

using namespace eosio;
using std::map;
using std::string;
using std::tuple;
using std::vector;

class [[eosio::contract]] nested_container : public contract {
public:
using contract::contract;

[[eosio::action]]
void map2map(map<string, string> m, map<string, map<string, string>> m2m) {}

[[eosio::action]]
void settuple2(name user, const tuple <int, double, string, vector<int> >& tp2) {}
};
9 changes: 9 additions & 0 deletions tests/toolchain/abigen-pass/nested_container.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"tests" : [
{
"expected" : {
"abi-file" : "nested_container.abi"
}
}
]
}
Loading