-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmock.js
31 lines (27 loc) · 837 Bytes
/
mock.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
const aschContractCore = require('asch-contract-core')
const getContext = (function () {
let height = 0
return function () {
height++
return {
transaction: { id: String(height), args: [] },
senderAddress: 'senderAddress',
block: { height, timestamp: height, version: 'v1.0' }
}
}
})()
class AschContract {
get context () {
return getContext()
}
transfer (recipientAddress, amount, currency) {}
}
global.AschContract = AschContract
global.Mapping = aschContractCore.Mapping.Mapping
global.Vector = aschContractCore.Vector.Vector
global.Crypto = aschContractCore.Crypto.Crypto
global.assert = aschContractCore.assert.assert
global.ByteBuffer = aschContractCore.ByteBuffer.ByteBuffer
global.Util = aschContractCore.Util.Util
global.payable = () => () => {}
global.constant = () => () => {}