Skip to content

Commit

Permalink
deps: bump up @finschia/finschia v4.0.0-rc4 (#113)
Browse files Browse the repository at this point in the history
* feat: bump up @finschia/finschia v4.0.0-rc4
change gas fee in sample node config

Signed-off-by: zemyblue <[email protected]>

* chore: change package version

Signed-off-by: zemyblue <[email protected]>

* chore: update changelog

Signed-off-by: zemyblue <[email protected]>

* fix: modify relayer gas fee config

Signed-off-by: zemyblue <[email protected]>

* fix: unittest error

Signed-off-by: zemyblue <[email protected]>

* Update scripts/with-ibc/finschia/template/.finschia/config/app.toml

Co-authored-by: jaeseung-bae <[email protected]>

---------

Signed-off-by: zemyblue <[email protected]>
Co-authored-by: jaeseung-bae <[email protected]>
  • Loading branch information
zemyblue and jaeseung-bae authored May 24, 2024
1 parent f0d5239 commit dddc5ff
Show file tree
Hide file tree
Showing 21 changed files with 72 additions and 47 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed
- [\#112](https://github.com/Finschia/finschia-js/pull/112) change package version from v0.9.0 to v0.10.0-rc1
- [\#113](https://github.com/Finschia/finschia-js/pull/113) bump up @finschia/finschia v4.0.0-rc4

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@cosmjs/encoding": "^0.31.0",
"@cosmjs/proto-signing": "^0.31.0",
"@cosmjs/stargate": "^0.31.0",
"@finschia/finschia": "0.10.0-rc1",
"@finschia/finschia": "0.10.0-rc2",
"eslint": "^7.5",
"karma-chrome-launcher": "^3.1.0",
"karma-jasmine": "^4.0.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/finschia/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@finschia/finschia",
"version": "0.10.0-rc1",
"version": "0.10.0-rc2",
"description": "Utilities for FINSCHIA v2.0.0",
"contributors": [
"zemyblue <[email protected]>",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@cosmjs/stargate": "^0.31.0",
"@cosmjs/tendermint-rpc": "^0.31.0",
"@cosmjs/utils": "^0.31.0",
"@finschia/finschia-proto": "4.0.0-rc2",
"@finschia/finschia-proto": "4.0.0-rc4",
"cosmjs-types": "^0.8.0",
"long": "^4.0.0",
"pako": "^2.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/finschia/src/finschiaclient.searchtx.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function sendTokens(
const { accountNumber, sequence } = (await client.getSequence(walletAddress))!;
const feeAmount = [
{
amount: "2000",
amount: "3000",
denom: "cony",
},
];
Expand Down
8 changes: 4 additions & 4 deletions packages/finschia/src/finschiaclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe("FinschiaClient", () => {
},
};
const fee: StdFee = {
amount: coins(5000, "cony"),
amount: coins(13400, "cony"),
gas: "890000",
};

Expand Down Expand Up @@ -358,7 +358,7 @@ describe("FinschiaClient", () => {
...defaultSigningClientOptions,
});
await client.delegateTokens(faucet.address4, validator.validatorAddress, coin(1234, "stake"), {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
});
}
Expand Down Expand Up @@ -662,7 +662,7 @@ describe("FinschiaClient", () => {
const client = await FinschiaClient.connect(simapp.tendermintUrl);
const minimumGasPrice = await client.queryMinimumGasPrice();
expect(minimumGasPrice).not.toBeNull();
expect(minimumGasPrice).toBe("0.000100000000000000cony");
expect(minimumGasPrice).toBe("0.015000000000000000cony,0.015000000000000000stake");
});
});

Expand Down Expand Up @@ -702,7 +702,7 @@ describe("FinschiaClient", () => {
);
const memo = "Cross-chain fun";
const fee = {
amount: coins(2000, "cony"),
amount: coins(2700, "cony"),
gas: "180000", // 180k
};

Expand Down
1 change: 1 addition & 0 deletions packages/finschia/src/modules/fswap/aminomessages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ describe("Amino Sign", () => {
});

it("MsgSwapAll", async () => {
pendingWithoutSimapp();
const [client, tmClient] = await makeClientWithFswap(simapp.tendermintUrl);
const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic, {
hdPaths: [makeLinkPath(0), makeLinkPath(100)],
Expand Down
17 changes: 17 additions & 0 deletions packages/finschia/src/modules/fswap/queries.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,23 @@ describe("FswapExtension", () => {
tmClient.disconnect();
});

it("Swap", async () => {
pendingWithoutSimapp();
const [client, tmClient] = await makeClientWithFswap(simapp.tendermintUrl);

const swap = await client.fswap.swap("cony", "pdt");
expect(swap).toBeDefined();
const expected: Swap = {
fromDenom: "cony",
toDenom: "pdt",
amountCapForToDenom: "1000000000000000000000000000000000000000000000",
swapRate: Decimal.fromUserInput("148079656000000", 18).atomics,
};
expect(swap).toEqual(expected);

tmClient.disconnect();
});

it("TotalSwappableToCoinAmount", async () => {
pendingWithoutSimapp();
assert(beforeTotalSwappableToAmount, "Missing beforeTotalSwappableToAmount");
Expand Down
6 changes: 6 additions & 0 deletions packages/finschia/src/modules/fswap/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import {
QuerySwapsResponse,
} from "@finschia/finschia-proto/lbm/fswap/v1/query";
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
import { Swap } from "@finschia/finschia-proto/lbm/fswap/v1/fswap";

export interface FswapExtension {
readonly fswap: {
readonly swapped: (fromDenom: string, toDenom: string) => Promise<QuerySwappedResponse>;
readonly totalSwappableToCoinAmount: (fromDenom: string, toDenom: string) => Promise<Coin | undefined>;
readonly swaps: (paginationKey?: Uint8Array) => Promise<QuerySwapsResponse>;
readonly swap: (fromDenom: string, toDenom: string) => Promise<Swap | undefined>;
};
}

Expand All @@ -36,6 +38,10 @@ export function setupFswapExtension(base: QueryClient): FswapExtension {
swaps: async (paginationKey?: Uint8Array) => {
return await queryService.Swaps({ pagination: createPagination(paginationKey) });
},
swap: async (fromDenom: string, toDenom: string) => {
const resp = await queryService.Swap({ fromDenom: fromDenom, toDenom: toDenom });
return resp.swap;
},
},
};
}
42 changes: 21 additions & 21 deletions packages/finschia/src/signingfinschiaclient.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ describe("SigningFinschiaClient", () => {
);
const memo = "Cross-chain fun";
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "180000", // 180k
};
const sendAmount = coin(1234, "cony");
Expand Down Expand Up @@ -294,7 +294,7 @@ describe("SigningFinschiaClient", () => {
);
const memo = "Cross-chain fun";
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "180000", // 180k
};
const sendAmount = coin(1234, "cony");
Expand Down Expand Up @@ -1093,7 +1093,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "180000", // 180k
};
const memo = "Use your power wisely";
Expand Down Expand Up @@ -1125,7 +1125,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "99000",
};
const result = await client.signAndBroadcast(faucet.address0, [msgAny], fee);
Expand Down Expand Up @@ -1186,7 +1186,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(5000, "cony"),
gas: "180000", // 180k
};
const memo = "Use your power wisely";
Expand All @@ -1200,7 +1200,7 @@ describe("SigningFinschiaClient", () => {
const tx = decodeTxRaw(searchResult.tx);
// From ModifyingDirectSecp256k1HdWallet
expect(tx.body.memo).toEqual("This was modified");
expect({ ...tx.authInfo.fee!.amount[0] }).toEqual(coin(3000, "cony"));
expect({ ...tx.authInfo.fee!.amount[0] }).toEqual(coin(5000, "cony"));
expect(tx.authInfo.fee!.gasLimit.toNumber()).toEqual(333333);

client.disconnect();
Expand Down Expand Up @@ -1230,7 +1230,7 @@ describe("SigningFinschiaClient", () => {
value: msgSend,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "ampersand:&,lt:<,gt:>";
Expand Down Expand Up @@ -1258,7 +1258,7 @@ describe("SigningFinschiaClient", () => {
value: msgSend,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your tokens wisely";
Expand Down Expand Up @@ -1289,7 +1289,7 @@ describe("SigningFinschiaClient", () => {
value: msgDelegate,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your tokens wisely";
Expand Down Expand Up @@ -1320,7 +1320,7 @@ describe("SigningFinschiaClient", () => {
value: msgStoreCode,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(22500, "cony"),
gas: "1500000",
};
const memo = "Use your tokens wisely";
Expand Down Expand Up @@ -1438,7 +1438,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your power wisely";
Expand Down Expand Up @@ -1469,7 +1469,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(5000, "cony"),
gas: "200000",
};
const memo = "Use your power wisely";
Expand All @@ -1483,7 +1483,7 @@ describe("SigningFinschiaClient", () => {
const tx = decodeTxRaw(searchResult.tx);
// From ModifyingSecp256k1HdWallet
expect(tx.body.memo).toEqual("This was modified");
expect({ ...tx.authInfo.fee!.amount[0] }).toEqual(coin(3000, "cony"));
expect({ ...tx.authInfo.fee!.amount[0] }).toEqual(coin(5000, "cony"));
expect(tx.authInfo.fee!.gasLimit.toNumber()).toEqual(333333);

client.disconnect();
Expand Down Expand Up @@ -1513,7 +1513,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "180000", // 180k
};
const memo = "Use your power wisely";
Expand Down Expand Up @@ -1546,7 +1546,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(5000, "cony"),
gas: "180000", // 180k
};
const memo = "Use your power wisely";
Expand All @@ -1556,7 +1556,7 @@ describe("SigningFinschiaClient", () => {
const authInfo = AuthInfo.decode(signed.authInfoBytes);
// From ModifyingDirectSecp256k1HdWallet
expect(body.memo).toEqual("This was modified");
expect({ ...authInfo.fee!.amount[0] }).toEqual(coin(3000, "cony"));
expect({ ...authInfo.fee!.amount[0] }).toEqual(coin(5000, "cony"));
expect(authInfo.fee!.gasLimit.toNumber()).toEqual(333333);

// ensure signature is valid
Expand Down Expand Up @@ -1588,7 +1588,7 @@ describe("SigningFinschiaClient", () => {
value: msgSend,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your tokens wisely";
Expand Down Expand Up @@ -1622,7 +1622,7 @@ describe("SigningFinschiaClient", () => {
value: msgDelegate,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your tokens wisely";
Expand Down Expand Up @@ -1740,7 +1740,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(3000, "cony"),
gas: "200000",
};
const memo = "Use your power wisely";
Expand Down Expand Up @@ -1774,7 +1774,7 @@ describe("SigningFinschiaClient", () => {
value: msg,
};
const fee = {
amount: coins(2000, "cony"),
amount: coins(5000, "cony"),
gas: "200000",
};
const memo = "Use your power wisely";
Expand All @@ -1784,7 +1784,7 @@ describe("SigningFinschiaClient", () => {
const authInfo = AuthInfo.decode(signed.authInfoBytes);
// From ModifyingSecp256k1HdWallet
expect(body.memo).toEqual("This was modified");
expect({ ...authInfo.fee!.amount[0] }).toEqual(coin(3000, "cony"));
expect({ ...authInfo.fee!.amount[0] }).toEqual(coin(5000, "cony"));
expect(authInfo.fee!.gasLimit.toNumber()).toEqual(333333);

// ensure signature is valid
Expand Down
2 changes: 1 addition & 1 deletion packages/finschia/src/signingfinschiaclientv4.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("SigningFinschiaClient", () => {
gas: "1500000", // 1.5 million
};

describe("signAndBridge", () => {
describe("swapAndBridge", () => {
it("works", async () => {
pendingWithoutSimapp();
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, {
Expand Down
4 changes: 2 additions & 2 deletions packages/finschia/src/testutils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export class ModifyingSecp256k1HdWallet extends Secp256k1HdWallet {
const modifiedSignDoc = {
...signDoc,
fee: {
amount: coins(3000, "cony"),
amount: coins(5000, "cony"),
gas: "333333",
},
memo: "This was modified",
Expand Down Expand Up @@ -302,7 +302,7 @@ export class ModifyingDirectSecp256k1HdWallet extends DirectSecp256k1HdWallet {
pubkey: signerInfo.publicKey!,
sequence: signerInfo.sequence.toNumber(),
}));
const modifiedFeeAmount = coins(3000, "cony");
const modifiedFeeAmount = coins(5000, "cony");
const modifiedGasLimit = 333333;
const modifiedFeeGranter = undefined;
const modifiedFeePayer = undefined;
Expand Down
2 changes: 1 addition & 1 deletion scripts/finschia/env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Choose from https://hub.docker.com/r/finschia/finschianode/tags
REPOSITORY="finschia/finschianode"
VERSION="4.0.0-rc3"
VERSION="4.0.0-rc4"
CONTAINER_NAME="finschia-app"
2 changes: 1 addition & 1 deletion scripts/finschia/template/.finschia/config/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1,0.0001token2).
minimum-gas-prices = "0.0001cony"
minimum-gas-prices = "0.015cony,0.015stake"

# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
Expand Down
2 changes: 1 addition & 1 deletion scripts/simapp/env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Choose from https://hub.docker.com/r/finschia/finschia-simapp/tags
REPOSITORY="finschia/finschia-simapp"
VERSION="0.49.0-rc5"
VERSION="0.49.0-rc6"
CONTAINER_NAME="finschia-simapp"
2 changes: 1 addition & 1 deletion scripts/simapp/template/.simapp/config/app.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# The minimum gas prices a validator is willing to accept for processing a
# transaction. A transaction's fees must meet the minimum of any denomination
# specified in this config (e.g. 0.25token1,0.0001token2).
minimum-gas-prices = "0.0001cony"
minimum-gas-prices = "0.015cony,0.015stake"

# default: the last 100 states are kept in addition to every 500th state; pruning at 10 block intervals
# nothing: all historic states will be saved, nothing will be deleted (i.e. archiving node)
Expand Down
Loading

0 comments on commit dddc5ff

Please sign in to comment.