@firmachain/firma-js 0.2.64 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -8
- package/dist/sdk/FirmaAuthzService.js +12 -6
- package/dist/sdk/FirmaBankService.d.ts +4 -4
- package/dist/sdk/FirmaContractService.d.ts +4 -4
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +14 -14
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +9 -9
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.d.ts +8 -8
- package/dist/sdk/FirmaCosmWasmService.js +2 -3
- package/dist/sdk/FirmaDistributionService.d.ts +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +4 -4
- package/dist/sdk/FirmaGovService.d.ts +27 -16
- package/dist/sdk/FirmaGovService.js +305 -195
- package/dist/sdk/FirmaIbcService.d.ts +3 -4
- package/dist/sdk/FirmaIbcService.js +5 -2
- package/dist/sdk/FirmaNftService.d.ts +5 -5
- package/dist/sdk/FirmaStakingService.d.ts +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +5 -5
- package/dist/sdk/FirmaUtil.d.ts +1 -1
- package/dist/sdk/FirmaUtil.js +12 -14
- package/dist/sdk/firmachain/amino/addresses.js +1 -1
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +10 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +5 -1
- package/dist/sdk/firmachain/amino/aminotypes.js +27 -10
- package/dist/sdk/firmachain/amino/coins.d.ts +14 -2
- package/dist/sdk/firmachain/amino/coins.js +26 -5
- package/dist/sdk/firmachain/amino/encoding.d.ts +10 -1
- package/dist/sdk/firmachain/amino/encoding.js +21 -3
- package/dist/sdk/firmachain/amino/signdoc.d.ts +21 -3
- package/dist/sdk/firmachain/amino/signdoc.js +37 -11
- package/dist/sdk/firmachain/amino/signer.d.ts +2 -1
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +7 -6
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +7 -6
- package/dist/sdk/firmachain/bank/BankQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/CommonTxClient.js +11 -9
- package/dist/sdk/firmachain/common/ITxClient.d.ts +6 -6
- package/dist/sdk/firmachain/common/ITxClient.js +82 -24
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +4 -9
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +37 -32
- package/dist/sdk/firmachain/common/LedgerWallet.js +4 -8
- package/dist/sdk/firmachain/common/TxCommon.d.ts +1 -2
- package/dist/sdk/firmachain/common/accounts.d.ts +7 -3
- package/dist/sdk/firmachain/common/accounts.js +28 -33
- package/dist/sdk/firmachain/common/aminotypes.d.ts +19 -0
- package/dist/sdk/firmachain/common/aminotypes.js +74 -0
- package/dist/sdk/firmachain/common/events.d.ts +32 -0
- package/dist/sdk/firmachain/common/events.js +18 -0
- package/dist/sdk/firmachain/common/fee.d.ts +26 -0
- package/dist/sdk/firmachain/common/fee.js +83 -0
- package/dist/sdk/firmachain/common/index.d.ts +1 -0
- package/dist/sdk/firmachain/common/index.js +3 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/auth/queries.js +64 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +15 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/authz/messages.js +9 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/authz/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +35 -0
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +85 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/bank/messages.js +12 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +15 -0
- package/dist/sdk/firmachain/common/modules/bank/queries.js +128 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +14 -0
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +44 -0
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +113 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +15 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +171 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +18 -0
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +14 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +8 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +9 -0
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +81 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +79 -0
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +152 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +29 -0
- package/dist/sdk/firmachain/common/modules/gov/messages.js +38 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +19 -0
- package/dist/sdk/firmachain/common/modules/gov/queries.js +160 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +8 -0
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/group/messages.js +28 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +38 -0
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +55 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +8 -0
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +32 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +58 -0
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +576 -0
- package/dist/sdk/firmachain/common/modules/index.d.ts +32 -0
- package/dist/sdk/firmachain/common/modules/index.js +101 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +21 -0
- package/dist/sdk/firmachain/common/modules/mint/queries.js +95 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +12 -0
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +11 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +10 -0
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +88 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +112 -0
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +234 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +33 -0
- package/dist/sdk/firmachain/common/modules/staking/messages.js +37 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +23 -0
- package/dist/sdk/firmachain/common/modules/staking/queries.js +242 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +11 -0
- package/dist/sdk/firmachain/common/modules/tx/queries.js +103 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +16 -0
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +56 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +2 -0
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +7 -0
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/queryclient/index.js +10 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +75 -0
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +157 -0
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +33 -0
- package/dist/sdk/firmachain/common/queryclient/utils.js +101 -0
- package/dist/sdk/firmachain/common/search.d.ts +10 -0
- package/dist/sdk/firmachain/common/search.js +7 -0
- package/dist/sdk/firmachain/common/signing.d.ts +8 -3
- package/dist/sdk/firmachain/common/signing.js +24 -12
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +107 -30
- package/dist/sdk/firmachain/common/signingstargateclient.js +445 -128
- package/dist/sdk/firmachain/common/stargateclient.d.ts +184 -20
- package/dist/sdk/firmachain/common/stargateclient.js +351 -35
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +2 -2
- package/dist/sdk/firmachain/contract/ContractTxClient.js +4 -4
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +3 -3
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +1 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +5 -5
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +10 -8
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/any.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/duration.js +2 -1
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +3 -2
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +2 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +13 -1
- package/dist/sdk/firmachain/gov/GovQueryClient.js +9 -2
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +12 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +11 -1
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +3 -3
- package/dist/sdk/firmachain/nft/NftTxClient.js +6 -6
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.js +4 -4
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +1 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +0 -1
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +4 -4
- package/dist/sdk/firmachain/token/TokenTxClient.js +8 -8
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.js +5 -5
- package/dist/test/00.wallet.test.js +15 -9
- package/dist/test/01.contract_tx.test.js +53 -45
- package/dist/test/02.contract_query.test.js +54 -31
- package/dist/test/03.contract_scenario.test.js +170 -326
- package/dist/test/04.bank_tx.test.js +58 -59
- package/dist/test/05.bank_query.test.js +51 -56
- package/dist/test/06.feegrant_tx.test.js +74 -89
- package/dist/test/07.feegrant_query.test.js +69 -27
- package/dist/test/08.gas_estimate.test.js +422 -392
- package/dist/test/09.ipfs.test.js +3 -3
- package/dist/test/10.nft_tx.test.js +108 -76
- package/dist/test/11.nft_query.test.js +41 -46
- package/dist/test/12.staking_tx.test.js +81 -98
- package/dist/test/13.staking_query.test.js +66 -12
- package/dist/test/14.distribution_tx.test.js +69 -78
- package/dist/test/15.distribution_query.test.js +81 -57
- package/dist/test/16.gov_tx.test.js +247 -107
- package/dist/test/17.gov_query.test.js +48 -9
- package/dist/test/18.util.test.js +6 -1
- package/dist/test/19.chain.test.js +50 -4
- package/dist/test/20.slashing_query.test.js +31 -1
- package/dist/test/21.token_tx.test.js +48 -56
- package/dist/test/22.token_query.test.js +24 -20
- package/dist/test/23.authz_tx.test.js +119 -240
- package/dist/test/24.authz_query.test.js +116 -56
- package/dist/test/25.cosmwasm_tx.test.js +95 -57
- package/dist/test/26.cosmwasm_query.test.js +66 -26
- package/dist/test/27.arbitary_sign.test.js +59 -67
- package/dist/test/28.ibc_tx.test.js +29 -17
- package/dist/test/29.mint_query.test.js +2 -0
- package/dist/test/30.cw20_tx.test.js +161 -226
- package/dist/test/31.cw20_query.test.js +183 -37
- package/dist/test/32.cw721_tx.test.js +147 -149
- package/dist/test/33.cw721_query.test.js +188 -36
- package/dist/test/34.cw_bridge_tx.test.js +266 -155
- package/dist/test/35.cw_bridge_tx_low.test.js +221 -81
- package/dist/test/36.cw_bridge_query.test.js +157 -21
- package/dist/test/37.cw_marketplace_tx.test.js +22 -22
- package/dist/test/38.cw_marketplace_query.test.js +9 -9
- package/dist/test/config_test.d.ts +10 -4
- package/dist/test/config_test.js +16 -9
- package/dist/test/config_test.sample.d.ts +11 -0
- package/dist/test/config_test.sample.js +14 -0
- package/package.json +9 -7
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +0 -50
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +0 -267
|
@@ -35,206 +35,346 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
35
35
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
38
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
50
|
var chai_1 = require("chai");
|
|
40
51
|
var common_1 = require("../sdk/firmachain/common");
|
|
41
52
|
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
42
53
|
var config_test_1 = require("./config_test");
|
|
43
54
|
// If test it, the properties of the chain change, so skip it.
|
|
44
|
-
describe
|
|
55
|
+
describe('[16. Gov Tx Test]', function () {
|
|
45
56
|
var firma;
|
|
57
|
+
var aliceWallet;
|
|
58
|
+
var aliceAddress;
|
|
59
|
+
var bobWallet;
|
|
60
|
+
var bobAddress;
|
|
61
|
+
var extractValue = function (events, eventType, attrKey) {
|
|
62
|
+
var e_1, _a, e_2, _b;
|
|
63
|
+
try {
|
|
64
|
+
for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {
|
|
65
|
+
var event_1 = events_1_1.value;
|
|
66
|
+
if (event_1.type === eventType) {
|
|
67
|
+
try {
|
|
68
|
+
for (var _c = (e_2 = void 0, __values(event_1.attributes)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
69
|
+
var attr = _d.value;
|
|
70
|
+
if (attr.key === attrKey) {
|
|
71
|
+
return attr.value;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
76
|
+
finally {
|
|
77
|
+
try {
|
|
78
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
79
|
+
}
|
|
80
|
+
finally { if (e_2) throw e_2.error; }
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
86
|
+
finally {
|
|
87
|
+
try {
|
|
88
|
+
if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);
|
|
89
|
+
}
|
|
90
|
+
finally { if (e_1) throw e_1.error; }
|
|
91
|
+
}
|
|
92
|
+
return "";
|
|
93
|
+
};
|
|
46
94
|
beforeEach(function () {
|
|
47
|
-
|
|
95
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
96
|
+
return __generator(this, function (_a) {
|
|
97
|
+
switch (_a.label) {
|
|
98
|
+
case 0:
|
|
99
|
+
firma = new FirmaSDK_1.FirmaSDK(config_test_1.TestChainConfig);
|
|
100
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.aliceMnemonic)];
|
|
101
|
+
case 1:
|
|
102
|
+
aliceWallet = _a.sent();
|
|
103
|
+
return [4 /*yield*/, aliceWallet.getAddress()];
|
|
104
|
+
case 2:
|
|
105
|
+
aliceAddress = _a.sent();
|
|
106
|
+
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.bobMnemonic)];
|
|
107
|
+
case 3:
|
|
108
|
+
bobWallet = _a.sent();
|
|
109
|
+
return [4 /*yield*/, bobWallet.getAddress()];
|
|
110
|
+
case 4:
|
|
111
|
+
bobAddress = _a.sent();
|
|
112
|
+
return [2 /*return*/];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
});
|
|
48
116
|
});
|
|
49
117
|
// Test order
|
|
50
118
|
// 1. submitProposal
|
|
51
119
|
// 2. deposit(for pass minium deposit value)
|
|
52
120
|
// 3. vote
|
|
53
121
|
it('SubmitTextProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
54
|
-
var
|
|
122
|
+
var initialDepositFCT, title, description, result;
|
|
55
123
|
return __generator(this, function (_a) {
|
|
56
124
|
switch (_a.label) {
|
|
57
|
-
case 0:
|
|
58
|
-
|
|
59
|
-
wallet = _a.sent();
|
|
60
|
-
initialDepositFCT = 10;
|
|
125
|
+
case 0:
|
|
126
|
+
initialDepositFCT = 2500;
|
|
61
127
|
title = "test submit proposal";
|
|
62
128
|
description = "test description";
|
|
63
|
-
return [4 /*yield*/, firma.Gov.submitTextProposal(
|
|
64
|
-
case
|
|
129
|
+
return [4 /*yield*/, firma.Gov.submitTextProposal(aliceWallet, title, description, initialDepositFCT)];
|
|
130
|
+
case 1:
|
|
65
131
|
result = _a.sent();
|
|
66
|
-
console.log(result);
|
|
67
132
|
chai_1.expect(result.code).to.equal(0);
|
|
68
133
|
return [2 /*return*/];
|
|
69
134
|
}
|
|
70
135
|
});
|
|
71
136
|
}); });
|
|
72
137
|
it('SubmitCommunityPoolSpendProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
73
|
-
var
|
|
138
|
+
var initialDepositFCT, title, summary, amountFCT, recipient, result;
|
|
74
139
|
return __generator(this, function (_a) {
|
|
75
140
|
switch (_a.label) {
|
|
76
|
-
case 0:
|
|
77
|
-
|
|
78
|
-
aliceWallet = _a.sent();
|
|
79
|
-
return [4 /*yield*/, firma.Wallet.fromMnemonic(config_test_1.bobMnemonic)];
|
|
80
|
-
case 2:
|
|
81
|
-
bobWallet = _a.sent();
|
|
82
|
-
initialDepositFCT = 10;
|
|
141
|
+
case 0:
|
|
142
|
+
initialDepositFCT = 2500;
|
|
83
143
|
title = "Community spend proposal1";
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
return [4 /*yield*/, firma.Gov.submitCommunityPoolSpendProposal(aliceWallet, title, description, initialDepositFCT, amount, recipient)];
|
|
90
|
-
case 4:
|
|
144
|
+
summary = "This is a community spend proposal";
|
|
145
|
+
amountFCT = 1000;
|
|
146
|
+
recipient = aliceAddress;
|
|
147
|
+
return [4 /*yield*/, firma.Gov.submitCommunityPoolSpendProposal(aliceWallet, title, summary, initialDepositFCT, amountFCT, recipient)];
|
|
148
|
+
case 1:
|
|
91
149
|
result = _a.sent();
|
|
92
|
-
console.log(result);
|
|
93
150
|
chai_1.expect(result.code).to.equal(0);
|
|
94
151
|
return [2 /*return*/];
|
|
95
152
|
}
|
|
96
153
|
});
|
|
97
154
|
}); });
|
|
98
|
-
it('
|
|
99
|
-
|
|
155
|
+
it('SubmitStakingParamsUpdateProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
156
|
+
function toDec18String(decimal) {
|
|
157
|
+
return BigInt(parseFloat(decimal) * 1e18).toString();
|
|
158
|
+
}
|
|
159
|
+
function parseDuration(durationStr) {
|
|
160
|
+
var match = /^(\d+)(\.(\d+))?s$/.exec(durationStr);
|
|
161
|
+
if (!match)
|
|
162
|
+
throw new Error("Invalid duration string: " + durationStr);
|
|
163
|
+
var seconds = BigInt(match[1]);
|
|
164
|
+
var fractionalPart = match[3] || "";
|
|
165
|
+
var padded = (fractionalPart + "000000000").slice(0, 9);
|
|
166
|
+
var nanos = Number(padded);
|
|
167
|
+
return { seconds: seconds, nanos: nanos };
|
|
168
|
+
}
|
|
169
|
+
var title, summary, initialDepositFCT, stakingParmas, changeValue, unbondingData, changeStakingParams, metadata, result;
|
|
100
170
|
return __generator(this, function (_a) {
|
|
101
171
|
switch (_a.label) {
|
|
102
|
-
case 0:
|
|
172
|
+
case 0:
|
|
173
|
+
title = "Staking Parameter Change proposal";
|
|
174
|
+
summary = "This is a Staking Parameter change proposal";
|
|
175
|
+
initialDepositFCT = 2500;
|
|
176
|
+
return [4 /*yield*/, firma.Staking.getParams()];
|
|
103
177
|
case 1:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
178
|
+
stakingParmas = _a.sent();
|
|
179
|
+
changeValue = 100;
|
|
180
|
+
unbondingData = parseDuration(stakingParmas.unbonding_time);
|
|
181
|
+
changeStakingParams = {
|
|
182
|
+
unbondingTime: { seconds: BigInt(unbondingData.seconds), nanos: unbondingData.nanos },
|
|
183
|
+
maxValidators: changeValue,
|
|
184
|
+
maxEntries: stakingParmas.max_entries,
|
|
185
|
+
historicalEntries: stakingParmas.historical_entries,
|
|
186
|
+
bondDenom: stakingParmas.bond_denom,
|
|
187
|
+
minCommissionRate: toDec18String(stakingParmas.min_commission_rate)
|
|
188
|
+
};
|
|
189
|
+
metadata = "";
|
|
190
|
+
return [4 /*yield*/, firma.Gov.submitStakingParamsUpdateProposal(aliceWallet, title, summary, initialDepositFCT, changeStakingParams, metadata)];
|
|
114
191
|
case 2:
|
|
115
192
|
result = _a.sent();
|
|
116
|
-
console.log(result);
|
|
117
193
|
chai_1.expect(result.code).to.equal(0);
|
|
118
194
|
return [2 /*return*/];
|
|
119
195
|
}
|
|
120
196
|
});
|
|
121
197
|
}); });
|
|
122
|
-
it('
|
|
123
|
-
|
|
198
|
+
it('SubmitGovParamsUpdateProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
+
function parseDuration(durationStr) {
|
|
200
|
+
var match = /^(\d+)(\.(\d+))?s$/.exec(durationStr);
|
|
201
|
+
if (!match)
|
|
202
|
+
throw new Error("Invalid duration string: " + durationStr);
|
|
203
|
+
var seconds = BigInt(match[1]);
|
|
204
|
+
var fractionalPart = match[3] || "";
|
|
205
|
+
var padded = (fractionalPart + "000000000").slice(0, 9);
|
|
206
|
+
var nanos = Number(padded);
|
|
207
|
+
return { seconds: seconds, nanos: nanos };
|
|
208
|
+
}
|
|
209
|
+
var title, summary, initialDepositFCT, govParams, convertMaxDepositPeriod, convertVotingPeriod, changeGovParams, metadata, result;
|
|
124
210
|
return __generator(this, function (_a) {
|
|
125
211
|
switch (_a.label) {
|
|
126
|
-
case 0:
|
|
212
|
+
case 0:
|
|
213
|
+
title = "Staking Parameter Change proposal";
|
|
214
|
+
summary = "This is a Staking Parameter change proposal";
|
|
215
|
+
initialDepositFCT = 2500;
|
|
216
|
+
return [4 /*yield*/, firma.Gov.getParam()];
|
|
127
217
|
case 1:
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
218
|
+
govParams = _a.sent();
|
|
219
|
+
convertMaxDepositPeriod = parseDuration(govParams.deposit_params.max_deposit_period);
|
|
220
|
+
convertVotingPeriod = parseDuration(govParams.voting_params.voting_period);
|
|
221
|
+
changeGovParams = {
|
|
222
|
+
minDeposit: govParams.deposit_params.min_deposit,
|
|
223
|
+
maxDepositPeriod: convertMaxDepositPeriod,
|
|
224
|
+
votingPeriod: convertVotingPeriod,
|
|
225
|
+
quorum: govParams.tally_params.quorum,
|
|
226
|
+
threshold: govParams.tally_params.threshold,
|
|
227
|
+
vetoThreshold: govParams.tally_params.veto_threshold,
|
|
228
|
+
minInitialDepositRatio: govParams.min_initial_deposit_ratio,
|
|
229
|
+
burnVoteQuorum: govParams.burn_vote_quorum,
|
|
230
|
+
burnProposalDepositPrevote: govParams.burn_proposal_deposit_prevote,
|
|
231
|
+
burnVoteVeto: govParams.burn_vote_veto
|
|
232
|
+
};
|
|
233
|
+
metadata = "";
|
|
234
|
+
return [4 /*yield*/, firma.Gov.submitGovParamsUpdateProposal(aliceWallet, title, summary, initialDepositFCT, changeGovParams, metadata)];
|
|
135
235
|
case 2:
|
|
136
236
|
result = _a.sent();
|
|
137
|
-
console.log(result);
|
|
138
237
|
chai_1.expect(result.code).to.equal(0);
|
|
139
238
|
return [2 /*return*/];
|
|
140
239
|
}
|
|
141
240
|
});
|
|
142
241
|
}); });
|
|
143
|
-
it('
|
|
144
|
-
var
|
|
242
|
+
it('SubmitSoftwareUpgradeProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
243
|
+
var initialDeposit, title, summary, plan, metadata, gas, fee, result;
|
|
145
244
|
return __generator(this, function (_a) {
|
|
146
245
|
switch (_a.label) {
|
|
147
|
-
case 0:
|
|
246
|
+
case 0:
|
|
247
|
+
initialDeposit = 5000;
|
|
248
|
+
title = "CancelProposal test proposal";
|
|
249
|
+
summary = "This is a Text & CancelProposal";
|
|
250
|
+
plan = {
|
|
251
|
+
name: 'v0.5.1',
|
|
252
|
+
time: {
|
|
253
|
+
seconds: BigInt(0),
|
|
254
|
+
nanos: 0
|
|
255
|
+
},
|
|
256
|
+
height: BigInt(1050000),
|
|
257
|
+
info: ''
|
|
258
|
+
};
|
|
259
|
+
metadata = "";
|
|
260
|
+
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitSoftwareUpgradeProposal(aliceWallet, title, summary, initialDeposit, plan, metadata)];
|
|
148
261
|
case 1:
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
title
|
|
152
|
-
description = "This is a software upgrade proposal";
|
|
153
|
-
return [4 /*yield*/, firma.Gov.submitCancelSoftwareUpgradeProposal(aliceWallet, title, description, initialDepositFCT)];
|
|
262
|
+
gas = _a.sent();
|
|
263
|
+
fee = Math.ceil(gas * 0.1);
|
|
264
|
+
return [4 /*yield*/, firma.Gov.submitSoftwareUpgradeProposal(aliceWallet, title, summary, initialDeposit, plan, metadata, { gas: gas, fee: fee })];
|
|
154
265
|
case 2:
|
|
155
266
|
result = _a.sent();
|
|
156
|
-
|
|
157
|
-
|
|
267
|
+
chai_1.expect(result.code).to.be.equal(0);
|
|
268
|
+
return [2 /*return*/];
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}); });
|
|
272
|
+
it('SubmitTextProposal & CancelProposal Test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
273
|
+
var initialDeposit, title, description, gas, fee, result, proposal_id;
|
|
274
|
+
return __generator(this, function (_a) {
|
|
275
|
+
switch (_a.label) {
|
|
276
|
+
case 0:
|
|
277
|
+
initialDeposit = 5000;
|
|
278
|
+
title = "CancelProposal test proposal";
|
|
279
|
+
description = "This is a Text & CancelProposal";
|
|
280
|
+
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitTextProposal(aliceWallet, title, description, initialDeposit)];
|
|
281
|
+
case 1:
|
|
282
|
+
gas = _a.sent();
|
|
283
|
+
fee = Math.ceil(gas * 0.1);
|
|
284
|
+
return [4 /*yield*/, firma.Gov.submitTextProposal(aliceWallet, title, description, initialDeposit, { gas: gas, fee: fee })];
|
|
285
|
+
case 2:
|
|
286
|
+
result = _a.sent();
|
|
287
|
+
proposal_id = extractValue(result.events, "submit_proposal", "proposal_id");
|
|
288
|
+
chai_1.expect(result.code).to.be.equal(0);
|
|
289
|
+
return [4 /*yield*/, firma.Gov.getGasEstimationCancelProposal(aliceWallet, proposal_id)];
|
|
290
|
+
case 3:
|
|
291
|
+
// CancelProposal
|
|
292
|
+
gas = _a.sent();
|
|
293
|
+
fee = Math.ceil(gas * 0.1);
|
|
294
|
+
return [4 /*yield*/, firma.Gov.cancelProposal(aliceWallet, proposal_id, { gas: gas, fee: fee })];
|
|
295
|
+
case 4:
|
|
296
|
+
result = _a.sent();
|
|
297
|
+
chai_1.expect(result.code).to.be.equal(0);
|
|
158
298
|
return [2 /*return*/];
|
|
159
299
|
}
|
|
160
300
|
});
|
|
161
301
|
}); });
|
|
162
|
-
// NOTICE: time-based upgrades have been deprecated in the SDK: invalid request
|
|
163
|
-
/*it.skip('SubmitSoftwareUpgradeProposalByTime Test', async () => {
|
|
164
|
-
|
|
165
|
-
const aliceWallet = await firma.Wallet.fromMnemonic(aliceMnemonic);
|
|
166
|
-
const bobWallet = await firma.Wallet.fromMnemonic(bobMnemonic);
|
|
167
|
-
|
|
168
|
-
const initialDepositFCT = 8;
|
|
169
|
-
const title = "Software Upgrade proposal2";
|
|
170
|
-
const description = "This is a software upgrade proposal";
|
|
171
|
-
|
|
172
|
-
const expirationDate = new Date();
|
|
173
|
-
expirationDate.setMinutes(expirationDate.getMinutes() + 3);
|
|
174
|
-
|
|
175
|
-
const upgradeName = "v0.2.4";
|
|
176
|
-
const upgradeTime = expirationDate;
|
|
177
|
-
const upgradeInfo = "info?";
|
|
178
|
-
|
|
179
|
-
var result = await firma.Gov.SubmitSoftwareUpgradeProposalByTime(aliceWallet, title, description, initialDepositFCT, upgradeName, upgradeTime);
|
|
180
|
-
|
|
181
|
-
console.log(result);
|
|
182
|
-
expect(result.code).to.equal(0);
|
|
183
|
-
});*/
|
|
184
302
|
// TODO: get recent gov proposal list and then set proposalId for below case
|
|
185
303
|
var tempProposalId = 1;
|
|
186
304
|
// more deposit after initial deposit case
|
|
187
|
-
it('Deposit OK', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
-
var
|
|
305
|
+
it.skip('Deposit OK', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
306
|
+
var proposalId, amount, result;
|
|
189
307
|
return __generator(this, function (_a) {
|
|
190
308
|
switch (_a.label) {
|
|
191
|
-
case 0:
|
|
192
|
-
case 1:
|
|
193
|
-
wallet = _a.sent();
|
|
309
|
+
case 0:
|
|
194
310
|
proposalId = tempProposalId;
|
|
195
|
-
amount =
|
|
196
|
-
return [4 /*yield*/, firma.Gov.deposit(
|
|
197
|
-
case
|
|
311
|
+
amount = 2500;
|
|
312
|
+
return [4 /*yield*/, firma.Gov.deposit(aliceWallet, proposalId, amount)];
|
|
313
|
+
case 1:
|
|
198
314
|
result = _a.sent();
|
|
199
|
-
//console.log(result);
|
|
200
315
|
chai_1.expect(result.code).to.equal(0);
|
|
201
316
|
return [2 /*return*/];
|
|
202
317
|
}
|
|
203
318
|
});
|
|
204
319
|
}); });
|
|
205
|
-
it('Vote - alice YES', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
206
|
-
var
|
|
320
|
+
it.skip('Vote - alice YES', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
321
|
+
var proposalId, result;
|
|
207
322
|
return __generator(this, function (_a) {
|
|
208
323
|
switch (_a.label) {
|
|
209
|
-
case 0:
|
|
324
|
+
case 0:
|
|
325
|
+
proposalId = tempProposalId;
|
|
326
|
+
return [4 /*yield*/, firma.Gov.vote(aliceWallet, proposalId, common_1.VotingOption.VOTE_OPTION_YES)];
|
|
210
327
|
case 1:
|
|
211
|
-
|
|
328
|
+
result = _a.sent();
|
|
329
|
+
chai_1.expect(result.code).to.equal(0);
|
|
330
|
+
return [2 /*return*/];
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}); });
|
|
334
|
+
it.skip('Vote - bob NO', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
335
|
+
var proposalId, result;
|
|
336
|
+
return __generator(this, function (_a) {
|
|
337
|
+
switch (_a.label) {
|
|
338
|
+
case 0:
|
|
212
339
|
proposalId = tempProposalId;
|
|
213
|
-
return [4 /*yield*/, firma.Gov.vote(
|
|
214
|
-
case
|
|
340
|
+
return [4 /*yield*/, firma.Gov.vote(bobWallet, proposalId, common_1.VotingOption.VOTE_OPTION_NO)];
|
|
341
|
+
case 1:
|
|
215
342
|
result = _a.sent();
|
|
216
|
-
//console.log(result);
|
|
217
343
|
chai_1.expect(result.code).to.equal(0);
|
|
218
344
|
return [2 /*return*/];
|
|
219
345
|
}
|
|
220
346
|
});
|
|
221
347
|
}); });
|
|
222
|
-
it('Vote
|
|
223
|
-
var
|
|
348
|
+
it('SubmitCommunityPoolSpendProposal & Deposit & Vote scenario test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
349
|
+
var initialDepositFCT, title, summary, amountFCT, recipient, result, proposalId, addDepositAmount;
|
|
224
350
|
return __generator(this, function (_a) {
|
|
225
351
|
switch (_a.label) {
|
|
226
|
-
case 0:
|
|
352
|
+
case 0:
|
|
353
|
+
initialDepositFCT = 2500;
|
|
354
|
+
title = "Community spend proposal1";
|
|
355
|
+
summary = "This is a community spend proposal";
|
|
356
|
+
amountFCT = 1000;
|
|
357
|
+
recipient = aliceAddress;
|
|
358
|
+
return [4 /*yield*/, firma.Gov.submitCommunityPoolSpendProposal(aliceWallet, title, summary, initialDepositFCT, amountFCT, recipient)];
|
|
227
359
|
case 1:
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
360
|
+
result = _a.sent();
|
|
361
|
+
chai_1.expect(result.code).to.equal(0);
|
|
362
|
+
proposalId = extractValue(result.events, "submit_proposal", "proposal_id");
|
|
363
|
+
addDepositAmount = 2500;
|
|
364
|
+
return [4 /*yield*/, firma.Gov.deposit(aliceWallet, proposalId, addDepositAmount)];
|
|
231
365
|
case 2:
|
|
232
366
|
result = _a.sent();
|
|
233
|
-
|
|
367
|
+
chai_1.expect(result.code).to.equal(0);
|
|
368
|
+
return [4 /*yield*/, firma.Gov.vote(aliceWallet, proposalId, common_1.VotingOption.VOTE_OPTION_YES)];
|
|
369
|
+
case 3:
|
|
370
|
+
result = _a.sent();
|
|
371
|
+
chai_1.expect(result.code).to.equal(0);
|
|
372
|
+
return [4 /*yield*/, firma.Gov.vote(aliceWallet, proposalId, common_1.VotingOption.VOTE_OPTION_NO)];
|
|
373
|
+
case 4:
|
|
374
|
+
result = _a.sent();
|
|
234
375
|
chai_1.expect(result.code).to.equal(0);
|
|
235
376
|
return [2 /*return*/];
|
|
236
377
|
}
|
|
237
378
|
});
|
|
238
379
|
}); });
|
|
239
|
-
// TODO: more voting case need it!
|
|
240
380
|
});
|
|
@@ -36,6 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var chai_1 = require("chai");
|
|
39
40
|
var gov_1 = require("../sdk/firmachain/gov");
|
|
40
41
|
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
41
42
|
var config_test_1 = require("./config_test");
|
|
@@ -47,12 +48,14 @@ describe('[17. Gov Query Test]', function () {
|
|
|
47
48
|
it('get getProposalList', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
48
49
|
var proposalList;
|
|
49
50
|
return __generator(this, function (_a) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
proposalList = [];
|
|
52
|
+
if (proposalList.length > 0) {
|
|
53
|
+
chai_1.expect(proposalList[0].proposal_id).to.not.equal('');
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
chai_1.expect(proposalList).to.be.deep.equal([]);
|
|
55
57
|
}
|
|
58
|
+
return [2 /*return*/];
|
|
56
59
|
});
|
|
57
60
|
}); });
|
|
58
61
|
it('get getProposalListByStatus', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -64,6 +67,14 @@ describe('[17. Gov Query Test]', function () {
|
|
|
64
67
|
return [4 /*yield*/, firma.Gov.getProposalListByStatus(status)];
|
|
65
68
|
case 1:
|
|
66
69
|
proposalList = _a.sent();
|
|
70
|
+
chai_1.expect(proposalList).to.be.an('array');
|
|
71
|
+
if (proposalList.length > 0) {
|
|
72
|
+
chai_1.expect(proposalList[0]).to.have.property('proposal_id');
|
|
73
|
+
chai_1.expect(proposalList[0].proposal_id).to.not.equal('');
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
chai_1.expect(proposalList).to.have.lengthOf(0);
|
|
77
|
+
}
|
|
67
78
|
return [2 /*return*/];
|
|
68
79
|
}
|
|
69
80
|
});
|
|
@@ -80,8 +91,14 @@ describe('[17. Gov Query Test]', function () {
|
|
|
80
91
|
return [4 /*yield*/, firma.Gov.getProposal(id)];
|
|
81
92
|
case 2:
|
|
82
93
|
proposal = _a.sent();
|
|
83
|
-
|
|
84
|
-
|
|
94
|
+
chai_1.expect(proposal).to.be.an('object');
|
|
95
|
+
chai_1.expect(proposal).to.have.property('proposal_id');
|
|
96
|
+
chai_1.expect(proposal.proposal_id).to.equal(id);
|
|
97
|
+
return [3 /*break*/, 4];
|
|
98
|
+
case 3:
|
|
99
|
+
chai_1.expect(proposalList).to.have.lengthOf(0);
|
|
100
|
+
_a.label = 4;
|
|
101
|
+
case 4: return [2 /*return*/];
|
|
85
102
|
}
|
|
86
103
|
});
|
|
87
104
|
}); });
|
|
@@ -93,6 +110,20 @@ describe('[17. Gov Query Test]', function () {
|
|
|
93
110
|
case 0: return [4 /*yield*/, firma.Gov.getParam()];
|
|
94
111
|
case 1:
|
|
95
112
|
param = _a.sent();
|
|
113
|
+
chai_1.expect(param).to.be.an('object');
|
|
114
|
+
chai_1.expect(param).to.have.property('voting_period');
|
|
115
|
+
chai_1.expect(param).to.have.property('deposit_params');
|
|
116
|
+
chai_1.expect(param.deposit_params).to.have.property('min_deposit');
|
|
117
|
+
chai_1.expect(param.deposit_params).to.have.property('max_deposit_period');
|
|
118
|
+
chai_1.expect(param.deposit_params.min_deposit).to.be.an('array');
|
|
119
|
+
if (param.deposit_params.min_deposit.length > 0) {
|
|
120
|
+
chai_1.expect(param.deposit_params.min_deposit[0]).to.have.property('denom');
|
|
121
|
+
chai_1.expect(param.deposit_params.min_deposit[0]).to.have.property('amount');
|
|
122
|
+
}
|
|
123
|
+
chai_1.expect(param).to.have.property('tally_params');
|
|
124
|
+
chai_1.expect(param.tally_params).to.have.property('quorum');
|
|
125
|
+
chai_1.expect(param.tally_params).to.have.property('threshold');
|
|
126
|
+
chai_1.expect(param.tally_params).to.have.property('veto_threshold');
|
|
96
127
|
return [2 /*return*/];
|
|
97
128
|
}
|
|
98
129
|
});
|
|
@@ -110,8 +141,16 @@ describe('[17. Gov Query Test]', function () {
|
|
|
110
141
|
return [4 /*yield*/, firma.Gov.getCurrentVoteInfo(proposalId)];
|
|
111
142
|
case 2:
|
|
112
143
|
param = _a.sent();
|
|
113
|
-
|
|
114
|
-
|
|
144
|
+
chai_1.expect(param).to.be.an('object');
|
|
145
|
+
chai_1.expect(param).to.have.property('yes');
|
|
146
|
+
chai_1.expect(param).to.have.property('abstain');
|
|
147
|
+
chai_1.expect(param).to.have.property('no');
|
|
148
|
+
chai_1.expect(param).to.have.property('no_with_veto');
|
|
149
|
+
return [3 /*break*/, 4];
|
|
150
|
+
case 3:
|
|
151
|
+
chai_1.expect(proposalList).to.have.lengthOf(0);
|
|
152
|
+
_a.label = 4;
|
|
153
|
+
case 4: return [2 /*return*/];
|
|
115
154
|
}
|
|
116
155
|
});
|
|
117
156
|
}); });
|
|
@@ -38,7 +38,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var chai_1 = require("chai");
|
|
40
40
|
var FirmaUtil_1 = require("../sdk/FirmaUtil");
|
|
41
|
+
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
42
|
+
var config_test_1 = require("./config_test");
|
|
41
43
|
describe('[18. util Test]', function () {
|
|
44
|
+
var firma;
|
|
45
|
+
beforeEach(function () {
|
|
46
|
+
firma = new FirmaSDK_1.FirmaSDK(config_test_1.TestChainConfig);
|
|
47
|
+
});
|
|
42
48
|
// getHashFromString
|
|
43
49
|
it('getSha1HashFromString test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
44
50
|
var contractName, result;
|
|
@@ -89,7 +95,6 @@ describe('[18. util Test]', function () {
|
|
|
89
95
|
consensusPubkey = "InWhZBMP3wKQkwIBCrVqQ+BNoPhV5mTjpwiYHKHCZ/k=";
|
|
90
96
|
valconsAddress = "firmavalcons1fh73gr3f9df7yc390ykdnmeedetlw5ll3dqwje";
|
|
91
97
|
result = FirmaUtil_1.FirmaUtil.getValConsAddressFromAccAddress(consensusPubkey);
|
|
92
|
-
//console.log(result);
|
|
93
98
|
chai_1.expect(result).to.be.equal(valconsAddress);
|
|
94
99
|
return [2 /*return*/];
|
|
95
100
|
});
|