-
Notifications
You must be signed in to change notification settings - Fork 20
/
contract-example.js
65 lines (49 loc) · 1.4 KB
/
contract-example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var TransactionTypes = require("../helpers/transaction-types.js");
var private = {}, self = null,
library = null, modules = null;
function ExampleContract(cb, _library) {
self = this;
library = _library;
cb(null, self);
}
ExampleContract.prototype.create = function (data, trs) {
return trs;
}
ExampleContract.prototype.calculateFee = function (trs) {
return 0;
}
ExampleContract.prototype.verify = function (trs, sender, cb, scope) {
setImmediate(cb, null, trs);
}
ExampleContract.prototype.getBytes = function (trs) {
return null;
}
ExampleContract.prototype.apply = function (trs, sender, cb, scope) {
setImmediate(cb);
}
ExampleContract.prototype.undo = function (trs, sender, cb, scope) {
setImmediate(cb);
}
ExampleContract.prototype.applyUnconfirmed = function (trs, sender, cb, scope) {
setImmediate(cb);
}
ExampleContract.prototype.undoUnconfirmed = function (trs, sender, cb, scope) {
setImmediate(cb);
}
ExampleContract.prototype.ready = function (trs, sender, cb, scope) {
setImmediate(cb);
}
ExampleContract.prototype.save = function (trs, cb) {
setImmediate(cb);
}
ExampleContract.prototype.dbRead = function (row) {
return null;
}
ExampleContract.prototype.normalize = function (asset, cb) {
setImmediate(cb);
}
ExampleContract.prototype.onBind = function (_modules) {
modules = _modules;
modules.logic.transaction.attachAssetType(__TYPE__, self);
}
module.exports = ExampleContract;