@firmachain/firma-js 0.3.4 → 0.3.6-beta1
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 +26 -23
- package/dist/sdk/FirmaUtil.js +157 -137
- package/dist/sdk/FirmaWalletService.d.ts +5 -9
- package/dist/sdk/FirmaWalletService.js +86 -52
- 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 +3 -3
- package/dist/sdk/firmachain/common/ITxClient.js +25 -83
- 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 +14 -30
- package/dist/sdk/firmachain/common/accounts.d.ts +1 -1
- package/dist/sdk/firmachain/common/accounts.js +7 -7
- package/dist/sdk/firmachain/common/events.js +2 -2
- package/dist/sdk/firmachain/common/fee.d.ts +2 -2
- package/dist/sdk/firmachain/common/fee.js +4 -2
- package/dist/sdk/firmachain/common/index.d.ts +0 -1
- package/dist/sdk/firmachain/common/index.js +5 -4
- package/dist/sdk/firmachain/common/signing.d.ts +13 -9
- package/dist/sdk/firmachain/common/signing.js +81 -36
- package/dist/sdk/firmachain/common/signingprotobufstargateclient.d.ts +34 -0
- package/dist/sdk/firmachain/common/signingprotobufstargateclient.js +319 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +21 -105
- package/dist/sdk/firmachain/common/signingstargateclient.js +120 -472
- package/dist/sdk/firmachain/common/{stargateclient.d.ts → stargateClient.d.ts} +11 -60
- package/dist/sdk/firmachain/common/{stargateclient.js → stargateClient.js} +109 -203
- 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} +41 -40
- 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 +2 -2
- package/dist/test/config_test.js +22 -5
- 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/coins.d.ts +0 -42
- package/dist/sdk/firmachain/amino/coins.js +0 -90
- 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/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/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]) {
|
|
@@ -133,7 +133,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
133
133
|
return [4 /*yield*/, firma.Bank.getGasEstimationSend(aliceWallet, bobAddress, amount)];
|
|
134
134
|
case 1:
|
|
135
135
|
gas = _a.sent();
|
|
136
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
136
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
137
137
|
return [2 /*return*/];
|
|
138
138
|
}
|
|
139
139
|
});
|
|
@@ -145,8 +145,8 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
145
145
|
case 0:
|
|
146
146
|
timestamp = Math.round(+new Date() / 1000);
|
|
147
147
|
tokenName = "KOMX TOKEN";
|
|
148
|
-
tokenId = "ukomx"
|
|
149
|
-
tokenSymbol = "KOMX"
|
|
148
|
+
tokenId = "ukomx".concat(timestamp);
|
|
149
|
+
tokenSymbol = "KOMX".concat(timestamp);
|
|
150
150
|
tokenURI = "https://token.firmachain.dev";
|
|
151
151
|
tokenSupply = 100000000;
|
|
152
152
|
decimal = 6;
|
|
@@ -155,15 +155,15 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
155
155
|
return [4 /*yield*/, firma.Token.createToken(aliceWallet, tokenName, tokenSymbol, tokenURI, tokenSupply, decimal, true, true)];
|
|
156
156
|
case 1:
|
|
157
157
|
createResult = _a.sent();
|
|
158
|
-
chai_1.expect(createResult.code).to.be.equal(0);
|
|
158
|
+
(0, chai_1.expect)(createResult.code).to.be.equal(0);
|
|
159
159
|
return [4 /*yield*/, firma.Token.mint(aliceWallet, tokenId, mintAmount, decimal, aliceAddress)];
|
|
160
160
|
case 2:
|
|
161
161
|
mintResult = _a.sent();
|
|
162
|
-
chai_1.expect(mintResult.code).to.be.equal(0);
|
|
162
|
+
(0, chai_1.expect)(mintResult.code).to.be.equal(0);
|
|
163
163
|
return [4 /*yield*/, firma.Bank.getGasEstimationSendToken(aliceWallet, bobAddress, tokenId, sendAmount, decimal)];
|
|
164
164
|
case 3:
|
|
165
165
|
gas = _a.sent();
|
|
166
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
166
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
167
167
|
return [2 /*return*/];
|
|
168
168
|
}
|
|
169
169
|
});
|
|
@@ -185,7 +185,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
185
185
|
return [4 /*yield*/, firma.Contract.getGasEstimationFromUnSignedTxList(aliceWallet, [tx1, tx1, tx1, tx1, tx1])];
|
|
186
186
|
case 2:
|
|
187
187
|
gas = _a.sent();
|
|
188
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
188
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
189
189
|
return [2 /*return*/];
|
|
190
190
|
}
|
|
191
191
|
});
|
|
@@ -204,7 +204,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
204
204
|
return [4 /*yield*/, firma.Contract.getGasEstimationAddContractLog(aliceWallet, contractHash, timeStamp, eventName, ownerAddress, jsonString)];
|
|
205
205
|
case 1:
|
|
206
206
|
gas = _a.sent();
|
|
207
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
207
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
208
208
|
return [2 /*return*/];
|
|
209
209
|
}
|
|
210
210
|
});
|
|
@@ -222,7 +222,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
222
222
|
return [4 /*yield*/, firma.Contract.getGasEstimationCreateContractFile(aliceWallet, fileHash, timeStamp, ownerList, jsonString)];
|
|
223
223
|
case 1:
|
|
224
224
|
gas = _a.sent();
|
|
225
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
225
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
226
226
|
return [2 /*return*/];
|
|
227
227
|
}
|
|
228
228
|
});
|
|
@@ -234,7 +234,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
234
234
|
case 0: return [4 /*yield*/, firma.Nft.getGasEstimationMint(aliceWallet, "https://naver.com")];
|
|
235
235
|
case 1:
|
|
236
236
|
gas = _a.sent();
|
|
237
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
237
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
238
238
|
return [2 /*return*/];
|
|
239
239
|
}
|
|
240
240
|
});
|
|
@@ -246,12 +246,12 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
246
246
|
case 0: return [4 /*yield*/, firma.Nft.mint(aliceWallet, "https://naver.com")];
|
|
247
247
|
case 1:
|
|
248
248
|
result = _a.sent();
|
|
249
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
249
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
250
250
|
nftId = extractValue(result.events, "message", "nftID");
|
|
251
251
|
return [4 /*yield*/, firma.Nft.getGasEstimationTransfer(aliceWallet, bobAddress, nftId)];
|
|
252
252
|
case 2:
|
|
253
253
|
gas = _a.sent();
|
|
254
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
254
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
255
255
|
return [2 /*return*/];
|
|
256
256
|
}
|
|
257
257
|
});
|
|
@@ -263,70 +263,97 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
263
263
|
case 0: return [4 /*yield*/, firma.Nft.mint(aliceWallet, "https://naver.com")];
|
|
264
264
|
case 1:
|
|
265
265
|
result = _a.sent();
|
|
266
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
266
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
267
267
|
nftId = extractValue(result.events, "message", "nftID");
|
|
268
268
|
return [4 /*yield*/, firma.Nft.getGasEstimationBurn(aliceWallet, nftId)];
|
|
269
269
|
case 2:
|
|
270
270
|
gas = _a.sent();
|
|
271
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
271
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
272
272
|
return [2 /*return*/];
|
|
273
273
|
}
|
|
274
274
|
});
|
|
275
275
|
}); });
|
|
276
276
|
it("4-1. Feegrant GrantPeriodicAllowance gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
277
|
-
var
|
|
277
|
+
var spendAmount, expirationDate, periodicAllowanceData, gas;
|
|
278
278
|
return __generator(this, function (_a) {
|
|
279
279
|
switch (_a.label) {
|
|
280
280
|
case 0:
|
|
281
|
-
|
|
281
|
+
spendAmount = FirmaUtil_1.FirmaUtil.getUFCTStringFromFCTStr("10");
|
|
282
282
|
expirationDate = new Date();
|
|
283
|
-
expirationDate.setMinutes(expirationDate.getMinutes() + 2);
|
|
284
283
|
periodicAllowanceData = {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
284
|
+
basic: {
|
|
285
|
+
spendLimit: [
|
|
286
|
+
{ amount: spendAmount, denom: firma.Config.denom }
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
period: { seconds: BigInt(60 * 60 * 24), nanos: 0 },
|
|
290
|
+
periodSpendLimit: [
|
|
291
|
+
{ amount: spendAmount, denom: firma.Config.denom }
|
|
292
|
+
],
|
|
293
|
+
periodCanSpend: [
|
|
294
|
+
{ amount: spendAmount, denom: firma.Config.denom }
|
|
295
|
+
],
|
|
296
|
+
periodReset: {
|
|
297
|
+
seconds: BigInt(Math.floor(expirationDate.getTime() / 1000)),
|
|
298
|
+
nanos: (expirationDate.getTime() % 1000) * 1000000
|
|
299
|
+
}
|
|
291
300
|
};
|
|
292
301
|
return [4 /*yield*/, firma.FeeGrant.getGasEstimationGrantPeriodicAllowance(bobWallet, aliceAddress, periodicAllowanceData)];
|
|
293
302
|
case 1:
|
|
294
303
|
gas = _a.sent();
|
|
295
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
304
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
296
305
|
return [2 /*return*/];
|
|
297
306
|
}
|
|
298
307
|
});
|
|
299
308
|
}); });
|
|
300
309
|
it("4-2. Feegrant GrantBasicAllowance gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
301
|
-
var gas;
|
|
310
|
+
var basicAllowance, gas;
|
|
302
311
|
return __generator(this, function (_a) {
|
|
303
312
|
switch (_a.label) {
|
|
304
|
-
case 0:
|
|
313
|
+
case 0:
|
|
314
|
+
basicAllowance = {
|
|
315
|
+
spendLimit: [
|
|
316
|
+
{ amount: "20000", denom: firma.Config.denom }
|
|
317
|
+
]
|
|
318
|
+
};
|
|
319
|
+
return [4 /*yield*/, firma.FeeGrant.getGasEstimationGrantBasicAllowance(bobWallet, aliceAddress, basicAllowance)];
|
|
305
320
|
case 1:
|
|
306
321
|
gas = _a.sent();
|
|
307
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
322
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
308
323
|
return [2 /*return*/];
|
|
309
324
|
}
|
|
310
325
|
});
|
|
311
326
|
}); });
|
|
312
327
|
it("4-3. Feegrant revokeAllowance gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
313
|
-
var
|
|
328
|
+
var error_1, basicAllowance, result, gas, fee;
|
|
314
329
|
return __generator(this, function (_a) {
|
|
315
330
|
switch (_a.label) {
|
|
316
331
|
case 0:
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
return [4 /*yield*/, firma.FeeGrant.grantBasicAllowance(aliceWallet, bobAddress, { expiration: expirationDate })];
|
|
332
|
+
_a.trys.push([0, 2, , 3]);
|
|
333
|
+
return [4 /*yield*/, firma.FeeGrant.revokeAllowance(aliceWallet, bobAddress)];
|
|
320
334
|
case 1:
|
|
335
|
+
_a.sent();
|
|
336
|
+
return [3 /*break*/, 3];
|
|
337
|
+
case 2:
|
|
338
|
+
error_1 = _a.sent();
|
|
339
|
+
return [3 /*break*/, 3];
|
|
340
|
+
case 3:
|
|
341
|
+
basicAllowance = {
|
|
342
|
+
spendLimit: [
|
|
343
|
+
{ amount: "20000", denom: firma.Config.denom }
|
|
344
|
+
]
|
|
345
|
+
};
|
|
346
|
+
return [4 /*yield*/, firma.FeeGrant.grantBasicAllowance(aliceWallet, bobAddress, basicAllowance)];
|
|
347
|
+
case 4:
|
|
321
348
|
result = _a.sent();
|
|
322
|
-
chai_1.expect(result.code).to.equal(0);
|
|
349
|
+
(0, chai_1.expect)(result.code).to.equal(0);
|
|
323
350
|
return [4 /*yield*/, firma.FeeGrant.getGasEstimationRevokeAllowance(aliceWallet, bobAddress)];
|
|
324
|
-
case
|
|
351
|
+
case 5:
|
|
325
352
|
gas = _a.sent();
|
|
326
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
353
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
327
354
|
fee = Math.ceil(gas * 0.1);
|
|
328
355
|
return [4 /*yield*/, firma.FeeGrant.revokeAllowance(aliceWallet, bobAddress, { gas: gas, fee: fee })];
|
|
329
|
-
case
|
|
356
|
+
case 6:
|
|
330
357
|
_a.sent();
|
|
331
358
|
return [2 /*return*/];
|
|
332
359
|
}
|
|
@@ -341,7 +368,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
341
368
|
return [4 /*yield*/, firma.Staking.getGasEstimationDelegate(aliceWallet, valOperAddress, amountFCT)];
|
|
342
369
|
case 1:
|
|
343
370
|
gas = _a.sent();
|
|
344
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
371
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
345
372
|
return [2 /*return*/];
|
|
346
373
|
}
|
|
347
374
|
});
|
|
@@ -355,7 +382,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
355
382
|
return [4 /*yield*/, firma.Staking.getGasEstimationUndelegate(aliceWallet, valOperAddress, amount)];
|
|
356
383
|
case 1:
|
|
357
384
|
gas = _a.sent();
|
|
358
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
385
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
359
386
|
return [2 /*return*/];
|
|
360
387
|
}
|
|
361
388
|
});
|
|
@@ -380,7 +407,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
380
407
|
return [4 /*yield*/, firma.Staking.getGasEstimationRedelegate(aliceWallet, srcValidatorAddress, dstValidatorAddress, amount, { gas: 300000, fee: 30000 })];
|
|
381
408
|
case 2:
|
|
382
409
|
gas = _a.sent();
|
|
383
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
410
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
384
411
|
return [2 /*return*/];
|
|
385
412
|
}
|
|
386
413
|
});
|
|
@@ -396,7 +423,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
396
423
|
return [4 /*yield*/, firma.Distribution.getGasEstimationWithdrawAllRewards(aliceWallet, validatorAddress)];
|
|
397
424
|
case 2:
|
|
398
425
|
gas = _a.sent();
|
|
399
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
426
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
400
427
|
return [2 /*return*/];
|
|
401
428
|
}
|
|
402
429
|
});
|
|
@@ -410,7 +437,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
410
437
|
return [4 /*yield*/, firma.Distribution.getGasEstimationWithdrawValidatorCommission(validatorWallet, valOperAddress)];
|
|
411
438
|
case 1:
|
|
412
439
|
gas = _a.sent();
|
|
413
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
440
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
414
441
|
return [2 /*return*/];
|
|
415
442
|
}
|
|
416
443
|
});
|
|
@@ -424,7 +451,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
424
451
|
return [4 /*yield*/, firma.Distribution.getGasEstimationFundCommunityPool(validatorWallet, amount)];
|
|
425
452
|
case 1:
|
|
426
453
|
gas = _a.sent();
|
|
427
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
454
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
428
455
|
return [2 /*return*/];
|
|
429
456
|
}
|
|
430
457
|
});
|
|
@@ -436,13 +463,13 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
436
463
|
case 0: return [4 /*yield*/, firma.Distribution.getGasEstimationSetWithdrawAddress(aliceWallet, bobAddress)];
|
|
437
464
|
case 1:
|
|
438
465
|
gas = _a.sent();
|
|
439
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
466
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
440
467
|
return [2 /*return*/];
|
|
441
468
|
}
|
|
442
469
|
});
|
|
443
470
|
}); });
|
|
444
471
|
it("7-1. Gov submitTextProposal gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
445
|
-
var initialDepositFCT, title, description, gas,
|
|
472
|
+
var initialDepositFCT, title, description, gas, error_2;
|
|
446
473
|
return __generator(this, function (_a) {
|
|
447
474
|
switch (_a.label) {
|
|
448
475
|
case 0:
|
|
@@ -455,11 +482,11 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
455
482
|
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitTextProposal(aliceWallet, title, description, initialDepositFCT)];
|
|
456
483
|
case 2:
|
|
457
484
|
gas = _a.sent();
|
|
458
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
485
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
459
486
|
return [3 /*break*/, 4];
|
|
460
487
|
case 3:
|
|
461
|
-
|
|
462
|
-
console.log(
|
|
488
|
+
error_2 = _a.sent();
|
|
489
|
+
console.log(error_2);
|
|
463
490
|
return [3 /*break*/, 4];
|
|
464
491
|
case 4: return [2 /*return*/];
|
|
465
492
|
}
|
|
@@ -478,7 +505,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
478
505
|
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitCommunityPoolSpendProposal(aliceWallet, title, summary, initialDepositFCT, amountFCT, recipient)];
|
|
479
506
|
case 1:
|
|
480
507
|
gas = _a.sent();
|
|
481
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
508
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
482
509
|
return [2 /*return*/];
|
|
483
510
|
}
|
|
484
511
|
});
|
|
@@ -488,18 +515,19 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
488
515
|
return __generator(this, function (_a) {
|
|
489
516
|
switch (_a.label) {
|
|
490
517
|
case 0:
|
|
491
|
-
initialDepositFCT =
|
|
518
|
+
initialDepositFCT = 2500;
|
|
492
519
|
title = "Staking parameter change proposal";
|
|
493
520
|
summary = "This is a Staking parameter change proposal";
|
|
494
521
|
return [4 /*yield*/, firma.Staking.getParamsAsStakingParams()];
|
|
495
522
|
case 1:
|
|
496
523
|
params = _a.sent();
|
|
497
524
|
params.maxValidators = 100;
|
|
525
|
+
params.minCommissionRate = FirmaUtil_1.FirmaUtil.processCommissionRateAsDecimal(params.minCommissionRate);
|
|
498
526
|
metadata = "";
|
|
499
527
|
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitStakingParamsUpdateProposal(aliceWallet, title, summary, initialDepositFCT, params, metadata)];
|
|
500
528
|
case 2:
|
|
501
529
|
gas = _a.sent();
|
|
502
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
530
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
503
531
|
return [2 /*return*/];
|
|
504
532
|
}
|
|
505
533
|
});
|
|
@@ -520,7 +548,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
520
548
|
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitGovParamsUpdateProposal(aliceWallet, title, summary, initialDepositFCT, params, metadata)];
|
|
521
549
|
case 2:
|
|
522
550
|
gas = _a.sent();
|
|
523
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
551
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
524
552
|
return [2 /*return*/];
|
|
525
553
|
}
|
|
526
554
|
});
|
|
@@ -546,36 +574,48 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
546
574
|
return [4 /*yield*/, firma.Gov.getGasEstimationSubmitSoftwareUpgradeProposal(aliceWallet, title, summary, initialDepositFCT, plan, metadata)];
|
|
547
575
|
case 1:
|
|
548
576
|
gas = _a.sent();
|
|
549
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
577
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
550
578
|
return [2 /*return*/];
|
|
551
579
|
}
|
|
552
580
|
});
|
|
553
581
|
}); });
|
|
554
|
-
it
|
|
555
|
-
var proposalId, amount, gas;
|
|
582
|
+
it("7-6. Gov deposit gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
583
|
+
var initialDepositFCT, title, description, result, proposalId, amount, gas;
|
|
556
584
|
return __generator(this, function (_a) {
|
|
557
585
|
switch (_a.label) {
|
|
558
586
|
case 0:
|
|
559
|
-
|
|
587
|
+
initialDepositFCT = 2500;
|
|
588
|
+
title = "test submit textProposal(deposit gas)";
|
|
589
|
+
description = "test description";
|
|
590
|
+
return [4 /*yield*/, firma.Gov.submitTextProposal(aliceWallet, title, description, initialDepositFCT)];
|
|
591
|
+
case 1:
|
|
592
|
+
result = _a.sent();
|
|
593
|
+
proposalId = extractValue(result.events, "submit_proposal", "proposal_id");
|
|
560
594
|
amount = 1000;
|
|
561
595
|
return [4 /*yield*/, firma.Gov.getGasEstimationDeposit(aliceWallet, proposalId, amount)];
|
|
562
|
-
case
|
|
596
|
+
case 2:
|
|
563
597
|
gas = _a.sent();
|
|
564
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
598
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
565
599
|
return [2 /*return*/];
|
|
566
600
|
}
|
|
567
601
|
});
|
|
568
602
|
}); });
|
|
569
|
-
it
|
|
570
|
-
var proposalId, gas;
|
|
603
|
+
it("7-7. Gov vote gas estimation", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
604
|
+
var initialDepositFCT, title, description, result, proposalId, gas;
|
|
571
605
|
return __generator(this, function (_a) {
|
|
572
606
|
switch (_a.label) {
|
|
573
607
|
case 0:
|
|
574
|
-
|
|
575
|
-
|
|
608
|
+
initialDepositFCT = 5000;
|
|
609
|
+
title = "test submit textProposal(vote gas)";
|
|
610
|
+
description = "test description";
|
|
611
|
+
return [4 /*yield*/, firma.Gov.submitTextProposal(aliceWallet, title, description, initialDepositFCT)];
|
|
576
612
|
case 1:
|
|
613
|
+
result = _a.sent();
|
|
614
|
+
proposalId = extractValue(result.events, "submit_proposal", "proposal_id");
|
|
615
|
+
return [4 /*yield*/, firma.Gov.getGasEstimationVote(aliceWallet, proposalId, common_1.VotingOption.VOTE_OPTION_YES)];
|
|
616
|
+
case 2:
|
|
577
617
|
gas = _a.sent();
|
|
578
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
618
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
579
619
|
return [2 /*return*/];
|
|
580
620
|
}
|
|
581
621
|
});
|
|
@@ -595,7 +635,7 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
595
635
|
return [4 /*yield*/, firma.Token.getGasEstimationCreateToken(aliceWallet, tokenName, symbol, tokenURI, totalSupply, decimal, mintable, burnable)];
|
|
596
636
|
case 1:
|
|
597
637
|
gas = _a.sent();
|
|
598
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
638
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
599
639
|
return [2 /*return*/];
|
|
600
640
|
}
|
|
601
641
|
});
|
|
@@ -616,13 +656,13 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
616
656
|
return [4 /*yield*/, firma.Token.createToken(aliceWallet, tokenName, symbol, tokenURI, totalSupply, decimal, mintable, burnable)];
|
|
617
657
|
case 1:
|
|
618
658
|
createResult = _a.sent();
|
|
619
|
-
chai_1.expect(createResult.code).to.equal(0);
|
|
659
|
+
(0, chai_1.expect)(createResult.code).to.equal(0);
|
|
620
660
|
tokenID = "ukomx" + timeStamp;
|
|
621
661
|
amount = 10000;
|
|
622
662
|
return [4 /*yield*/, firma.Token.getGasEstimationMint(aliceWallet, tokenID, amount, decimal, bobAddress)];
|
|
623
663
|
case 2:
|
|
624
664
|
gas = _a.sent();
|
|
625
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
665
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
626
666
|
return [2 /*return*/];
|
|
627
667
|
}
|
|
628
668
|
});
|
|
@@ -643,17 +683,17 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
643
683
|
return [4 /*yield*/, firma.Token.createToken(aliceWallet, tokenName, symbol, tokenURI, totalSupply, decimal, mintable, burnable)];
|
|
644
684
|
case 1:
|
|
645
685
|
createResult = _a.sent();
|
|
646
|
-
chai_1.expect(createResult.code).to.equal(0);
|
|
686
|
+
(0, chai_1.expect)(createResult.code).to.equal(0);
|
|
647
687
|
tokenID = "ukomx" + timeStamp;
|
|
648
688
|
amount = 10;
|
|
649
689
|
return [4 /*yield*/, firma.Token.mint(aliceWallet, tokenID, amount, decimal, bobAddress)];
|
|
650
690
|
case 2:
|
|
651
691
|
mintResult = _a.sent();
|
|
652
|
-
chai_1.expect(mintResult.code).to.equal(0);
|
|
692
|
+
(0, chai_1.expect)(mintResult.code).to.equal(0);
|
|
653
693
|
return [4 /*yield*/, firma.Token.getGasEstimationBurn(aliceWallet, tokenID, amount, decimal)];
|
|
654
694
|
case 3:
|
|
655
695
|
gas = _a.sent();
|
|
656
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
696
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
657
697
|
return [2 /*return*/];
|
|
658
698
|
}
|
|
659
699
|
});
|
|
@@ -674,13 +714,13 @@ describe('[08. Gas Estimation Test]', function () {
|
|
|
674
714
|
return [4 /*yield*/, firma.Token.createToken(aliceWallet, tokenName, symbol, tokenURI, totalSupply, decimal, mintable, burnable)];
|
|
675
715
|
case 1:
|
|
676
716
|
createResult = _a.sent();
|
|
677
|
-
chai_1.expect(createResult.code).to.equal(0);
|
|
717
|
+
(0, chai_1.expect)(createResult.code).to.equal(0);
|
|
678
718
|
tokenID = "ukomx" + timeStamp;
|
|
679
719
|
newTokenURI = "https://firmachain.org";
|
|
680
720
|
return [4 /*yield*/, firma.Token.getGasEstimationUpdateTokenURI(aliceWallet, tokenID, newTokenURI)];
|
|
681
721
|
case 2:
|
|
682
722
|
gas = _a.sent();
|
|
683
|
-
chai_1.expect(gas).to.not.equal(0);
|
|
723
|
+
(0, chai_1.expect)(gas).to.not.equal(0);
|
|
684
724
|
return [2 /*return*/];
|
|
685
725
|
}
|
|
686
726
|
});
|
|
@@ -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,20 +51,20 @@ describe('[09. IPFS Test]', function () {
|
|
|
51
51
|
case 0: return [4 /*yield*/, firma.Ipfs.addJson("hello world")];
|
|
52
52
|
case 1:
|
|
53
53
|
hash = _a.sent();
|
|
54
|
-
chai_1.expect(hash).to.equal("Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD");
|
|
54
|
+
(0, chai_1.expect)(hash).to.equal("Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD");
|
|
55
55
|
arrBuf = new ArrayBuffer(1000);
|
|
56
56
|
return [4 /*yield*/, firma.Ipfs.addBuffer(arrBuf)];
|
|
57
57
|
case 2:
|
|
58
58
|
hash = _a.sent();
|
|
59
59
|
url = firma.Ipfs.getURLFromHash(hash);
|
|
60
60
|
srcUrl = firma.Config.ipfsWebApiAddress + "/ipfs/QmVRqQTWMy2gNtNd8i9ugz8STaoZmFGYg6fn5YyEBHp9Be";
|
|
61
|
-
chai_1.expect(srcUrl).to.equal(url);
|
|
61
|
+
(0, chai_1.expect)(srcUrl).to.equal(url);
|
|
62
62
|
return [4 /*yield*/, firma.Ipfs.addFile("./test/sample/test-bear.jpg")];
|
|
63
63
|
case 3:
|
|
64
64
|
hash = _a.sent();
|
|
65
65
|
url = firma.Ipfs.getURLFromHash(hash);
|
|
66
66
|
srcUrl = firma.Config.ipfsWebApiAddress + "/ipfs/QmYsezxzunake9EmyoU4HsWKEyHQLgE3syTEpTSQEhNChA";
|
|
67
|
-
chai_1.expect(srcUrl).to.equal(url);
|
|
67
|
+
(0, chai_1.expect)(srcUrl).to.equal(url);
|
|
68
68
|
return [2 /*return*/];
|
|
69
69
|
}
|
|
70
70
|
});
|
|
@@ -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]) {
|
|
@@ -121,7 +121,7 @@ describe('[10. NFT Tx Test]', function () {
|
|
|
121
121
|
case 0: return [4 /*yield*/, firma.Nft.mint(aliceWallet, "https://naver.com")];
|
|
122
122
|
case 1:
|
|
123
123
|
result = _a.sent();
|
|
124
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
124
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
125
125
|
return [2 /*return*/];
|
|
126
126
|
}
|
|
127
127
|
});
|
|
@@ -147,7 +147,7 @@ describe('[10. NFT Tx Test]', function () {
|
|
|
147
147
|
return [4 /*yield*/, firma.Nft.signAndBroadcast(aliceWallet, txList, { gas: gas, fee: fee })];
|
|
148
148
|
case 5:
|
|
149
149
|
result = _a.sent();
|
|
150
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
150
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
151
151
|
return [2 /*return*/];
|
|
152
152
|
}
|
|
153
153
|
});
|
|
@@ -168,7 +168,7 @@ describe('[10. NFT Tx Test]', function () {
|
|
|
168
168
|
return [4 /*yield*/, firma.Nft.signAndBroadcast(aliceWallet, txList, { gas: gas, fee: fee })];
|
|
169
169
|
case 2:
|
|
170
170
|
result = _a.sent();
|
|
171
|
-
chai_1.expect(result.code).to.be.equal(0);
|
|
171
|
+
(0, chai_1.expect)(result.code).to.be.equal(0);
|
|
172
172
|
return [2 /*return*/];
|
|
173
173
|
}
|
|
174
174
|
});
|
|
@@ -184,7 +184,7 @@ describe('[10. NFT Tx Test]', function () {
|
|
|
184
184
|
return [4 /*yield*/, firma.Nft.transfer(aliceWallet, bobAddress, nftIds[0])];
|
|
185
185
|
case 2:
|
|
186
186
|
transferResult = _a.sent();
|
|
187
|
-
chai_1.expect(transferResult.code).to.be.equal(0);
|
|
187
|
+
(0, chai_1.expect)(transferResult.code).to.be.equal(0);
|
|
188
188
|
return [2 /*return*/];
|
|
189
189
|
}
|
|
190
190
|
});
|
|
@@ -196,12 +196,12 @@ describe('[10. NFT Tx Test]', function () {
|
|
|
196
196
|
case 0: return [4 /*yield*/, firma.Nft.mint(aliceWallet, "https://naver.com")];
|
|
197
197
|
case 1:
|
|
198
198
|
mintResult = _a.sent();
|
|
199
|
-
chai_1.expect(mintResult.code).to.be.equal(0);
|
|
199
|
+
(0, chai_1.expect)(mintResult.code).to.be.equal(0);
|
|
200
200
|
nftIds = extractAllNftIds(mintResult.events);
|
|
201
201
|
return [4 /*yield*/, firma.Nft.burn(aliceWallet, nftIds[0])];
|
|
202
202
|
case 2:
|
|
203
203
|
burnResult = _a.sent();
|
|
204
|
-
chai_1.expect(burnResult.code).to.be.equal(0);
|
|
204
|
+
(0, chai_1.expect)(burnResult.code).to.be.equal(0);
|
|
205
205
|
return [2 /*return*/];
|
|
206
206
|
}
|
|
207
207
|
});
|
|
@@ -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,8 +67,8 @@ describe('[11. NFT Query Test]', function () {
|
|
|
67
67
|
case 0: return [4 /*yield*/, firma.Nft.getBalanceOf(aliceAddress)];
|
|
68
68
|
case 1:
|
|
69
69
|
totalNft = _a.sent();
|
|
70
|
-
chai_1.expect(totalNft).to.be.equal(totalNft);
|
|
71
|
-
chai_1.expect(totalNft).to.be.greaterThan(0);
|
|
70
|
+
(0, chai_1.expect)(totalNft).to.be.equal(totalNft);
|
|
71
|
+
(0, chai_1.expect)(totalNft).to.be.greaterThan(0);
|
|
72
72
|
return [2 /*return*/];
|
|
73
73
|
}
|
|
74
74
|
});
|
|
@@ -80,7 +80,7 @@ describe('[11. NFT Query Test]', function () {
|
|
|
80
80
|
case 0: return [4 /*yield*/, firma.Nft.getNftIdListOfOwner(aliceAddress)];
|
|
81
81
|
case 1:
|
|
82
82
|
result = _a.sent();
|
|
83
|
-
chai_1.expect(result.nftIdList.length).to.be.greaterThan(0);
|
|
83
|
+
(0, chai_1.expect)(result.nftIdList.length).to.be.greaterThan(0);
|
|
84
84
|
return [2 /*return*/];
|
|
85
85
|
}
|
|
86
86
|
});
|
|
@@ -103,7 +103,7 @@ describe('[11. NFT Query Test]', function () {
|
|
|
103
103
|
current += result.dataList.length;
|
|
104
104
|
return [3 /*break*/, 2];
|
|
105
105
|
case 4:
|
|
106
|
-
chai_1.expect(current).to.be.equal(total);
|
|
106
|
+
(0, chai_1.expect)(current).to.be.equal(total);
|
|
107
107
|
return [2 /*return*/];
|
|
108
108
|
}
|
|
109
109
|
});
|
|
@@ -115,7 +115,7 @@ describe('[11. NFT Query Test]', function () {
|
|
|
115
115
|
case 0: return [4 /*yield*/, firma.Nft.getNftItemAllFromAddress(aliceAddress)];
|
|
116
116
|
case 1:
|
|
117
117
|
nftItemList = _a.sent();
|
|
118
|
-
chai_1.expect(nftItemList.dataList.length).to.be.greaterThan(0);
|
|
118
|
+
(0, chai_1.expect)(nftItemList.dataList.length).to.be.greaterThan(0);
|
|
119
119
|
return [2 /*return*/];
|
|
120
120
|
}
|
|
121
121
|
});
|
|
@@ -144,7 +144,7 @@ describe('[11. NFT Query Test]', function () {
|
|
|
144
144
|
for (i = 0; i < result.dataList.length; i++) {
|
|
145
145
|
totalItemList[index++] = result.dataList[i];
|
|
146
146
|
}
|
|
147
|
-
chai_1.expect(totalItemList.length).to.be.equal(total);
|
|
147
|
+
(0, chai_1.expect)(totalItemList.length).to.be.equal(total);
|
|
148
148
|
return [2 /*return*/];
|
|
149
149
|
}
|
|
150
150
|
});
|
|
@@ -156,8 +156,8 @@ describe('[11. NFT Query Test]', function () {
|
|
|
156
156
|
case 0: return [4 /*yield*/, firma.Nft.getNftItemAll()];
|
|
157
157
|
case 1:
|
|
158
158
|
result = _a.sent();
|
|
159
|
-
chai_1.expect(result.dataList.length).to.be.equal(result.dataList.length);
|
|
160
|
-
chai_1.expect(result.dataList.length).to.be.greaterThan(0);
|
|
159
|
+
(0, chai_1.expect)(result.dataList.length).to.be.equal(result.dataList.length);
|
|
160
|
+
(0, chai_1.expect)(result.dataList.length).to.be.greaterThan(0);
|
|
161
161
|
return [2 /*return*/];
|
|
162
162
|
}
|
|
163
163
|
});
|