@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]) {
|
|
@@ -84,7 +84,7 @@ describe('[21. Token Tx Test]', function () {
|
|
|
84
84
|
case 0: return [4 /*yield*/, firma.Token.createToken(aliceWallet, tokenName, symbol, tokenURI, totalSupply, decimal, mintable, burnable)];
|
|
85
85
|
case 1:
|
|
86
86
|
result = _a.sent();
|
|
87
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
87
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
88
88
|
return [2 /*return*/];
|
|
89
89
|
}
|
|
90
90
|
});
|
|
@@ -98,7 +98,7 @@ describe('[21. Token Tx Test]', function () {
|
|
|
98
98
|
return [4 /*yield*/, firma.Token.mint(aliceWallet, tokenID, amount, decimal, aliceAddress)];
|
|
99
99
|
case 1:
|
|
100
100
|
result = _a.sent();
|
|
101
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
101
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
102
102
|
return [2 /*return*/];
|
|
103
103
|
}
|
|
104
104
|
});
|
|
@@ -112,7 +112,7 @@ describe('[21. Token Tx Test]', function () {
|
|
|
112
112
|
return [4 /*yield*/, firma.Token.burn(aliceWallet, tokenID, amount, decimal)];
|
|
113
113
|
case 1:
|
|
114
114
|
result = _a.sent();
|
|
115
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
115
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
116
116
|
return [2 /*return*/];
|
|
117
117
|
}
|
|
118
118
|
});
|
|
@@ -126,7 +126,7 @@ describe('[21. Token Tx Test]', function () {
|
|
|
126
126
|
return [4 /*yield*/, firma.Token.updateTokenURI(aliceWallet, tokenID, tokenURI)];
|
|
127
127
|
case 1:
|
|
128
128
|
result = _a.sent();
|
|
129
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
129
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
130
130
|
return [2 /*return*/];
|
|
131
131
|
}
|
|
132
132
|
});
|
|
@@ -141,7 +141,7 @@ describe('[21. Token Tx Test]', function () {
|
|
|
141
141
|
return [4 /*yield*/, firma.Bank.sendToken(aliceWallet, bobAddress, tokenID, amount, decimal)];
|
|
142
142
|
case 1:
|
|
143
143
|
result = _a.sent();
|
|
144
|
-
chai_1.expect(result.code).to.equal(0);
|
|
144
|
+
(0, chai_1.expect)(result.code).to.equal(0);
|
|
145
145
|
return [2 /*return*/];
|
|
146
146
|
}
|
|
147
147
|
});
|
|
@@ -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]) {
|
|
@@ -67,7 +67,7 @@ describe('[22. Token query Test]', function () {
|
|
|
67
67
|
case 0: return [4 /*yield*/, firma.Token.getTokenDataListFromOwner(aliceAddress)];
|
|
68
68
|
case 1:
|
|
69
69
|
tokenDataList = _a.sent();
|
|
70
|
-
chai_1.expect(tokenDataList.length).to.be.greaterThan(0);
|
|
70
|
+
(0, chai_1.expect)(tokenDataList.length).to.be.greaterThan(0);
|
|
71
71
|
return [2 /*return*/];
|
|
72
72
|
}
|
|
73
73
|
});
|
|
@@ -83,7 +83,7 @@ describe('[22. Token query Test]', function () {
|
|
|
83
83
|
return [4 /*yield*/, firma.Token.getTokenData(tokenID)];
|
|
84
84
|
case 2:
|
|
85
85
|
totalData = _a.sent();
|
|
86
|
-
chai_1.expect(totalData.tokenID).to.be.equal(tokenID);
|
|
86
|
+
(0, chai_1.expect)(totalData.tokenID).to.be.equal(tokenID);
|
|
87
87
|
return [2 /*return*/];
|
|
88
88
|
}
|
|
89
89
|
});
|
|
@@ -95,7 +95,7 @@ describe('[22. Token query Test]', function () {
|
|
|
95
95
|
case 0: return [4 /*yield*/, firma.Token.getTokenDataAll()];
|
|
96
96
|
case 1:
|
|
97
97
|
totalDataList = _a.sent();
|
|
98
|
-
chai_1.expect(totalDataList.dataList.length).to.be.greaterThan(0);
|
|
98
|
+
(0, chai_1.expect)(totalDataList.dataList.length).to.be.greaterThan(0);
|
|
99
99
|
return [2 /*return*/];
|
|
100
100
|
}
|
|
101
101
|
});
|
|
@@ -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]) {
|
|
@@ -76,17 +76,21 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
76
76
|
// grant type check
|
|
77
77
|
// authorization_type="send"|"generic"|"delegate"|"unbond"|"redelegate"
|
|
78
78
|
it('Authz Grant Send', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
79
|
-
var expirationDate, maxFCT, result;
|
|
79
|
+
var date, expirationDate, maxFCT, result;
|
|
80
80
|
return __generator(this, function (_a) {
|
|
81
81
|
switch (_a.label) {
|
|
82
82
|
case 0:
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
date = new Date();
|
|
84
|
+
date.setDate(date.getDate() + 1);
|
|
85
|
+
expirationDate = {
|
|
86
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
87
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
88
|
+
};
|
|
85
89
|
maxFCT = 10;
|
|
86
90
|
return [4 /*yield*/, firma.Authz.grantSendAuthorization(aliceWallet, bobAddress, expirationDate, maxFCT)];
|
|
87
91
|
case 1:
|
|
88
92
|
result = _a.sent();
|
|
89
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
93
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
90
94
|
return [2 /*return*/];
|
|
91
95
|
}
|
|
92
96
|
});
|
|
@@ -109,7 +113,7 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
109
113
|
return [4 /*yield*/, firma.Authz.executeAllowance(bobWallet, [anyData])];
|
|
110
114
|
case 1:
|
|
111
115
|
result = _a.sent();
|
|
112
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
116
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
113
117
|
return [2 /*return*/];
|
|
114
118
|
}
|
|
115
119
|
});
|
|
@@ -121,26 +125,30 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
121
125
|
case 0: return [4 /*yield*/, firma.Authz.revokeSendAuthorization(aliceWallet, bobAddress)];
|
|
122
126
|
case 1:
|
|
123
127
|
result = _a.sent();
|
|
124
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
128
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
125
129
|
return [2 /*return*/];
|
|
126
130
|
}
|
|
127
131
|
});
|
|
128
132
|
}); });
|
|
129
133
|
it('Authz Grant Delegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
130
|
-
var delegationInfo, validatorAddress, expirationDate, maxFCT, result;
|
|
134
|
+
var delegationInfo, validatorAddress, date, expirationDate, maxFCT, result;
|
|
131
135
|
return __generator(this, function (_a) {
|
|
132
136
|
switch (_a.label) {
|
|
133
137
|
case 0: return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
134
138
|
case 1:
|
|
135
139
|
delegationInfo = (_a.sent()).dataList;
|
|
136
140
|
validatorAddress = delegationInfo[0].delegation.validator_address;
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
date = new Date();
|
|
142
|
+
date.setDate(date.getDate() + 1);
|
|
143
|
+
expirationDate = {
|
|
144
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
145
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
146
|
+
};
|
|
139
147
|
maxFCT = 100;
|
|
140
148
|
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], authz_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE, expirationDate, maxFCT)];
|
|
141
149
|
case 2:
|
|
142
150
|
result = _a.sent();
|
|
143
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
151
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
144
152
|
return [2 /*return*/];
|
|
145
153
|
}
|
|
146
154
|
});
|
|
@@ -165,7 +173,7 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
165
173
|
return [4 /*yield*/, firma.Authz.executeAllowance(bobWallet, [anyData])];
|
|
166
174
|
case 2:
|
|
167
175
|
result = _a.sent();
|
|
168
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
176
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
169
177
|
return [2 /*return*/];
|
|
170
178
|
}
|
|
171
179
|
});
|
|
@@ -177,26 +185,30 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
177
185
|
case 0: return [4 /*yield*/, firma.Authz.revokeStakeAuthorization(aliceWallet, bobAddress, authz_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE)];
|
|
178
186
|
case 1:
|
|
179
187
|
result = _a.sent();
|
|
180
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
188
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
181
189
|
return [2 /*return*/];
|
|
182
190
|
}
|
|
183
191
|
});
|
|
184
192
|
}); });
|
|
185
193
|
it('Authz Grant UnDelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
186
|
-
var delegationInfo, validatorAddress, expirationDate, maxFCT, result;
|
|
194
|
+
var delegationInfo, validatorAddress, date, expirationDate, maxFCT, result;
|
|
187
195
|
return __generator(this, function (_a) {
|
|
188
196
|
switch (_a.label) {
|
|
189
197
|
case 0: return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
190
198
|
case 1:
|
|
191
199
|
delegationInfo = (_a.sent()).dataList;
|
|
192
200
|
validatorAddress = delegationInfo[0].delegation.validator_address;
|
|
193
|
-
|
|
194
|
-
|
|
201
|
+
date = new Date();
|
|
202
|
+
date.setDate(date.getDate() + 1);
|
|
203
|
+
expirationDate = {
|
|
204
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
205
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
206
|
+
};
|
|
195
207
|
maxFCT = 10;
|
|
196
208
|
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], authz_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE, expirationDate, maxFCT)];
|
|
197
209
|
case 2:
|
|
198
210
|
result = _a.sent();
|
|
199
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
211
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
200
212
|
return [2 /*return*/];
|
|
201
213
|
}
|
|
202
214
|
});
|
|
@@ -225,25 +237,13 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
225
237
|
return [4 /*yield*/, firma.Authz.executeAllowance(bobWallet, [anyData], { gas: gas, fee: fee })];
|
|
226
238
|
case 3:
|
|
227
239
|
result = _a.sent();
|
|
228
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
229
|
-
return [2 /*return*/];
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}); });
|
|
233
|
-
it('Authz Revoke UnDelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
234
|
-
var result;
|
|
235
|
-
return __generator(this, function (_a) {
|
|
236
|
-
switch (_a.label) {
|
|
237
|
-
case 0: return [4 /*yield*/, firma.Authz.revokeStakeAuthorization(aliceWallet, bobAddress, authz_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE)];
|
|
238
|
-
case 1:
|
|
239
|
-
result = _a.sent();
|
|
240
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
240
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
241
241
|
return [2 /*return*/];
|
|
242
242
|
}
|
|
243
243
|
});
|
|
244
244
|
}); });
|
|
245
245
|
it('Authz Grant ReDelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
246
|
-
var delegationInfo, validatorAddress1, validatorAddress2, expirationDate, maxFCT, result;
|
|
246
|
+
var delegationInfo, validatorAddress1, validatorAddress2, date, expirationDate, maxFCT, result;
|
|
247
247
|
return __generator(this, function (_a) {
|
|
248
248
|
switch (_a.label) {
|
|
249
249
|
case 0: return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
@@ -251,19 +251,35 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
251
251
|
delegationInfo = (_a.sent()).dataList;
|
|
252
252
|
validatorAddress1 = delegationInfo[0].delegation.validator_address;
|
|
253
253
|
validatorAddress2 = delegationInfo[1].delegation.validator_address;
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
date = new Date();
|
|
255
|
+
date.setDate(date.getDate() + 1);
|
|
256
|
+
expirationDate = {
|
|
257
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
258
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
259
|
+
};
|
|
256
260
|
maxFCT = 10;
|
|
257
261
|
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress1, validatorAddress2], authz_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE, expirationDate, maxFCT)];
|
|
258
262
|
case 2:
|
|
259
263
|
result = _a.sent();
|
|
260
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
264
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
265
|
+
return [2 /*return*/];
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
}); });
|
|
269
|
+
it('Authz Revoke UnDelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
270
|
+
var result;
|
|
271
|
+
return __generator(this, function (_a) {
|
|
272
|
+
switch (_a.label) {
|
|
273
|
+
case 0: return [4 /*yield*/, firma.Authz.revokeStakeAuthorization(aliceWallet, bobAddress, authz_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE)];
|
|
274
|
+
case 1:
|
|
275
|
+
result = _a.sent();
|
|
276
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
261
277
|
return [2 /*return*/];
|
|
262
278
|
}
|
|
263
279
|
});
|
|
264
280
|
}); });
|
|
265
281
|
it('Authz ExecuteAllowance-ReDelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
266
|
-
var delegationInfo, validatorAddress1, validatorAddress2,
|
|
282
|
+
var delegationInfo, validatorAddress1, validatorAddress2, amountFCT, sendAmount, msgUndelegate, anyData, gas, fee, result;
|
|
267
283
|
return __generator(this, function (_a) {
|
|
268
284
|
switch (_a.label) {
|
|
269
285
|
case 0: return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
@@ -271,13 +287,23 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
271
287
|
delegationInfo = (_a.sent()).dataList;
|
|
272
288
|
validatorAddress1 = delegationInfo[0].delegation.validator_address;
|
|
273
289
|
validatorAddress2 = delegationInfo[1].delegation.validator_address;
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
290
|
+
amountFCT = 1;
|
|
291
|
+
sendAmount = { denom: firma.Config.denom, amount: FirmaUtil_1.FirmaUtil.getUFCTStringFromFCT(amountFCT) };
|
|
292
|
+
msgUndelegate = staking_1.StakingTxClient.msgRedelegate({
|
|
293
|
+
delegatorAddress: aliceAddress,
|
|
294
|
+
validatorSrcAddress: validatorAddress1,
|
|
295
|
+
validatorDstAddress: validatorAddress2,
|
|
296
|
+
amount: sendAmount
|
|
297
|
+
});
|
|
298
|
+
anyData = FirmaUtil_1.FirmaUtil.getAnyData(staking_1.StakingTxClient.getRegistry(), msgUndelegate);
|
|
299
|
+
return [4 /*yield*/, firma.Authz.getGasEstimationExecuteAllowance(bobWallet, [anyData])];
|
|
278
300
|
case 2:
|
|
301
|
+
gas = _a.sent();
|
|
302
|
+
fee = Math.ceil(gas * 0.1);
|
|
303
|
+
return [4 /*yield*/, firma.Authz.executeAllowance(bobWallet, [anyData], { gas: gas, fee: fee })];
|
|
304
|
+
case 3:
|
|
279
305
|
result = _a.sent();
|
|
280
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
306
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
281
307
|
return [2 /*return*/];
|
|
282
308
|
}
|
|
283
309
|
});
|
|
@@ -289,24 +315,28 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
289
315
|
case 0: return [4 /*yield*/, firma.Authz.revokeStakeAuthorization(aliceWallet, bobAddress, authz_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE)];
|
|
290
316
|
case 1:
|
|
291
317
|
result = _a.sent();
|
|
292
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
318
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
293
319
|
return [2 /*return*/];
|
|
294
320
|
}
|
|
295
321
|
});
|
|
296
322
|
}); });
|
|
297
323
|
// GenericAuthorization: MsgWithdrawDelegatorReward case
|
|
298
324
|
it('Authz Grant-GenericAuthorization MsgWithdrawDelegatorReward', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
299
|
-
var msg, expirationDate, result;
|
|
325
|
+
var msg, date, expirationDate, result;
|
|
300
326
|
return __generator(this, function (_a) {
|
|
301
327
|
switch (_a.label) {
|
|
302
328
|
case 0:
|
|
303
329
|
msg = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
|
304
|
-
|
|
305
|
-
|
|
330
|
+
date = new Date();
|
|
331
|
+
date.setDate(date.getDate() + 1);
|
|
332
|
+
expirationDate = {
|
|
333
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
334
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
335
|
+
};
|
|
306
336
|
return [4 /*yield*/, firma.Authz.grantGenericAuthorization(aliceWallet, bobAddress, msg, expirationDate)];
|
|
307
337
|
case 1:
|
|
308
338
|
result = _a.sent();
|
|
309
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
339
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
310
340
|
return [2 /*return*/];
|
|
311
341
|
}
|
|
312
342
|
});
|
|
@@ -328,7 +358,7 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
328
358
|
return [4 /*yield*/, firma.Authz.executeAllowance(bobWallet, [anyData])];
|
|
329
359
|
case 2:
|
|
330
360
|
result = _a.sent();
|
|
331
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
361
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
332
362
|
return [2 /*return*/];
|
|
333
363
|
}
|
|
334
364
|
});
|
|
@@ -342,7 +372,7 @@ describe('[23. Authz Tx Test]', function () {
|
|
|
342
372
|
return [4 /*yield*/, firma.Authz.revokeGenericAuthorization(aliceWallet, bobAddress, msgType)];
|
|
343
373
|
case 1:
|
|
344
374
|
result = _a.sent();
|
|
345
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
375
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
346
376
|
return [2 /*return*/];
|
|
347
377
|
}
|
|
348
378
|
});
|
|
@@ -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]) {
|
|
@@ -46,8 +46,13 @@ describe('[24. Authz query Test]', function () {
|
|
|
46
46
|
var aliceAddress;
|
|
47
47
|
var bobWallet;
|
|
48
48
|
var bobAddress;
|
|
49
|
+
var date;
|
|
50
|
+
var expirationDate;
|
|
51
|
+
var validatorAddress;
|
|
52
|
+
var maxFCT;
|
|
49
53
|
beforeEach(function () {
|
|
50
54
|
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
var delegationInfo;
|
|
51
56
|
return __generator(this, function (_a) {
|
|
52
57
|
switch (_a.label) {
|
|
53
58
|
case 0:
|
|
@@ -64,9 +69,17 @@ describe('[24. Authz query Test]', function () {
|
|
|
64
69
|
return [4 /*yield*/, bobWallet.getAddress()];
|
|
65
70
|
case 4:
|
|
66
71
|
bobAddress = _a.sent();
|
|
67
|
-
|
|
72
|
+
date = new Date();
|
|
73
|
+
date.setDate(date.getDate() + 1);
|
|
74
|
+
expirationDate = {
|
|
75
|
+
seconds: BigInt(Math.floor(date.getTime() / 1000)),
|
|
76
|
+
nanos: (date.getTime() % 1000) * 1000000
|
|
77
|
+
};
|
|
78
|
+
return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
68
79
|
case 5:
|
|
69
|
-
_a.sent();
|
|
80
|
+
delegationInfo = (_a.sent()).dataList;
|
|
81
|
+
validatorAddress = delegationInfo[0].delegation.validator_address;
|
|
82
|
+
maxFCT = 100;
|
|
70
83
|
return [2 /*return*/];
|
|
71
84
|
}
|
|
72
85
|
});
|
|
@@ -74,128 +87,114 @@ describe('[24. Authz query Test]', function () {
|
|
|
74
87
|
});
|
|
75
88
|
var initializeGrant = function () {
|
|
76
89
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
-
var expirationDate, delegationInfo, validatorAddress, amountFCT, grantResult, msg, genericResult, maxFCT, delegateResult, redelegateResult, undelegateResult;
|
|
78
90
|
return __generator(this, function (_a) {
|
|
79
|
-
|
|
80
|
-
case 0:
|
|
81
|
-
expirationDate = new Date();
|
|
82
|
-
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
|
83
|
-
return [4 /*yield*/, firma.Staking.getTotalDelegationInfo(aliceAddress)];
|
|
84
|
-
case 1:
|
|
85
|
-
delegationInfo = (_a.sent()).dataList;
|
|
86
|
-
validatorAddress = delegationInfo[0].delegation.validator_address;
|
|
87
|
-
amountFCT = 9;
|
|
88
|
-
return [4 /*yield*/, firma.Authz.grantSendAuthorization(aliceWallet, bobAddress, expirationDate, amountFCT)];
|
|
89
|
-
case 2:
|
|
90
|
-
grantResult = _a.sent();
|
|
91
|
-
chai_1.expect(grantResult.code).to.equal(0);
|
|
92
|
-
msg = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
|
93
|
-
return [4 /*yield*/, firma.Authz.grantGenericAuthorization(aliceWallet, bobAddress, msg, expirationDate)];
|
|
94
|
-
case 3:
|
|
95
|
-
genericResult = _a.sent();
|
|
96
|
-
chai_1.expect(genericResult.code).to.be.equal(0);
|
|
97
|
-
maxFCT = 100;
|
|
98
|
-
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE, expirationDate, maxFCT)];
|
|
99
|
-
case 4:
|
|
100
|
-
delegateResult = _a.sent();
|
|
101
|
-
chai_1.expect(delegateResult.code).to.be.equal(0);
|
|
102
|
-
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE, expirationDate, maxFCT)];
|
|
103
|
-
case 5:
|
|
104
|
-
redelegateResult = _a.sent();
|
|
105
|
-
chai_1.expect(redelegateResult.code).to.be.equal(0);
|
|
106
|
-
return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE, expirationDate, maxFCT)];
|
|
107
|
-
case 6:
|
|
108
|
-
undelegateResult = _a.sent();
|
|
109
|
-
chai_1.expect(undelegateResult.code).to.be.equal(0);
|
|
110
|
-
return [2 /*return*/];
|
|
111
|
-
}
|
|
91
|
+
return [2 /*return*/];
|
|
112
92
|
});
|
|
113
93
|
});
|
|
114
94
|
};
|
|
115
95
|
it('Authz getSendGrantData', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
116
|
-
var result, grant, revokeResult;
|
|
96
|
+
var amountFCT, grantResult, result, grant, revokeResult;
|
|
117
97
|
return __generator(this, function (_a) {
|
|
118
98
|
switch (_a.label) {
|
|
119
|
-
case 0:
|
|
99
|
+
case 0:
|
|
100
|
+
amountFCT = 9;
|
|
101
|
+
return [4 /*yield*/, firma.Authz.grantSendAuthorization(aliceWallet, bobAddress, expirationDate, amountFCT)];
|
|
120
102
|
case 1:
|
|
103
|
+
grantResult = _a.sent();
|
|
104
|
+
(0, chai_1.expect)(grantResult.code).to.equal(0);
|
|
105
|
+
return [4 /*yield*/, firma.Authz.getSendGrantData(aliceAddress, bobAddress)];
|
|
106
|
+
case 2:
|
|
121
107
|
result = (_a.sent()).dataList;
|
|
122
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
108
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
123
109
|
grant = result[0];
|
|
124
|
-
chai_1.expect(grant).to.have.property('authorization');
|
|
125
|
-
chai_1.expect(grant).to.have.property('expiration');
|
|
110
|
+
(0, chai_1.expect)(grant).to.have.property('authorization');
|
|
111
|
+
(0, chai_1.expect)(grant).to.have.property('expiration');
|
|
126
112
|
return [4 /*yield*/, firma.Authz.revokeSendAuthorization(aliceWallet, bobAddress)];
|
|
127
|
-
case
|
|
113
|
+
case 3:
|
|
128
114
|
revokeResult = _a.sent();
|
|
129
|
-
chai_1.expect(revokeResult.code).to.equal(0);
|
|
115
|
+
(0, chai_1.expect)(revokeResult.code).to.equal(0);
|
|
130
116
|
return [2 /*return*/];
|
|
131
117
|
}
|
|
132
118
|
});
|
|
133
119
|
}); });
|
|
134
120
|
it('Authz getGenericGrantData', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
135
|
-
var
|
|
121
|
+
var msg, genericResult, result, grant;
|
|
136
122
|
return __generator(this, function (_a) {
|
|
137
123
|
switch (_a.label) {
|
|
138
124
|
case 0:
|
|
139
|
-
expirationDate = new Date();
|
|
140
|
-
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
|
|
141
|
-
amountFCT = 9;
|
|
142
125
|
msg = "/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward";
|
|
143
|
-
return [4 /*yield*/, firma.Authz.
|
|
126
|
+
return [4 /*yield*/, firma.Authz.grantGenericAuthorization(aliceWallet, bobAddress, msg, expirationDate)];
|
|
144
127
|
case 1:
|
|
128
|
+
genericResult = _a.sent();
|
|
129
|
+
(0, chai_1.expect)(genericResult.code).to.be.equal(0);
|
|
130
|
+
return [4 /*yield*/, firma.Authz.getGenericGrantData(aliceAddress, bobAddress, msg)];
|
|
131
|
+
case 2:
|
|
145
132
|
result = (_a.sent()).dataList;
|
|
146
133
|
// This test may fail if the grant does not exist.
|
|
147
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
134
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
148
135
|
grant = result[0];
|
|
149
|
-
chai_1.expect(grant).to.have.property('authorization');
|
|
150
|
-
chai_1.expect(grant).to.have.property('expiration');
|
|
136
|
+
(0, chai_1.expect)(grant).to.have.property('authorization');
|
|
137
|
+
(0, chai_1.expect)(grant).to.have.property('expiration');
|
|
151
138
|
return [2 /*return*/];
|
|
152
139
|
}
|
|
153
140
|
});
|
|
154
141
|
}); });
|
|
155
142
|
it('Authz getStakingGrantData - delegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
156
|
-
var result, grant;
|
|
143
|
+
var delegateResult, result, grant;
|
|
157
144
|
return __generator(this, function (_a) {
|
|
158
145
|
switch (_a.label) {
|
|
159
|
-
case 0: return [4 /*yield*/, firma.Authz.
|
|
146
|
+
case 0: return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE, expirationDate, maxFCT)];
|
|
160
147
|
case 1:
|
|
148
|
+
delegateResult = _a.sent();
|
|
149
|
+
(0, chai_1.expect)(delegateResult.code).to.be.equal(0);
|
|
150
|
+
return [4 /*yield*/, firma.Authz.getStakingGrantData(aliceAddress, bobAddress, AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE)];
|
|
151
|
+
case 2:
|
|
161
152
|
result = (_a.sent()).dataList;
|
|
162
153
|
// This test may fail if the grant does not exist.
|
|
163
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
154
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
164
155
|
grant = result[0];
|
|
165
|
-
chai_1.expect(grant).to.have.property('authorization');
|
|
166
|
-
chai_1.expect(grant).to.have.property('expiration');
|
|
156
|
+
(0, chai_1.expect)(grant).to.have.property('authorization');
|
|
157
|
+
(0, chai_1.expect)(grant).to.have.property('expiration');
|
|
167
158
|
return [2 /*return*/];
|
|
168
159
|
}
|
|
169
160
|
});
|
|
170
161
|
}); });
|
|
171
162
|
it('Authz getStakingGrantData - redelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
172
|
-
var result, grant;
|
|
163
|
+
var redelegateResult, result, grant;
|
|
173
164
|
return __generator(this, function (_a) {
|
|
174
165
|
switch (_a.label) {
|
|
175
|
-
case 0: return [4 /*yield*/, firma.Authz.
|
|
166
|
+
case 0: return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE, expirationDate, maxFCT)];
|
|
176
167
|
case 1:
|
|
168
|
+
redelegateResult = _a.sent();
|
|
169
|
+
(0, chai_1.expect)(redelegateResult.code).to.be.equal(0);
|
|
170
|
+
return [4 /*yield*/, firma.Authz.getStakingGrantData(aliceAddress, bobAddress, AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE)];
|
|
171
|
+
case 2:
|
|
177
172
|
result = (_a.sent()).dataList;
|
|
178
173
|
// This test may fail if the grant does not exist.
|
|
179
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
174
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
180
175
|
grant = result[0];
|
|
181
|
-
chai_1.expect(grant).to.have.property('authorization');
|
|
182
|
-
chai_1.expect(grant).to.have.property('expiration');
|
|
176
|
+
(0, chai_1.expect)(grant).to.have.property('authorization');
|
|
177
|
+
(0, chai_1.expect)(grant).to.have.property('expiration');
|
|
183
178
|
return [2 /*return*/];
|
|
184
179
|
}
|
|
185
180
|
});
|
|
186
181
|
}); });
|
|
187
182
|
it('Authz getStakingGrantData - undelegate', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
188
|
-
var result, grant;
|
|
183
|
+
var undelegateResult, result, grant;
|
|
189
184
|
return __generator(this, function (_a) {
|
|
190
185
|
switch (_a.label) {
|
|
191
|
-
case 0: return [4 /*yield*/, firma.Authz.
|
|
186
|
+
case 0: return [4 /*yield*/, firma.Authz.grantStakeAuthorization(aliceWallet, bobAddress, [validatorAddress], AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE, expirationDate, maxFCT)];
|
|
192
187
|
case 1:
|
|
188
|
+
undelegateResult = _a.sent();
|
|
189
|
+
(0, chai_1.expect)(undelegateResult.code).to.be.equal(0);
|
|
190
|
+
return [4 /*yield*/, firma.Authz.getStakingGrantData(aliceAddress, bobAddress, AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE)];
|
|
191
|
+
case 2:
|
|
193
192
|
result = (_a.sent()).dataList;
|
|
194
193
|
// This test may fail if the grant does not exist.
|
|
195
|
-
chai_1.expect(result.length).to.be.greaterThan(0);
|
|
194
|
+
(0, chai_1.expect)(result.length).to.be.greaterThan(0);
|
|
196
195
|
grant = result[0];
|
|
197
|
-
chai_1.expect(grant).to.have.property('authorization');
|
|
198
|
-
chai_1.expect(grant).to.have.property('expiration');
|
|
196
|
+
(0, chai_1.expect)(grant).to.have.property('authorization');
|
|
197
|
+
(0, chai_1.expect)(grant).to.have.property('expiration');
|
|
199
198
|
return [2 /*return*/];
|
|
200
199
|
}
|
|
201
200
|
});
|
|
@@ -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]) {
|
|
@@ -136,7 +136,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
136
136
|
case 1:
|
|
137
137
|
result = _a.sent();
|
|
138
138
|
codeId = extractValue(result.events, "store_code", "code_id");
|
|
139
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
139
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
140
140
|
return [2 /*return*/];
|
|
141
141
|
}
|
|
142
142
|
});
|
|
@@ -156,7 +156,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
156
156
|
case 1:
|
|
157
157
|
result = _a.sent();
|
|
158
158
|
contractAddress = extractValue(result.events, "instantiate", "_contract_address");
|
|
159
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
159
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
160
160
|
return [2 /*return*/];
|
|
161
161
|
}
|
|
162
162
|
});
|
|
@@ -174,7 +174,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
174
174
|
return [4 /*yield*/, firma.CosmWasm.executeContract(aliceWallet, contractAddress, testData, funds, { gas: gas, fee: fee })];
|
|
175
175
|
case 1:
|
|
176
176
|
result = _a.sent();
|
|
177
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
177
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
178
178
|
return [2 /*return*/];
|
|
179
179
|
}
|
|
180
180
|
});
|
|
@@ -189,7 +189,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
189
189
|
return [4 /*yield*/, firma.CosmWasm.updateAdmin(aliceWallet, contractAddress, bobAddress, { gas: gas, fee: fee })];
|
|
190
190
|
case 1:
|
|
191
191
|
result = _a.sent();
|
|
192
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
192
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
193
193
|
return [2 /*return*/];
|
|
194
194
|
}
|
|
195
195
|
});
|
|
@@ -204,7 +204,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
204
204
|
return [4 /*yield*/, firma.CosmWasm.clearAdmin(bobWallet, contractAddress, { gas: gas, fee: fee })];
|
|
205
205
|
case 1:
|
|
206
206
|
result = _a.sent();
|
|
207
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
207
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
208
208
|
return [2 /*return*/];
|
|
209
209
|
}
|
|
210
210
|
});
|
|
@@ -221,7 +221,7 @@ describe('[25. CosmWasm Tx Test]', function () {
|
|
|
221
221
|
return [4 /*yield*/, firma.CosmWasm.migrateContract(aliceWallet, contractAddress, codeId, testData, { gas: gas, fee: fee })];
|
|
222
222
|
case 1:
|
|
223
223
|
result = _a.sent();
|
|
224
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
224
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
225
225
|
return [2 /*return*/];
|
|
226
226
|
}
|
|
227
227
|
});
|