From 28371922517c459589683a90e48d935c57a80bcf Mon Sep 17 00:00:00 2001 From: fly33499 Date: Wed, 13 Oct 2021 21:57:11 +0900 Subject: [PATCH] refactor: make function name lowercase --- sdk/FirmaDistributionService.ts | 6 +++--- sdk/FirmaFeeGrantService.ts | 6 +++--- sdk/FirmaGovService.ts | 14 +++++++------- test/06.feegrant_tx.test.ts | 8 ++++---- test/14.distribution_tx.test.ts | 6 +++--- test/16.gov_tx.test.ts | 14 +++++++------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/sdk/FirmaDistributionService.ts b/sdk/FirmaDistributionService.ts index 85a0b05..a15f550 100644 --- a/sdk/FirmaDistributionService.ts +++ b/sdk/FirmaDistributionService.ts @@ -88,7 +88,7 @@ export class FirmaDistributionService { } } - public async SetWithdrawAddress(wallet: FirmaWalletService, withdrawAddress: string, txMisc: TxMisc = DefaultTxMisc): Promise { + public async setWithdrawAddress(wallet: FirmaWalletService, withdrawAddress: string, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxSetWithdrawAddress(wallet, withdrawAddress, txMisc); @@ -101,7 +101,7 @@ export class FirmaDistributionService { } } - public async FundCommunityPool(wallet: FirmaWalletService, amount: number, txMisc: TxMisc = DefaultTxMisc): Promise { + public async fundCommunityPool(wallet: FirmaWalletService, amount: number, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxFundCommunityPool(wallet, amount, txMisc); @@ -114,7 +114,7 @@ export class FirmaDistributionService { } } - public async WithdrawValidatorCommission(wallet: FirmaWalletService, validatorAddres: string, txMisc: TxMisc = DefaultTxMisc): Promise { + public async withdrawValidatorCommission(wallet: FirmaWalletService, validatorAddres: string, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxWithdrawValidatorCommission(wallet, validatorAddres, txMisc); diff --git a/sdk/FirmaFeeGrantService.ts b/sdk/FirmaFeeGrantService.ts index 7fd5111..46963f0 100644 --- a/sdk/FirmaFeeGrantService.ts +++ b/sdk/FirmaFeeGrantService.ts @@ -29,7 +29,7 @@ export class FirmaFeeGrantService { } } - public async RevokeAllowance(wallet: FirmaWalletService, granteeAddress: string, txMisc: TxMisc = DefaultTxMisc): Promise { + public async revokeAllowance(wallet: FirmaWalletService, granteeAddress: string, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxRevokeAllowance(wallet, granteeAddress, txMisc); @@ -116,7 +116,7 @@ export class FirmaFeeGrantService { } } - public async GrantPeriodicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: PeriodicFeeGrantOption, txMisc: TxMisc = DefaultTxMisc): Promise { + public async grantPeriodicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: PeriodicFeeGrantOption, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxGrantPeriodicAllowance(wallet, granteeAddress, feegrantOption, txMisc); @@ -131,7 +131,7 @@ export class FirmaFeeGrantService { } - public async GrantBasicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: BasicFeeGrantOption = DefaultBasicFeeGrantOption, txMisc: TxMisc = DefaultTxMisc): Promise { + public async grantBasicAllowance(wallet: FirmaWalletService, granteeAddress: string, feegrantOption: BasicFeeGrantOption = DefaultBasicFeeGrantOption, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxGrantBasicAllowance(wallet, granteeAddress, feegrantOption, txMisc); diff --git a/sdk/FirmaGovService.ts b/sdk/FirmaGovService.ts index 50bc2fa..bfc7044 100644 --- a/sdk/FirmaGovService.ts +++ b/sdk/FirmaGovService.ts @@ -137,7 +137,7 @@ export class FirmaGovService { } } - public async SubmitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, height: Long, txMisc: TxMisc = DefaultTxMisc): Promise { + public async submitSoftwareUpgradeProposalByHeight(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, height: Long, txMisc: TxMisc = DefaultTxMisc): Promise { try { let plan = { name: upgradeName, @@ -158,7 +158,7 @@ export class FirmaGovService { } } - public async SubmitSoftwareUpgradeProposalByTime(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, upgradeTime: Date, txMisc: TxMisc = DefaultTxMisc): Promise { + public async submitSoftwareUpgradeProposalByTime(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, upgradeName: string, upgradeTime: Date, txMisc: TxMisc = DefaultTxMisc): Promise { try { let plan = { name: upgradeName, @@ -180,7 +180,7 @@ export class FirmaGovService { } - public async SubmitParameterChangeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, paramList: ParamChangeOption[], txMisc: TxMisc = DefaultTxMisc): Promise { + public async submitParameterChangeProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, paramList: ParamChangeOption[], txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxParameterChangeProposal(wallet, title, description, initialDeposit, proposer, paramList, txMisc); @@ -194,7 +194,7 @@ export class FirmaGovService { } } - public async SubmitCommunityPoolSpendProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, amount: number, recipient: string, txMisc: TxMisc = DefaultTxMisc): Promise { + public async submitCommunityPoolSpendProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, amount: number, recipient: string, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxCommunityPoolSpendProposal(wallet, title, description, initialDeposit, proposer, amount, recipient, txMisc); @@ -209,7 +209,7 @@ export class FirmaGovService { } - public async SubmitTextProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, txMisc: TxMisc = DefaultTxMisc): Promise { + public async submitTextProposal(wallet: FirmaWalletService, title: string, description: string, initialDeposit: number, proposer: string, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxSubmitTextProposal(wallet, title, description, initialDeposit, proposer, txMisc); @@ -238,7 +238,7 @@ export class FirmaGovService { } } - public async Vote(wallet: FirmaWalletService, proposalId: Long, option: VotingOption, txMisc: TxMisc = DefaultTxMisc): Promise { + public async vote(wallet: FirmaWalletService, proposalId: Long, option: VotingOption, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxVote(wallet, proposalId, option, txMisc); @@ -270,7 +270,7 @@ export class FirmaGovService { } } - public async Deposit(wallet: FirmaWalletService, proposalId: Long, amount: number, txMisc: TxMisc = DefaultTxMisc): Promise { + public async deposit(wallet: FirmaWalletService, proposalId: Long, amount: number, txMisc: TxMisc = DefaultTxMisc): Promise { try { let txRaw = await this.getSignedTxDeposit(wallet, proposalId, amount, txMisc); diff --git a/test/06.feegrant_tx.test.ts b/test/06.feegrant_tx.test.ts index c17f99b..bf78c71 100644 --- a/test/06.feegrant_tx.test.ts +++ b/test/06.feegrant_tx.test.ts @@ -24,7 +24,7 @@ describe('[06. Feegrant Tx Test]', () => { periodReset: expirationDate }; - var result = await firma.FeeGrant.GrantPeriodicAllowance(aliceWallet, await bobWallet.getAddress(), periodicAllowanceData); + var result = await firma.FeeGrant.grantPeriodicAllowance(aliceWallet, await bobWallet.getAddress(), periodicAllowanceData); expect(result.code).to.equal(0); }); @@ -34,7 +34,7 @@ describe('[06. Feegrant Tx Test]', () => { const alicewallet = await firma.Wallet.fromMnemonic(aliceMnemonic); const bobWallet = await firma.Wallet.fromMnemonic(bobMnemonic); - var result = await firma.FeeGrant.RevokeAllowance(alicewallet, await bobWallet.getAddress()); + var result = await firma.FeeGrant.revokeAllowance(alicewallet, await bobWallet.getAddress()); //console.log(result); expect(result.code).to.equal(0); @@ -54,7 +54,7 @@ describe('[06. Feegrant Tx Test]', () => { //var result = await firma.FeeGrant.GrantBasicAllowance(aliceWallet, await bobWallet.getAddress(), {spendLimit : spendLimit, expiration : expirationDate}); //var result = await firma.FeeGrant.GrantBasicAllowance(aliceWallet, await bobWallet.getAddress(), {expiration : expirationDate}); //var result = await firma.FeeGrant.GrantBasicAllowance(aliceWallet, await bobWallet.getAddress(), {spendLimit : spendLimit}); - var result = await firma.FeeGrant.GrantBasicAllowance(aliceWallet, await bobWallet.getAddress()); + var result = await firma.FeeGrant.grantBasicAllowance(aliceWallet, await bobWallet.getAddress()); expect(result.code).to.equal(0); }); @@ -77,7 +77,7 @@ describe('[06. Feegrant Tx Test]', () => { const alicewallet = await firma.Wallet.fromMnemonic(aliceMnemonic); const bobWallet = await firma.Wallet.fromMnemonic(bobMnemonic); - var result = await firma.FeeGrant.RevokeAllowance(alicewallet, await bobWallet.getAddress()); + var result = await firma.FeeGrant.revokeAllowance(alicewallet, await bobWallet.getAddress()); //console.log(result); expect(result.code).to.equal(0); diff --git a/test/14.distribution_tx.test.ts b/test/14.distribution_tx.test.ts index 81e22c3..e4b00fc 100644 --- a/test/14.distribution_tx.test.ts +++ b/test/14.distribution_tx.test.ts @@ -31,7 +31,7 @@ describe('[14. Distribution Tx Test]', () => { const validatorList = await firma.Staking.getValidatorList(); const validatorAddress = validatorList[0].operator_address; - var result = await firma.Distribution.WithdrawValidatorCommission(wallet, validatorAddress); + var result = await firma.Distribution.withdrawValidatorCommission(wallet, validatorAddress); //console.log(result); @@ -42,7 +42,7 @@ describe('[14. Distribution Tx Test]', () => { const wallet = await firma.Wallet.fromMnemonic(validatorMnemonic); const amount = 1; - var result = await firma.Distribution.FundCommunityPool(wallet, amount); + var result = await firma.Distribution.fundCommunityPool(wallet, amount); expect(result.code).to.equal(0); }); @@ -53,7 +53,7 @@ describe('[14. Distribution Tx Test]', () => { const validatorWallet = await firma.Wallet.fromMnemonic(validatorMnemonic); const aliceWallet = await firma.Wallet.fromMnemonic(aliceMnemonic); - var result = await firma.Distribution.SetWithdrawAddress(validatorWallet, await aliceWallet.getAddress()); + var result = await firma.Distribution.setWithdrawAddress(validatorWallet, await aliceWallet.getAddress()); expect(result.code).to.equal(0); }); }); \ No newline at end of file diff --git a/test/16.gov_tx.test.ts b/test/16.gov_tx.test.ts index 07c4213..dee2026 100644 --- a/test/16.gov_tx.test.ts +++ b/test/16.gov_tx.test.ts @@ -24,7 +24,7 @@ describe.skip('[16. Gov Tx Test]', () => { const title = "test submit proposal"; const description = "test description"; - var result = await firma.Gov.SubmitTextProposal(wallet, title, description, initialDepositFCT, proposer); + var result = await firma.Gov.submitTextProposal(wallet, title, description, initialDepositFCT, proposer); console.log(result); expect(result.code).to.equal(0); @@ -42,7 +42,7 @@ describe.skip('[16. Gov Tx Test]', () => { const amount = 1000; const recipient = await bobWallet.getAddress(); - var result = await firma.Gov.SubmitCommunityPoolSpendProposal(aliceWallet, title, description, initialDepositFCT, proposer, amount, recipient); + var result = await firma.Gov.submitCommunityPoolSpendProposal(aliceWallet, title, description, initialDepositFCT, proposer, amount, recipient); console.log(result); expect(result.code).to.equal(0); @@ -63,7 +63,7 @@ describe.skip('[16. Gov Tx Test]', () => { value: "100", }]; - var result = await firma.Gov.SubmitParameterChangeProposal(aliceWallet, title, description, initialDepositFCT, proposer, changeParamList); + var result = await firma.Gov.submitParameterChangeProposal(aliceWallet, title, description, initialDepositFCT, proposer, changeParamList); console.log(result); expect(result.code).to.equal(0); @@ -81,7 +81,7 @@ describe.skip('[16. Gov Tx Test]', () => { const upgradeName = "v0.2.7"; const upgradeHeight = Long.fromInt(20000000); - var result = await firma.Gov.SubmitSoftwareUpgradeProposalByHeight(aliceWallet, title, description, initialDepositFCT, proposer, upgradeName, upgradeHeight); + var result = await firma.Gov.submitSoftwareUpgradeProposalByHeight(aliceWallet, title, description, initialDepositFCT, proposer, upgradeName, upgradeHeight); //console.log(result); expect(result.code).to.equal(0); @@ -122,7 +122,7 @@ describe.skip('[16. Gov Tx Test]', () => { const proposalId = Long.fromInt(tempProposalId); const amount = 1000; - var result = await firma.Gov.Deposit(wallet, proposalId, amount); + var result = await firma.Gov.deposit(wallet, proposalId, amount); //console.log(result); expect(result.code).to.equal(0); }); @@ -132,7 +132,7 @@ describe.skip('[16. Gov Tx Test]', () => { const wallet = await firma.Wallet.fromMnemonic(aliceMnemonic); const proposalId = Long.fromInt(tempProposalId); - var result = await firma.Gov.Vote(wallet, proposalId, VotingOption.VOTE_OPTION_YES); + var result = await firma.Gov.vote(wallet, proposalId, VotingOption.VOTE_OPTION_YES); //console.log(result); expect(result.code).to.equal(0); }); @@ -142,7 +142,7 @@ describe.skip('[16. Gov Tx Test]', () => { const wallet = await firma.Wallet.fromMnemonic(bobMnemonic); const proposalId = Long.fromInt(tempProposalId); - var result = await firma.Gov.Vote(wallet, proposalId, VotingOption.VOTE_OPTION_NO); + var result = await firma.Gov.vote(wallet, proposalId, VotingOption.VOTE_OPTION_NO); //console.log(result); expect(result.code).to.equal(0); });