-
Notifications
You must be signed in to change notification settings - Fork 11
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 #86 from CoinageCrypto/fix-tests
Making tests run and pass.
- Loading branch information
Showing
9 changed files
with
80 additions
and
8 deletions.
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,3 @@ | ||
|
||
data/ | ||
compiled_contracts/ |
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,9 @@ | ||
{ | ||
"cdt": "https://github.com/EOSIO/eosio.cdt/releases/download/v1.6.2/eosio.cdt_1.6.2-1-ubuntu-18.04_amd64.deb", | ||
"eos": "https://github.com/EOSIO/eos/releases/download/v1.8.4/eosio_1.8.4-1-ubuntu-18.04_amd64.deb", | ||
"debug": 0, | ||
"debugTransactions": false, | ||
"keepAlive": false, | ||
"outDir": ".lamington", | ||
"exclude": [] | ||
} |
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 |
---|---|---|
@@ -1,6 +1,9 @@ | ||
src/ | ||
node_modules/ | ||
api-docs/ | ||
.lamington/ | ||
.lamingtonrc | ||
contracts/ | ||
.gitignore | ||
.prettierrc | ||
.travis.yml | ||
|
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,37 @@ | ||
#include <eosio/eosio.hpp> | ||
#include <string> | ||
|
||
using namespace eosio; | ||
using namespace std; | ||
|
||
class[[eosio::contract("example")]] example : public contract | ||
{ | ||
|
||
public: | ||
using contract::contract; | ||
|
||
[[eosio::action]] void post(const name author, const string message) { | ||
// Ensure author is signee | ||
require_auth(author); | ||
// Initialize a message table instance | ||
message_table messages(_self, _self.value); | ||
// Store the new message for author | ||
messages.emplace(author, [&](auto &post) { | ||
post.id = messages.available_primary_key(); | ||
post.body = message; | ||
post.author = author; | ||
}); | ||
} | ||
|
||
private : | ||
|
||
struct [[eosio::table]] MessageStruct { | ||
uint64_t id; | ||
string body; | ||
name author; | ||
|
||
uint64_t primary_key() const { return id; }; | ||
}; | ||
|
||
typedef multi_index<"messages"_n, MessageStruct> message_table; | ||
}; |
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,23 @@ | ||
// ===================================================== | ||
// WARNING: GENERATED FILE | ||
// | ||
// Any changes you make will be overwritten by Lamington | ||
// ===================================================== | ||
|
||
import { Account, Contract, GetTableRowsOptions, TableRowsResult } from 'lamington'; | ||
|
||
// Table row types | ||
export interface ExampleMessages { | ||
id: number; | ||
body: string; | ||
author: string|number; | ||
} | ||
|
||
export interface Example extends Contract { | ||
// Actions | ||
post(author: string|number, message: string, options?: { from?: Account }): Promise<any>; | ||
|
||
// Tables | ||
messages(options?: GetTableRowsOptions): Promise<TableRowsResult<ExampleMessages>>; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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