Skip to content

Instantly share code, notes, and snippets.

Michiel Mulders michielmulders

Block or report user

Report or block michielmulders

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@michielmulders
michielmulders / example4.py
Last active Sep 12, 2019
Python Syntax Error
View example4.py
# example4.py
def say(name)
print('Hello, ' + name)
say('Michael')
View example3.py
# example3.py
import xyz
@michielmulders
michielmulders / example2.py
Created Sep 12, 2019
Example AttributeError Python
View example2.py
# example2.py
my_num = 1
my_num.param
@michielmulders
michielmulders / example.py
Created Sep 12, 2019
Example Stack Trace Python
View example.py
# example.py
def say(name):
print('Hello, ' + nam)
say('Michael')
@michielmulders
michielmulders / caching.js
Last active Sep 12, 2019
Lisk Cache Data
View caching.js
await store.account.cache({
address_in: [
"16152155423726476379L",
"12087516173140285171L"
],
});
@michielmulders
michielmulders / base-tx.js
Created Sep 5, 2019
Lisk BaseTransaction Constructor Validation
View base-tx.js
this.amount = new BigNum(
isValidNumber(tx.amount) ? (tx.amount as string | number) : '0',
);
@michielmulders
michielmulders / custom-filter.js
Last active Sep 9, 2019
Custom Filter Account Entity
View custom-filter.js
this.addFilter('asset_contains', ft.CUSTOM, {
condition: "asset @> '${asset_contains:value}'::jsonb",
});
this.addFilter('asset_exists', ft.CUSTOM, {
condition: "asset ? '${asset_exists:value}'",
});
@michielmulders
michielmulders / invoice-tx.js
Created Sep 5, 2019
Lisk Bills Invoice Apply Asset
View invoice-tx.js
applyAsset(store) {
const sender = store.account.get(this.senderId);
// Save invoice count and IDs
sender.asset.invoiceCount = sender.asset.invoiceCount === undefined ? 1 : ++sender.asset.invoiceCount;
sender.asset.invoicesSent = sender.asset.invoicesSent === undefined ? [this.id] : [...sender.asset.invoicesSent, this.id];
store.account.set(sender.address, sender);
return [];
}
@michielmulders
michielmulders / payment-tx.js
Created Sep 5, 2019
Lisk Bills Payment Transaction
View payment-tx.js
async prepare(store) {
await super.prepare(store);
await store.transaction.cache([
{
id: this.asset.data,
},
]);
}
applyAsset(store) {
@michielmulders
michielmulders / prepare.js
Last active Sep 5, 2019
Lisk Custom Transaction Prepare Method
View prepare.js
// Custom transaction: invoice_transaction.js
async prepare(store) {
await super.prepare(store);
}
// Base transaction implementation: base_transaction.ts
public async prepare(store: StateStorePrepare): Promise<void> {
await store.account.cache([
{
address: this.senderId,
You can’t perform that action at this time.