@firmachain/firma-js 0.3.3 → 0.3.5
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/dist/index.js +5 -1
- package/dist/sdk/FirmaAuthzService.d.ts +8 -7
- package/dist/sdk/FirmaAuthzService.js +12 -22
- package/dist/sdk/FirmaBankService.js +2 -2
- package/dist/sdk/FirmaChainService.js +1 -1
- package/dist/sdk/FirmaContractService.d.ts +1 -1
- package/dist/sdk/FirmaContractService.js +6 -6
- package/dist/sdk/FirmaCosmWasmCw20.d.ts +2 -2
- package/dist/sdk/FirmaCosmWasmCw20.js +8 -8
- package/dist/sdk/FirmaCosmWasmCw721.d.ts +2 -2
- package/dist/sdk/FirmaCosmWasmCw721.js +12 -12
- package/dist/sdk/FirmaCosmWasmCwBridge.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmCwBridge.js +8 -8
- package/dist/sdk/FirmaCosmWasmCwMarketplace.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmCwMarketplace.js +5 -5
- package/dist/sdk/FirmaCosmWasmService.d.ts +1 -1
- package/dist/sdk/FirmaCosmWasmService.js +13 -13
- package/dist/sdk/FirmaDistributionService.d.ts +1 -1
- package/dist/sdk/FirmaDistributionService.js +6 -6
- package/dist/sdk/FirmaFeeGrantService.d.ts +7 -6
- package/dist/sdk/FirmaFeeGrantService.js +9 -26
- package/dist/sdk/FirmaGovService.d.ts +1 -1
- package/dist/sdk/FirmaGovService.js +14 -14
- package/dist/sdk/FirmaIbcService.d.ts +3 -3
- package/dist/sdk/FirmaIbcService.js +11 -8
- package/dist/sdk/FirmaIpfsService.js +1 -1
- package/dist/sdk/FirmaMintService.js +1 -1
- package/dist/sdk/FirmaNftService.d.ts +1 -1
- package/dist/sdk/FirmaNftService.js +6 -6
- package/dist/sdk/FirmaSlashingService.js +1 -1
- package/dist/sdk/FirmaStakingService.d.ts +3 -3
- package/dist/sdk/FirmaStakingService.js +6 -6
- package/dist/sdk/FirmaTokenService.d.ts +1 -1
- package/dist/sdk/FirmaTokenService.js +5 -5
- package/dist/sdk/FirmaUtil.d.ts +25 -24
- package/dist/sdk/FirmaUtil.js +200 -145
- package/dist/sdk/FirmaWalletService.d.ts +6 -7
- package/dist/sdk/FirmaWalletService.js +78 -36
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +4 -4
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +8 -11
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +6 -10
- package/dist/sdk/firmachain/authz/index.js +5 -1
- package/dist/sdk/firmachain/bank/BankQueryClient.js +5 -5
- package/dist/sdk/firmachain/bank/index.js +5 -1
- package/dist/sdk/firmachain/common/ITxClient.d.ts +2 -4
- package/dist/sdk/firmachain/common/ITxClient.js +20 -92
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +19 -3
- package/dist/sdk/firmachain/common/LedgerWallet.js +138 -68
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +1 -1
- package/dist/sdk/firmachain/common/TxCommon.d.ts +13 -29
- package/dist/sdk/firmachain/common/accounts.d.ts +1 -1
- package/dist/sdk/firmachain/common/accounts.js +7 -7
- package/dist/sdk/firmachain/{amino → common}/coins.d.ts +2 -14
- package/dist/sdk/firmachain/{amino → common}/coins.js +4 -25
- package/dist/sdk/firmachain/common/index.d.ts +0 -1
- package/dist/sdk/firmachain/common/index.js +5 -4
- package/dist/sdk/firmachain/{amino → common}/wallet.js +15 -11
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +3 -3
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +6 -6
- package/dist/sdk/firmachain/contract/index.js +5 -1
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +9 -9
- package/dist/sdk/firmachain/cosmwasm/index.js +5 -1
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +6 -6
- package/dist/sdk/firmachain/distribution/index.js +5 -1
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +3 -3
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +4 -45
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +3 -82
- package/dist/sdk/firmachain/feegrant/index.js +5 -1
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +3 -3
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +29 -29
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +3 -3
- package/dist/sdk/firmachain/gov/GovQueryClient.js +3 -3
- package/dist/sdk/firmachain/gov/index.js +5 -1
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +2 -2
- package/dist/sdk/firmachain/ibc/index.js +5 -1
- package/dist/sdk/firmachain/mint/MintQueryClient.js +1 -1
- package/dist/sdk/firmachain/mint/index.js +5 -1
- package/dist/sdk/firmachain/nft/NftQueryClient.js +1 -1
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +8 -8
- package/dist/sdk/firmachain/nft/index.js +5 -1
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +1 -1
- package/dist/sdk/firmachain/slashing/index.js +5 -1
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +2 -2
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +10 -9
- package/dist/sdk/firmachain/staking/index.js +5 -1
- package/dist/sdk/firmachain/token/TokenQueryClient.js +1 -1
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +11 -11
- package/dist/sdk/firmachain/token/TokenTxTypes.js +1 -1
- package/dist/sdk/firmachain/token/index.js +5 -1
- package/dist/test/00.wallet.test.js +4 -4
- package/dist/test/01.contract_tx.test.js +5 -5
- package/dist/test/02.contract_query.test.js +15 -15
- package/dist/test/03.contract_scenario.test.js +28 -28
- package/dist/test/04.bank_tx.test.js +4 -4
- package/dist/test/05.bank_query.test.js +9 -9
- package/dist/test/06.feegrant_tx.test.js +59 -35
- package/dist/test/07.feegrant_query.test.js +18 -15
- package/dist/test/08.gas_estimate.test.js +110 -70
- package/dist/test/09.ipfs.test.js +4 -4
- package/dist/test/10.nft_tx.test.js +7 -7
- package/dist/test/11.nft_query.test.js +9 -9
- package/dist/test/12.staking_tx.test.js +27 -15
- package/dist/test/13.staking_query.test.js +20 -20
- package/dist/test/14.distribution_tx.test.js +8 -8
- package/dist/test/15.distribution_query.test.js +15 -15
- package/dist/test/16.gov_tx.test.js +17 -17
- package/dist/test/17.gov_query.test.js +19 -19
- package/dist/test/18.util.test.js +105 -63
- package/dist/test/19.chain.test.js +38 -38
- package/dist/test/20.slashing_query.test.js +25 -25
- package/dist/test/21.token_tx.test.js +6 -6
- package/dist/test/22.token_query.test.js +4 -4
- package/dist/test/23.authz_tx.test.js +77 -47
- package/dist/test/24.authz_query.test.js +66 -67
- package/dist/test/25.cosmwasm_tx.test.js +7 -7
- package/dist/test/26.cosmwasm_query.test.js +127 -59
- package/dist/test/{27.arbitary_sign.test.js → 27.arbitrary_sign.test.js} +34 -62
- package/dist/test/28.ibc_tx.test.js +8 -8
- package/dist/test/29.mint_query.test.js +2 -2
- package/dist/test/30.cw20_tx.test.js +20 -20
- package/dist/test/31.cw20_query.test.js +24 -24
- package/dist/test/32.cw721_tx.test.js +19 -19
- package/dist/test/33.cw721_query.test.js +32 -32
- package/dist/test/34.cw_bridge_tx.test.js +19 -19
- package/dist/test/35.cw_bridge_tx_low.test.js +13 -13
- package/dist/test/36.cw_bridge_query.test.js +20 -20
- package/dist/test/37.cw_marketplace_tx.test.js +32 -32
- package/dist/test/38.cw_marketplace_query.test.js +2 -2
- package/dist/test/config_test.d.ts +1 -1
- package/dist/test/config_test.js +2 -2
- package/package.json +9 -10
- package/dist/sdk/firmachain/amino/addresses.d.ts +0 -5
- package/dist/sdk/firmachain/amino/addresses.js +0 -46
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +0 -291
- package/dist/sdk/firmachain/amino/aminomsgs.js +0 -81
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +0 -22
- package/dist/sdk/firmachain/amino/aminotypes.js +0 -538
- package/dist/sdk/firmachain/amino/encoding.d.ts +0 -33
- package/dist/sdk/firmachain/amino/encoding.js +0 -252
- package/dist/sdk/firmachain/amino/multisig.d.ts +0 -10
- package/dist/sdk/firmachain/amino/multisig.js +0 -42
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +0 -47
- package/dist/sdk/firmachain/amino/pubkeys.js +0 -29
- package/dist/sdk/firmachain/amino/signature.d.ts +0 -16
- package/dist/sdk/firmachain/amino/signature.js +0 -36
- package/dist/sdk/firmachain/amino/signdoc.d.ts +0 -44
- package/dist/sdk/firmachain/amino/signdoc.js +0 -68
- package/dist/sdk/firmachain/amino/signer.d.ts +0 -33
- package/dist/sdk/firmachain/amino/signer.js +0 -2
- package/dist/sdk/firmachain/amino/stdtx.d.ts +0 -15
- package/dist/sdk/firmachain/amino/stdtx.js +0 -17
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +0 -22
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +0 -170
- package/dist/sdk/firmachain/common/aminotypes.d.ts +0 -19
- package/dist/sdk/firmachain/common/aminotypes.js +0 -74
- package/dist/sdk/firmachain/common/events.d.ts +0 -32
- package/dist/sdk/firmachain/common/events.js +0 -18
- package/dist/sdk/firmachain/common/fee.d.ts +0 -26
- package/dist/sdk/firmachain/common/fee.js +0 -83
- package/dist/sdk/firmachain/common/modules/auth/queries.d.ts +0 -15
- package/dist/sdk/firmachain/common/modules/auth/queries.js +0 -64
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/authz/aminomessages.js +0 -15
- package/dist/sdk/firmachain/common/modules/authz/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/authz/messages.js +0 -9
- package/dist/sdk/firmachain/common/modules/authz/queries.d.ts +0 -10
- package/dist/sdk/firmachain/common/modules/authz/queries.js +0 -88
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.d.ts +0 -35
- package/dist/sdk/firmachain/common/modules/bank/aminomessages.js +0 -85
- package/dist/sdk/firmachain/common/modules/bank/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/bank/messages.js +0 -12
- package/dist/sdk/firmachain/common/modules/bank/queries.d.ts +0 -15
- package/dist/sdk/firmachain/common/modules/bank/queries.js +0 -128
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.d.ts +0 -14
- package/dist/sdk/firmachain/common/modules/crisis/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.d.ts +0 -44
- package/dist/sdk/firmachain/common/modules/distribution/aminomessages.js +0 -113
- package/dist/sdk/firmachain/common/modules/distribution/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/distribution/messages.js +0 -15
- package/dist/sdk/firmachain/common/modules/distribution/queries.d.ts +0 -16
- package/dist/sdk/firmachain/common/modules/distribution/queries.js +0 -171
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.d.ts +0 -18
- package/dist/sdk/firmachain/common/modules/evidence/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/feegrant/aminomessages.js +0 -14
- package/dist/sdk/firmachain/common/modules/feegrant/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/feegrant/messages.js +0 -8
- package/dist/sdk/firmachain/common/modules/feegrant/queries.d.ts +0 -9
- package/dist/sdk/firmachain/common/modules/feegrant/queries.js +0 -81
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.d.ts +0 -79
- package/dist/sdk/firmachain/common/modules/gov/aminomessages.js +0 -152
- package/dist/sdk/firmachain/common/modules/gov/messages.d.ts +0 -29
- package/dist/sdk/firmachain/common/modules/gov/messages.js +0 -39
- package/dist/sdk/firmachain/common/modules/gov/queries.d.ts +0 -19
- package/dist/sdk/firmachain/common/modules/gov/queries.js +0 -160
- package/dist/sdk/firmachain/common/modules/group/aminomessages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/group/aminomessages.js +0 -8
- package/dist/sdk/firmachain/common/modules/group/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/group/messages.js +0 -28
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.d.ts +0 -38
- package/dist/sdk/firmachain/common/modules/ibc/aminomessages.js +0 -55
- package/dist/sdk/firmachain/common/modules/ibc/messages.d.ts +0 -8
- package/dist/sdk/firmachain/common/modules/ibc/messages.js +0 -32
- package/dist/sdk/firmachain/common/modules/ibc/queries.d.ts +0 -58
- package/dist/sdk/firmachain/common/modules/ibc/queries.js +0 -576
- package/dist/sdk/firmachain/common/modules/index.d.ts +0 -32
- package/dist/sdk/firmachain/common/modules/index.js +0 -101
- package/dist/sdk/firmachain/common/modules/mint/queries.d.ts +0 -21
- package/dist/sdk/firmachain/common/modules/mint/queries.js +0 -95
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.d.ts +0 -12
- package/dist/sdk/firmachain/common/modules/slashing/aminomessages.js +0 -11
- package/dist/sdk/firmachain/common/modules/slashing/queries.d.ts +0 -10
- package/dist/sdk/firmachain/common/modules/slashing/queries.js +0 -88
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.d.ts +0 -112
- package/dist/sdk/firmachain/common/modules/staking/aminomessages.js +0 -234
- package/dist/sdk/firmachain/common/modules/staking/messages.d.ts +0 -33
- package/dist/sdk/firmachain/common/modules/staking/messages.js +0 -37
- package/dist/sdk/firmachain/common/modules/staking/queries.d.ts +0 -23
- package/dist/sdk/firmachain/common/modules/staking/queries.js +0 -242
- package/dist/sdk/firmachain/common/modules/tx/queries.d.ts +0 -11
- package/dist/sdk/firmachain/common/modules/tx/queries.js +0 -103
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.d.ts +0 -16
- package/dist/sdk/firmachain/common/modules/vesting/aminomessages.js +0 -56
- package/dist/sdk/firmachain/common/modules/vesting/messages.d.ts +0 -2
- package/dist/sdk/firmachain/common/modules/vesting/messages.js +0 -7
- package/dist/sdk/firmachain/common/queryclient/index.d.ts +0 -2
- package/dist/sdk/firmachain/common/queryclient/index.js +0 -10
- package/dist/sdk/firmachain/common/queryclient/queryclient.d.ts +0 -75
- package/dist/sdk/firmachain/common/queryclient/queryclient.js +0 -157
- package/dist/sdk/firmachain/common/queryclient/utils.d.ts +0 -33
- package/dist/sdk/firmachain/common/queryclient/utils.js +0 -101
- package/dist/sdk/firmachain/common/search.d.ts +0 -10
- package/dist/sdk/firmachain/common/search.js +0 -7
- package/dist/sdk/firmachain/common/signing.d.ts +0 -15
- package/dist/sdk/firmachain/common/signing.js +0 -87
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +0 -121
- package/dist/sdk/firmachain/common/signingstargateclient.js +0 -674
- package/dist/sdk/firmachain/common/stargateclient.d.ts +0 -210
- package/dist/sdk/firmachain/common/stargateclient.js +0 -527
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +0 -110
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +0 -108
- /package/dist/sdk/firmachain/{amino → common}/paths.d.ts +0 -0
- /package/dist/sdk/firmachain/{amino → common}/paths.js +0 -0
- /package/dist/sdk/firmachain/{amino → common}/wallet.d.ts +0 -0
- /package/dist/test/{27.arbitary_sign.test.d.ts → 27.arbitrary_sign.test.d.ts} +0 -0
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -35,6 +35,17 @@ 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 FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
@@ -53,12 +64,12 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
53
64
|
case 0: return [4 /*yield*/, firma.CosmWasm.getCodeList()];
|
|
54
65
|
case 1:
|
|
55
66
|
result = _a.sent();
|
|
56
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
67
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
57
68
|
codeId = result[0].code_id;
|
|
58
69
|
codeInfo = result[0];
|
|
59
|
-
chai_1.expect(codeInfo).to.have.property('code_id');
|
|
60
|
-
chai_1.expect(codeInfo).to.have.property('creator');
|
|
61
|
-
chai_1.expect(codeInfo).to.have.property('data_hash');
|
|
70
|
+
(0, chai_1.expect)(codeInfo).to.have.property('code_id');
|
|
71
|
+
(0, chai_1.expect)(codeInfo).to.have.property('creator');
|
|
72
|
+
(0, chai_1.expect)(codeInfo).to.have.property('data_hash');
|
|
62
73
|
return [2 /*return*/];
|
|
63
74
|
}
|
|
64
75
|
});
|
|
@@ -70,14 +81,14 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
70
81
|
case 0: return [4 /*yield*/, firma.CosmWasm.getCodeData(codeId)];
|
|
71
82
|
case 1:
|
|
72
83
|
result = _a.sent();
|
|
73
|
-
chai_1.expect(result).to.not.be.null;
|
|
74
|
-
chai_1.expect(result).to.have.property('code_info');
|
|
75
|
-
chai_1.expect(result).to.have.property('data');
|
|
84
|
+
(0, chai_1.expect)(result).to.not.be.null;
|
|
85
|
+
(0, chai_1.expect)(result).to.have.property('code_info');
|
|
86
|
+
(0, chai_1.expect)(result).to.have.property('data');
|
|
76
87
|
codeInfo = result.code_info;
|
|
77
|
-
chai_1.expect(codeInfo).to.have.property('code_id', codeId);
|
|
78
|
-
chai_1.expect(codeInfo).to.have.property('creator');
|
|
79
|
-
chai_1.expect(codeInfo).to.have.property('data_hash');
|
|
80
|
-
chai_1.expect(result.data).to.be.a('string');
|
|
88
|
+
(0, chai_1.expect)(codeInfo).to.have.property('code_id', codeId);
|
|
89
|
+
(0, chai_1.expect)(codeInfo).to.have.property('creator');
|
|
90
|
+
(0, chai_1.expect)(codeInfo).to.have.property('data_hash');
|
|
91
|
+
(0, chai_1.expect)(result.data).to.be.a('string');
|
|
81
92
|
return [2 /*return*/];
|
|
82
93
|
}
|
|
83
94
|
});
|
|
@@ -89,14 +100,14 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
89
100
|
case 0: return [4 /*yield*/, firma.CosmWasm.getContractListFromCodeId(codeId)];
|
|
90
101
|
case 1:
|
|
91
102
|
result = _a.sent();
|
|
92
|
-
chai_1.expect(result).to.not.be.null;
|
|
93
|
-
chai_1.expect(result).to.have.property('dataList');
|
|
94
|
-
chai_1.expect(result).to.have.property('pagination');
|
|
95
|
-
chai_1.expect(result.dataList).to.be.an('array');
|
|
96
|
-
chai_1.expect(result.dataList.length).to.be.greaterThan(0);
|
|
97
|
-
chai_1.expect(result.dataList[0]).to.be.a('string');
|
|
98
|
-
chai_1.expect(result.pagination).to.have.property('next_key');
|
|
99
|
-
chai_1.expect(result.pagination).to.have.property('total');
|
|
103
|
+
(0, chai_1.expect)(result).to.not.be.null;
|
|
104
|
+
(0, chai_1.expect)(result).to.have.property('dataList');
|
|
105
|
+
(0, chai_1.expect)(result).to.have.property('pagination');
|
|
106
|
+
(0, chai_1.expect)(result.dataList).to.be.an('array');
|
|
107
|
+
(0, chai_1.expect)(result.dataList.length).to.be.greaterThan(0);
|
|
108
|
+
(0, chai_1.expect)(result.dataList[0]).to.be.a('string');
|
|
109
|
+
(0, chai_1.expect)(result.pagination).to.have.property('next_key');
|
|
110
|
+
(0, chai_1.expect)(result.pagination).to.have.property('total');
|
|
100
111
|
contractAddress = result.dataList[0];
|
|
101
112
|
return [2 /*return*/];
|
|
102
113
|
}
|
|
@@ -109,7 +120,7 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
109
120
|
case 0: return [4 /*yield*/, firma.CosmWasm.getPinnedCodeList()];
|
|
110
121
|
case 1:
|
|
111
122
|
codeList = _a.sent();
|
|
112
|
-
chai_1.expect(codeList).to.be.an('array');
|
|
123
|
+
(0, chai_1.expect)(codeList).to.be.an('array');
|
|
113
124
|
return [2 /*return*/];
|
|
114
125
|
}
|
|
115
126
|
});
|
|
@@ -122,19 +133,19 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
122
133
|
case 0: return [4 /*yield*/, firma.CosmWasm.getContractInfo(contractAddress)];
|
|
123
134
|
case 1:
|
|
124
135
|
result = _a.sent();
|
|
125
|
-
chai_1.expect(result).to.not.be.null;
|
|
126
|
-
chai_1.expect(result).to.have.property('address', contractAddress);
|
|
127
|
-
chai_1.expect(result).to.have.property('contract_info');
|
|
136
|
+
(0, chai_1.expect)(result).to.not.be.null;
|
|
137
|
+
(0, chai_1.expect)(result).to.have.property('address', contractAddress);
|
|
138
|
+
(0, chai_1.expect)(result).to.have.property('contract_info');
|
|
128
139
|
contractInfo = result.contract_info;
|
|
129
|
-
chai_1.expect(contractInfo).to.have.property('code_id');
|
|
130
|
-
chai_1.expect(contractInfo).to.have.property('creator');
|
|
131
|
-
chai_1.expect(contractInfo).to.have.property('admin');
|
|
132
|
-
chai_1.expect(contractInfo).to.have.property('label');
|
|
133
|
-
chai_1.expect(contractInfo).to.have.property('created');
|
|
134
|
-
chai_1.expect(contractInfo).to.have.property('ibc_port_id');
|
|
135
|
-
chai_1.expect(contractInfo).to.have.property('extension');
|
|
136
|
-
chai_1.expect(contractInfo.created).to.have.property('block_height');
|
|
137
|
-
chai_1.expect(contractInfo.created).to.have.property('tx_index');
|
|
140
|
+
(0, chai_1.expect)(contractInfo).to.have.property('code_id');
|
|
141
|
+
(0, chai_1.expect)(contractInfo).to.have.property('creator');
|
|
142
|
+
(0, chai_1.expect)(contractInfo).to.have.property('admin');
|
|
143
|
+
(0, chai_1.expect)(contractInfo).to.have.property('label');
|
|
144
|
+
(0, chai_1.expect)(contractInfo).to.have.property('created');
|
|
145
|
+
(0, chai_1.expect)(contractInfo).to.have.property('ibc_port_id');
|
|
146
|
+
(0, chai_1.expect)(contractInfo).to.have.property('extension');
|
|
147
|
+
(0, chai_1.expect)(contractInfo.created).to.have.property('block_height');
|
|
148
|
+
(0, chai_1.expect)(contractInfo.created).to.have.property('tx_index');
|
|
138
149
|
return [2 /*return*/];
|
|
139
150
|
}
|
|
140
151
|
});
|
|
@@ -146,17 +157,10 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
146
157
|
case 0: return [4 /*yield*/, firma.CosmWasm.getContractHistory(contractAddress)];
|
|
147
158
|
case 1:
|
|
148
159
|
result = _a.sent();
|
|
149
|
-
chai_1.expect(result).to.be.an('array');
|
|
150
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
160
|
+
(0, chai_1.expect)(result).to.be.an('array');
|
|
161
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
151
162
|
history = result[0];
|
|
152
|
-
chai_1.expect(history).to.
|
|
153
|
-
chai_1.expect(history).to.have.property('code_id');
|
|
154
|
-
chai_1.expect(history).to.have.property('updated');
|
|
155
|
-
chai_1.expect(history).to.have.property('msg');
|
|
156
|
-
chai_1.expect(history.updated).to.have.property('block_height');
|
|
157
|
-
chai_1.expect(history.updated).to.have.property('tx_index');
|
|
158
|
-
chai_1.expect(history.msg).to.have.property('purchase_price');
|
|
159
|
-
chai_1.expect(history.msg).to.have.property('transfer_price');
|
|
163
|
+
(0, chai_1.expect)(history.code_id).to.be.equal(codeId);
|
|
160
164
|
return [2 /*return*/];
|
|
161
165
|
}
|
|
162
166
|
});
|
|
@@ -169,39 +173,103 @@ describe('[26. cosmwasm query Test]', function () {
|
|
|
169
173
|
case 0: return [4 /*yield*/, firma.CosmWasm.getContractState(contractAddress)];
|
|
170
174
|
case 1:
|
|
171
175
|
result = _a.sent();
|
|
172
|
-
chai_1.expect(result).to.be.an('array');
|
|
173
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
176
|
+
(0, chai_1.expect)(result).to.be.an('array');
|
|
177
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
174
178
|
model = result[0];
|
|
175
|
-
chai_1.expect(model).to.have.property('key');
|
|
176
|
-
chai_1.expect(model).to.have.property('value');
|
|
179
|
+
(0, chai_1.expect)(model).to.have.property('key');
|
|
180
|
+
(0, chai_1.expect)(model).to.have.property('value');
|
|
177
181
|
return [2 /*return*/];
|
|
178
182
|
}
|
|
179
183
|
});
|
|
180
184
|
}); });
|
|
181
185
|
it('CosmWasm getContractRawQueryData', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
182
|
-
var
|
|
186
|
+
var stateResult, firstKey, result, error_1;
|
|
183
187
|
return __generator(this, function (_a) {
|
|
184
188
|
switch (_a.label) {
|
|
185
189
|
case 0:
|
|
186
|
-
|
|
187
|
-
return [4 /*yield*/, firma.CosmWasm.
|
|
190
|
+
_a.trys.push([0, 3, , 4]);
|
|
191
|
+
return [4 /*yield*/, firma.CosmWasm.getContractState(contractAddress)];
|
|
188
192
|
case 1:
|
|
193
|
+
stateResult = _a.sent();
|
|
194
|
+
if (!stateResult || stateResult.length === 0) {
|
|
195
|
+
return [2 /*return*/];
|
|
196
|
+
}
|
|
197
|
+
firstKey = stateResult[0].key;
|
|
198
|
+
return [4 /*yield*/, firma.CosmWasm.getContractRawQueryData(contractAddress, firstKey)];
|
|
199
|
+
case 2:
|
|
189
200
|
result = _a.sent();
|
|
190
|
-
chai_1.expect(result).to.be.a('string');
|
|
191
|
-
|
|
201
|
+
(0, chai_1.expect)(result).to.be.a('string');
|
|
202
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
203
|
+
(0, chai_1.expect)(result).to.match(/^[0-9A-Fa-f]*$/);
|
|
204
|
+
return [3 /*break*/, 4];
|
|
205
|
+
case 3:
|
|
206
|
+
error_1 = _a.sent();
|
|
207
|
+
return [3 /*break*/, 4];
|
|
208
|
+
case 4: return [2 /*return*/];
|
|
192
209
|
}
|
|
193
210
|
});
|
|
194
211
|
}); });
|
|
195
212
|
it('CosmWasm getContractSmartQueryData', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
196
|
-
var query,
|
|
197
|
-
|
|
198
|
-
|
|
213
|
+
var queries, successfulQuery, result, queries_1, queries_1_1, query, error_2, e_1_1, parsedResult;
|
|
214
|
+
var e_1, _a;
|
|
215
|
+
return __generator(this, function (_b) {
|
|
216
|
+
switch (_b.label) {
|
|
199
217
|
case 0:
|
|
200
|
-
|
|
201
|
-
|
|
218
|
+
queries = [
|
|
219
|
+
'{"token_info":{}}',
|
|
220
|
+
'{"minter":{}}',
|
|
221
|
+
'{"marketing_info":{}}'
|
|
222
|
+
];
|
|
223
|
+
successfulQuery = null;
|
|
224
|
+
result = null;
|
|
225
|
+
_b.label = 1;
|
|
202
226
|
case 1:
|
|
203
|
-
|
|
204
|
-
|
|
227
|
+
_b.trys.push([1, 8, 9, 10]);
|
|
228
|
+
queries_1 = __values(queries), queries_1_1 = queries_1.next();
|
|
229
|
+
_b.label = 2;
|
|
230
|
+
case 2:
|
|
231
|
+
if (!!queries_1_1.done) return [3 /*break*/, 7];
|
|
232
|
+
query = queries_1_1.value;
|
|
233
|
+
_b.label = 3;
|
|
234
|
+
case 3:
|
|
235
|
+
_b.trys.push([3, 5, , 6]);
|
|
236
|
+
return [4 /*yield*/, firma.CosmWasm.getContractSmartQueryData(contractAddress, query)];
|
|
237
|
+
case 4:
|
|
238
|
+
result = _b.sent();
|
|
239
|
+
successfulQuery = query;
|
|
240
|
+
return [3 /*break*/, 7];
|
|
241
|
+
case 5:
|
|
242
|
+
error_2 = _b.sent();
|
|
243
|
+
return [3 /*break*/, 6];
|
|
244
|
+
case 6:
|
|
245
|
+
queries_1_1 = queries_1.next();
|
|
246
|
+
return [3 /*break*/, 2];
|
|
247
|
+
case 7: return [3 /*break*/, 10];
|
|
248
|
+
case 8:
|
|
249
|
+
e_1_1 = _b.sent();
|
|
250
|
+
e_1 = { error: e_1_1 };
|
|
251
|
+
return [3 /*break*/, 10];
|
|
252
|
+
case 9:
|
|
253
|
+
try {
|
|
254
|
+
if (queries_1_1 && !queries_1_1.done && (_a = queries_1.return)) _a.call(queries_1);
|
|
255
|
+
}
|
|
256
|
+
finally { if (e_1) throw e_1.error; }
|
|
257
|
+
return [7 /*endfinally*/];
|
|
258
|
+
case 10:
|
|
259
|
+
(0, chai_1.expect)(successfulQuery).to.not.be.null;
|
|
260
|
+
(0, chai_1.expect)(result).to.not.be.null;
|
|
261
|
+
if (result) {
|
|
262
|
+
(0, chai_1.expect)(result).to.be.a('string');
|
|
263
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
264
|
+
parsedResult = JSON.parse(result);
|
|
265
|
+
(0, chai_1.expect)(parsedResult).to.be.an('object');
|
|
266
|
+
if (successfulQuery === '{"token_info":{}}') {
|
|
267
|
+
(0, chai_1.expect)(parsedResult).to.have.property('name');
|
|
268
|
+
(0, chai_1.expect)(parsedResult).to.have.property('symbol');
|
|
269
|
+
(0, chai_1.expect)(parsedResult).to.have.property('decimals');
|
|
270
|
+
(0, chai_1.expect)(parsedResult).to.have.property('total_supply');
|
|
271
|
+
}
|
|
272
|
+
}
|
|
205
273
|
return [2 /*return*/];
|
|
206
274
|
}
|
|
207
275
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -39,15 +39,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var chai_1 = require("chai");
|
|
40
40
|
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
41
41
|
var FirmaUtil_1 = require("../sdk/FirmaUtil");
|
|
42
|
-
var bank_1 = require("../sdk/firmachain/bank");
|
|
43
42
|
var config_test_1 = require("./config_test");
|
|
44
|
-
|
|
43
|
+
var encoding_1 = require("@cosmjs/encoding");
|
|
44
|
+
describe('[27. protobuf arbitrary sign]', function () {
|
|
45
45
|
var firma;
|
|
46
46
|
var aliceWallet;
|
|
47
47
|
var bobWallet;
|
|
48
48
|
var aliceAddress;
|
|
49
49
|
var bobAddress;
|
|
50
|
-
var alicePubkey;
|
|
51
50
|
beforeEach(function () {
|
|
52
51
|
return __awaiter(this, void 0, void 0, function () {
|
|
53
52
|
return __generator(this, function (_a) {
|
|
@@ -66,92 +65,65 @@ describe('[27. arbitary sign]', function () {
|
|
|
66
65
|
return [4 /*yield*/, bobWallet.getAddress()];
|
|
67
66
|
case 4:
|
|
68
67
|
bobAddress = _a.sent();
|
|
69
|
-
return [4 /*yield*/, aliceWallet.getPubKey()];
|
|
70
|
-
case 5:
|
|
71
|
-
alicePubkey = _a.sent();
|
|
72
68
|
return [2 /*return*/];
|
|
73
69
|
}
|
|
74
70
|
});
|
|
75
71
|
});
|
|
76
72
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// https://github.com/cosmos/cosmjs/pull/847
|
|
80
|
-
it('arbitary sign & verify basic test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
81
|
-
var testMsg, signatureResult, jsonString, finalData, isMatch;
|
|
73
|
+
it('protobuf arbitrary sign & verify basic test', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
+
var testMsg, testBytes, result, isValid;
|
|
82
75
|
return __generator(this, function (_a) {
|
|
83
76
|
switch (_a.label) {
|
|
84
77
|
case 0:
|
|
85
|
-
testMsg = "
|
|
86
|
-
|
|
78
|
+
testMsg = "be14202e-46dc-4d38-924c-65db209ea2fb";
|
|
79
|
+
testBytes = (0, encoding_1.toUtf8)(testMsg);
|
|
80
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitrarySign(aliceWallet, aliceAddress, testBytes)];
|
|
87
81
|
case 1:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
finalData = JSON.parse(jsonString);
|
|
91
|
-
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.experimentalAdr36Verify(finalData, testMsg)];
|
|
82
|
+
result = _a.sent();
|
|
83
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitraryVerify(result, testBytes)];
|
|
92
84
|
case 2:
|
|
93
|
-
|
|
94
|
-
chai_1.expect(
|
|
85
|
+
isValid = _a.sent();
|
|
86
|
+
(0, chai_1.expect)(isValid).to.be.equal(true);
|
|
95
87
|
return [2 /*return*/];
|
|
96
88
|
}
|
|
97
89
|
});
|
|
98
90
|
}); });
|
|
99
|
-
it('
|
|
100
|
-
var
|
|
91
|
+
it('protobuf arbitrary sign - tampered message should fail', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
92
|
+
var testMsg, testBytes, result, tamperedBytes, isValid;
|
|
101
93
|
return __generator(this, function (_a) {
|
|
102
94
|
switch (_a.label) {
|
|
103
95
|
case 0:
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
fromAddress: aliceAddress,
|
|
108
|
-
toAddress: bobAddress,
|
|
109
|
-
amount: [sendAmount]
|
|
110
|
-
});
|
|
111
|
-
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.makeSignDoc(aliceAddress, alicePubkey, [msgSend])];
|
|
96
|
+
testMsg = "original-message";
|
|
97
|
+
testBytes = (0, encoding_1.toUtf8)(testMsg);
|
|
98
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitrarySign(aliceWallet, aliceAddress, testBytes)];
|
|
112
99
|
case 1:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return [4 /*yield*/,
|
|
100
|
+
result = _a.sent();
|
|
101
|
+
tamperedBytes = (0, encoding_1.toUtf8)("modified-message");
|
|
102
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitraryVerify(result, tamperedBytes)];
|
|
116
103
|
case 2:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.verifyDirectSignature(aliceAddress, signatureBase64, signDoc)];
|
|
120
|
-
case 3:
|
|
121
|
-
valid = _a.sent();
|
|
122
|
-
chai_1.expect(valid).to.be.equal(true);
|
|
104
|
+
isValid = _a.sent();
|
|
105
|
+
(0, chai_1.expect)(isValid).to.be.equal(false);
|
|
123
106
|
return [2 /*return*/];
|
|
124
107
|
}
|
|
125
108
|
});
|
|
126
109
|
}); });
|
|
127
|
-
it('
|
|
128
|
-
var
|
|
110
|
+
it('protobuf arbitrary sign - tampered signature should fail', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
111
|
+
var testMsg, testBytes, result, isValid;
|
|
129
112
|
return __generator(this, function (_a) {
|
|
130
113
|
switch (_a.label) {
|
|
131
114
|
case 0:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
fromAddress: aliceAddress,
|
|
136
|
-
toAddress: bobAddress,
|
|
137
|
-
amount: [sendAmount]
|
|
138
|
-
});
|
|
139
|
-
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.makeSignDoc(aliceAddress, alicePubkey, [msgSend])];
|
|
115
|
+
testMsg = "integrity-check";
|
|
116
|
+
testBytes = (0, encoding_1.toUtf8)(testMsg);
|
|
117
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitrarySign(aliceWallet, aliceAddress, testBytes)];
|
|
140
118
|
case 1:
|
|
141
|
-
signDoc = _a.sent();
|
|
142
|
-
commonTxClient = FirmaUtil_1.FirmaUtil.getCommonTxClient(aliceWallet);
|
|
143
|
-
return [4 /*yield*/, commonTxClient.signDirectForSignDocTxRaw(aliceAddress, signDoc)];
|
|
144
|
-
case 2:
|
|
145
|
-
txRaw = _a.sent();
|
|
146
|
-
signatureBase64 = FirmaUtil_1.FirmaUtil.arrayBufferToBase64(txRaw.signatures[0]);
|
|
147
|
-
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.verifyDirectSignature(aliceAddress, signatureBase64, signDoc)];
|
|
148
|
-
case 3:
|
|
149
|
-
valid = _a.sent();
|
|
150
|
-
chai_1.expect(valid).to.be.equal(true);
|
|
151
|
-
return [4 /*yield*/, commonTxClient.broadcast(txRaw)];
|
|
152
|
-
case 4:
|
|
153
119
|
result = _a.sent();
|
|
154
|
-
|
|
120
|
+
// modify signature base64 (simulate corruption) - change first character
|
|
121
|
+
// console.log("Original signature:", result.signature);
|
|
122
|
+
result.signature = "X" + result.signature.substring(1);
|
|
123
|
+
return [4 /*yield*/, FirmaUtil_1.FirmaUtil.protobufArbitraryVerify(result, testBytes)];
|
|
124
|
+
case 2:
|
|
125
|
+
isValid = _a.sent();
|
|
126
|
+
(0, chai_1.expect)(isValid).to.be.equal(false);
|
|
155
127
|
return [2 /*return*/];
|
|
156
128
|
}
|
|
157
129
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -39,7 +39,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
var chai_1 = require("chai");
|
|
40
40
|
var client_1 = require("cosmjs-types/ibc/core/client/v1/client");
|
|
41
41
|
var FirmaSDK_1 = require("../sdk/FirmaSDK");
|
|
42
|
-
var FirmaUtil_1 = require("../sdk/FirmaUtil");
|
|
43
42
|
var config_test_1 = require("./config_test");
|
|
44
43
|
describe.skip('[28. IBC Tx Test]', function () {
|
|
45
44
|
var firma;
|
|
@@ -63,14 +62,14 @@ describe.skip('[28. IBC Tx Test]', function () {
|
|
|
63
62
|
});
|
|
64
63
|
});
|
|
65
64
|
it('IBC transfer', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var sourcePort, sourceChannel, denom, amount, receiver, clientState, revison_height, revison_number, height, timeStamp, timeoutTimeStamp, gas, fee, result;
|
|
65
|
+
var sourcePort, sourceChannel, denom, amount, receiver, clientState, revison_height, revison_number, height, timeStamp, timeoutTimeStamp, gas, fee, metadata, result;
|
|
67
66
|
return __generator(this, function (_a) {
|
|
68
67
|
switch (_a.label) {
|
|
69
68
|
case 0:
|
|
70
69
|
sourcePort = "transfer";
|
|
71
|
-
sourceChannel = "channel-
|
|
70
|
+
sourceChannel = "channel-1";
|
|
72
71
|
denom = "ufct";
|
|
73
|
-
amount = "
|
|
72
|
+
amount = "10";
|
|
74
73
|
receiver = "firma1320eclh4dwzx89qjap2q5n2hna07zs2vm8tzlu";
|
|
75
74
|
return [4 /*yield*/, firma.Ibc.getClientState(sourceChannel, sourcePort)];
|
|
76
75
|
case 1:
|
|
@@ -86,11 +85,12 @@ describe.skip('[28. IBC Tx Test]', function () {
|
|
|
86
85
|
return [4 /*yield*/, firma.Ibc.getGasEstimationTransfer(aliceWallet, sourcePort, sourceChannel, denom, amount, receiver, height, timeoutTimeStamp)];
|
|
87
86
|
case 2:
|
|
88
87
|
gas = _a.sent();
|
|
89
|
-
fee =
|
|
90
|
-
|
|
88
|
+
fee = Math.ceil(gas * 0.1);
|
|
89
|
+
metadata = "";
|
|
90
|
+
return [4 /*yield*/, firma.Ibc.transfer(aliceWallet, sourcePort, sourceChannel, denom, amount, receiver, height, timeoutTimeStamp, metadata, { gas: gas, fee: fee })];
|
|
91
91
|
case 3:
|
|
92
92
|
result = _a.sent();
|
|
93
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
93
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
94
94
|
return [2 /*return*/];
|
|
95
95
|
}
|
|
96
96
|
});
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -51,7 +51,7 @@ describe('[29. Mint Query Test]', function () {
|
|
|
51
51
|
case 0: return [4 /*yield*/, firma.Mint.getInflation()];
|
|
52
52
|
case 1:
|
|
53
53
|
result = _a.sent();
|
|
54
|
-
chai_1.expect(Number(result)).to.be.greaterThan(0);
|
|
54
|
+
(0, chai_1.expect)(Number(result)).to.be.greaterThan(0);
|
|
55
55
|
return [2 /*return*/];
|
|
56
56
|
}
|
|
57
57
|
});
|