Skip to content

Instantly share code, notes, and snippets.

View toonsevrin's full-sized avatar

NaN toonsevrin

View GitHub Profile
npm run build
> [email protected] build /root/eos/contracts/helloas
> npm run build:untouched && npm run build:optimized
> [email protected] build:untouched /root/eos/contracts/helloas
> asc assembly/module.ts -t build/untouched.wat -b build/untouched.wasm --validate --sourceMap --measure --noAssert
I/O Read : 0.354 ms
root@dawn4:~/eos/contracts/helloas/build# cat ~/eos/build/contracts/hello/hello.wast
(module
(type $FUNCSIG$vij (func (param i32 i64)))
(type $FUNCSIG$j (func (result i64)))
(type $FUNCSIG$vjj (func (param i64 i64)))
(type $FUNCSIG$vii (func (param i32 i32)))
(type $FUNCSIG$i (func (result i32)))
(type $FUNCSIG$iii (func (param i32 i32) (result i32)))
(type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32)))
(type $FUNCSIG$vi (func (param i32)))
root@dawn4:~/eos/contracts/helloas/build# cleos set contract tester ./ untouched.wasm hello.abi
Reading WAST/WASM from untouched.wasm...
Using already assembled WASM...
Publishing contract...
Error 3070002: Runtime Error Processing WASM
Error Details:
Smart contract's apply function not exported; non-existent; or wrong type
circles.cpp:39:32: error: too few arguments to function call, expected at least
2, have 1
token_owners::get(query);
~~~~~~~~~~~~~~~~~ ^
/usr/local/include/eoslib/db.hpp:377:5: note: 'get' declared here
static bool get( const PrimaryType& p, Record& r, uint64_t s = scope ) {
^
/usr/local/include/eoslib/db.hpp:379:21: error: no member named 'load_primary'
in 'eosio::table_impl<8, 8>'
return impl::load_primary( s, code, table_n, &r, sizeof(Record) ...
540005ms chain_controller.cpp:208 _push_block ] initu #2822 @2017-12-13T13:09:00 | 0 trx, 0 pending, exectime_ms=2
540006ms producer_plugin.cpp:246 block_production_loo ] initu generated block #2822 @ 2017-12-13T13:09:00 with 0 trxs 0 pending
540722ms chain_api_plugin.cpp:75 operator() ] Exception encountered while processing chain.push_transaction: {"code":0,"name":"exception","message":"unspecified","stack":[{"context":{"level":"warn","file":"wasm_interface.cpp","line":954,"method":"init","hostname":"","thread_name":"","timestamp":"2017-12-13T13:09:00"},"format":"","data":{}},{"context":{"level":"warn","file":"chain_controller.cpp","line":983,"method":"apply_message","hostname":"","thread_name":"","timestamp":"2017-12-13T13:09:00"},"format":"","data":{"context.msg":{"code":"eos","type":"setcode","authorization":[{"account":"currency","permission":"active"}],"data":"0000001e4d75af460000e7150061736d0100000001390a60037e7e7f017f60047e7e7f7f0
./eosc -v set contract currency ../../contracts/currency/currency.wast ../../contracts/currency/currency.abi
[sudo] password for toon:
Reading WAST...
Assembling WASM...
Publishing contract...
540727ms main.cpp:1166 main ] Failed with error: 10 assert_exception: Assert Exception
status_code == 200: Error code 500
: {"code":500,"message":"Internal Service Error","details":"0 exception: unspecified\n\n {}\n wasm_interface.cpp:954 init\n\n {\"context.msg\":{\"code\":\"eos\",\"type\":\"setcode\",\"authorization\":[{\"account\":\"currency\",\"permission\":\"active\"}],\"data\":\"0000001e4d75af460000e7150061736d0100000001390a60037e7e7f017f60047e7e7f7f017f60017e0060057e7e7e7f7f017f60027f7f0060027f7f017f60027e7f0060017f0060000060027e7e0002790703656e7606617373657274000403656e76086c6f61645f693634000303656e760c726561645f6d657373616765000503656e760a72656d6f76655f693634000003656e760c726571756972655f61757468000203656e760e726571756972655f6e6f74696365000203656e760973746f7
./eosc -v set contract currency ../../contracts/currency/currency.wast ../../contracts/currency/currency.abi
[sudo] password for toon:
Reading WAST...
Assembling WASM...
Publishing contract...
540727ms main.cpp:1166 main ] Failed with error: 10 assert_exception: Assert Exception
status_code == 200: Error code 500
: {"code":500,"message":"Internal Service Error","details":"0 exception: unspecified\n\n {}\n wasm_interface.cpp:954 init\n\n {\"context.msg\":{\"code\":\"eos\",\"type\":\"setcode\",\"authorization\":[{\"account\":\"currency\",\"permission\":\"active\"}],\"data\":\"0000001e4d75af460000e7150061736d0100000001390a60037e7e7f017f60047e7e7f7f017f60017e0060057e7e7e7f7f017f60027f7f0060027f7f017f60027e7f0060017f0060000060027e7e0002790703656e7606617373657274000403656e76086c6f61645f693634000303656e760c726561645f6d657373616765000503656e760a72656d6f76655f693634000003656e760c726571756972655f61757468000203656e760e726571756972655f6e6f74696365000203656e760973746f7
public String searchConfirmedTransactionHash() throws NoNodeInfoException {
return (searchConfirmedTransactionHash(getNewBranchTransaction(), 15));
}
public String searchConfirmedTransactionHash(String txHash, int remainingDepth) throws NoNodeInfoException {
if (iotaAPI.getLatestInclusion(new String[]{txHash}).getStates()[0] && remainingDepth <= 0)
return txHash;
String transaction = getNewBranchTransaction();
List<Transaction> transactions = iotaAPI.getTransactionsObjects(new String[]{transaction});
String[] trytes = new String[]{
"IOTAFAUCET9TRANSFER99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
//Creation:
public List<String> prepareTransaction(Iterable<StoredTransaction> transactions, String currentAddress, String remainderAddress) throws InvalidAddressException, InvalidSecurityLevelException, NotEnoughBalanceException, InvalidTransferException {
List<Transfer> transfers = StreamSupport.stream(transactions.spliterator(), false)
.map(storedTransaction -> new Transfer(storedTransaction.getWalletAddress(), storedTransaction.getAmount(), "IOTAFAUCET9TRANSFER", TAG))
.collect(Collectors.toList());
long total = 0;
for (Transfer transfer : transfers)
total += transfer.getValue();
List<Input> inputs = iotaAPI.getBalanceAndFormat(Arrays.asList(currentAddress), total, 0, 0, new StopWatch(), 2).getInput();
return iotaAPI.prepareTransfers(seed, 2, transfers, remainderAddress, inputs);