Skip to content

Commit

Permalink
build(deps): Bump cosmjs-types from 0.8.0 to 0.9.0 (#283)
Browse files Browse the repository at this point in the history
* build(deps): Bump cosmjs-types from 0.8.0 to 0.9.0

Bumps [cosmjs-types](https://github.com/confio/cosmjs-types) from 0.8.0 to 0.9.0.
- [Changelog](https://github.com/confio/cosmjs-types/blob/main/CHANGELOG.md)
- [Commits](confio/cosmjs-types@v0.8.0...v0.9.0)

---
updated-dependencies:
- dependency-name: cosmjs-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* lockfile

* Update signer.ts

* Update package-lock.json

* lockfile

* Rolling back uint8arrays

* Revert "Rolling back uint8arrays"

This reverts commit 7ea641d.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ankur Banerjee <[email protected]>
  • Loading branch information
dependabot[bot] and ankurdotb authored Nov 27, 2023
1 parent 3751392 commit 3ac522e
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 75 deletions.
150 changes: 84 additions & 66 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"@cosmjs/utils": "^0.31.3",
"@stablelib/ed25519": "^1.0.3",
"@types/secp256k1": "^4.0.6",
"cosmjs-types": "^0.8.0",
"cosmjs-types": "^0.9.0",
"did-jwt": "^7.4.5",
"did-resolver": "^4.1.0",
"file-type": "^18.7.0",
Expand All @@ -79,18 +79,17 @@
"@semantic-release/npm": "^11.0.1",
"@semantic-release/release-notes-generator": "^12.1.0",
"@types/jest": "^29.5.10",
"@types/node": "^20.9.4",
"@types/node": "^20.10.0",
"@types/uuid": "^9.0.7",
"conventional-changelog-conventionalcommits": "^7.0.2",
"cross-env": "^7.0.3",
"jest": "^29.7.0",
"long": "^4.0.0",
"prettier": "^3.1.0",
"semantic-release": "^22.0.8",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.3.2",
"uint8arrays": "^4.0.6"
"uint8arrays": "^4.0.9"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
Expand Down
9 changes: 4 additions & 5 deletions src/signer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import { AuthInfo, SignerInfo, TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.j
import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js';
import { Any } from 'cosmjs-types/google/protobuf/any.js';
import { Coin } from 'cosmjs-types/cosmos/base/v1beta1/coin.js';
import Long from 'long';

export function calculateDidFee(gasLimit: number, gasPrice: string | GasPrice): DidStdFee {
return calculateFee(gasLimit, gasPrice);
Expand All @@ -50,23 +49,23 @@ export function makeSignerInfos(
modeInfo: {
single: { mode: signMode },
},
sequence: Long.fromNumber(sequence),
sequence: BigInt(sequence),
})
);
}

export function makeDidAuthInfoBytes(
signers: ReadonlyArray<{ readonly pubkey: Any; readonly sequence: number }>,
feeAmount: readonly Coin[],
gasLimit: number,
gasLimit: bigint,
feePayer: string,
signMode = SignMode.SIGN_MODE_DIRECT
): Uint8Array {
const authInfo = {
signerInfos: makeSignerInfos(signers, signMode),
fee: {
amount: [...feeAmount],
gasLimit: Long.fromNumber(gasLimit),
gasLimit: gasLimit,
payer: feePayer,
},
};
Expand Down Expand Up @@ -170,7 +169,7 @@ export class CheqdSigningStargateClient extends SigningStargateClient {
};
const txBodyBytes = this.registry.encode(txBodyEncodeObject);
const gasLimit = Int53.fromString(fee.gas).toNumber();
const authInfoBytes = makeDidAuthInfoBytes([{ pubkey, sequence }], fee.amount, gasLimit, fee.payer!);
const authInfoBytes = makeDidAuthInfoBytes([{ pubkey, sequence }], fee.amount, BigInt(gasLimit), fee.payer!);
const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
const { signature, signed } = await this._signer.signDirect(signerAddress, signDoc);
return TxRaw.fromPartial({
Expand Down

0 comments on commit 3ac522e

Please sign in to comment.