Based on BUTXO Programming Language
修订版 | f05780c18c0d34a2e4d993ef38d9c8a98d62e0c8 (tree) |
---|---|
时间 | 2018-12-11 15:53:16 |
作者 | oysheng <33340252+oysheng@user...> |
Commiter | Paladz |
add contract LockPosition (#29)
* deposit contract FixedLimitCollect and FixedLimitProfit
* add contract LockPosition
* optimise
@@ -0,0 +1,9 @@ | ||
1 | +contract LockPosition(expireBlockHeight: Integer, | |
2 | + saver: Program, | |
3 | + publicKey: PublicKey) locks lockAmount of lockAsset { | |
4 | + clause expire(sig: Signature) { | |
5 | + verify above(expireBlockHeight) | |
6 | + verify checkTxSig(publicKey, sig) | |
7 | + lock lockAmount of lockAsset with saver | |
8 | + } | |
9 | +} |
@@ -16,6 +16,10 @@ func TestCompileContract(t *testing.T) { | ||
16 | 16 | want string |
17 | 17 | }{ |
18 | 18 | { |
19 | + "./LockPosition", | |
20 | + "cd9f697b7bae7cac6900c3c251547ac1", | |
21 | + }, | |
22 | + { | |
19 | 23 | "./RepayCollateral", |
20 | 24 | "557a641f0000007bcda069007b7b51547ac16951c3c251547ac1632a0000007bcd9f6900c3c251567ac1", |
21 | 25 | }, |