-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from AntelopeIO/mikelik/singleton_fix
Fix getting wrong name of the table for singleton
- Loading branch information
Showing
4 changed files
with
77 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ", | ||
"version": "eosio::abi/1.2", | ||
"types": [], | ||
"structs": [ | ||
{ | ||
"name": "tbl_config", | ||
"base": "", | ||
"fields": [ | ||
{ | ||
"name": "y", | ||
"type": "uint64" | ||
}, | ||
{ | ||
"name": "x", | ||
"type": "uint64" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "whatever", | ||
"base": "", | ||
"fields": [] | ||
} | ||
], | ||
"actions": [ | ||
{ | ||
"name": "whatever", | ||
"type": "whatever", | ||
"ricardian_contract": "" | ||
} | ||
], | ||
"tables": [ | ||
{ | ||
"name": "config", | ||
"type": "tbl_config", | ||
"index_type": "i64", | ||
"key_names": [], | ||
"key_types": [] | ||
} | ||
], | ||
"ricardian_clauses": [], | ||
"variants": [], | ||
"action_results": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <eosio/asset.hpp> | ||
#include <eosio/eosio.hpp> | ||
#include <eosio/name.hpp> | ||
#include <eosio/singleton.hpp> | ||
|
||
using namespace eosio; | ||
|
||
class [[eosio::contract("singleton_contract")]] singleton_contract : public contract { | ||
public: | ||
using contract::contract; | ||
|
||
[[eosio::action]] | ||
void whatever() {}; | ||
|
||
struct [[eosio::table]] tbl_config { | ||
uint64_t y; | ||
uint64_t x; | ||
}; | ||
|
||
typedef eosio::singleton<"config"_n, tbl_config> config; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"tests" : [ | ||
{ | ||
"expected" : { | ||
"abi-file" : "singleton_contract.abi" | ||
} | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters