Unverified Commit e87accba authored by emostov's avatar emostov
Browse files

merge origin master

parents 56760330 985fc46c
name: docs
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
createDocsPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 3
- name: Generate docs
run: |
yarn install
yarn docs
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v3
with:
# base: ${{ github.head_ref }} # use if generating docs on `on: pull_request`
commit-message: 'docs: Generate docs'
signoff: false
branch: actions-generate-docs
delete-branch: true
title: 'docs: Generate docs'
body: |
Docs generated using `typedoc`
- PR auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
reviewers: emostov, dvdplm, maciejhirsz
- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
......@@ -2,6 +2,15 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
### [3.10.6](https://github.com/paritytech/txwrapper/compare/v3.10.5...v3.10.6) (2021-01-04)
### Bug Fixes
* Accommodate polkadot-js meta update & AbstractInt.toJSON update ([#352](https://github.com/paritytech/txwrapper/issues/352)) ([56a1e80](https://github.com/paritytech/txwrapper/commit/56a1e804809eaf8ed3a2b5a9f8517b29a7482fb4))
### [3.10.5](https://github.com/paritytech/txwrapper/compare/v3.10.4...v3.10.5) (2020-12-29)
### [3.10.4](https://github.com/paritytech/txwrapper/compare/v3.10.3...v3.10.4) (2020-12-16)
### [3.10.3](https://github.com/paritytech/txwrapper/compare/v3.10.1...v3.10.3) (2020-11-20)
......
......@@ -20,6 +20,10 @@
<br /><br />
## Note
If you are a chain builder looking to build a chain specific `txwrapper` please take a look at [`txwrapper-core`](https://github.com/paritytech/txwrapper-core) and the [guide for chain builders](https://github.com/paritytech/txwrapper-core/blob/main/CHAIN_BUILDER.md). Any feedback is welcome, just make [an issue at that repo](https://github.com/paritytech/txwrapper-core/issues).
## Get Started
```bash
......
{
"name": "@substrate/txwrapper",
"version": "3.10.4",
"version": "3.10.6",
"author": "Parity Technologies <admin@parity.io>",
"description": "Helper functions for offline transaction generation.",
"files": [
......@@ -20,31 +20,31 @@
"test": "jest"
},
"dependencies": {
"@polkadot/api": "3.0.2-6",
"@types/memoizee": "^0.4.3",
"@polkadot/api": "3.3.1",
"memoizee": "^0.4.14"
},
"devDependencies": {
"@types/jest": "^26.0.0",
"@typescript-eslint/eslint-plugin": "^4.10.0",
"@typescript-eslint/parser": "^4.10.0",
"eslint": "^7.15.0",
"eslint-config-prettier": "^7.0.0",
"eslint-plugin-prettier": "^3.1.4",
"@types/memoizee": "^0.4.3",
"@typescript-eslint/eslint-plugin": "^4.12.0",
"@typescript-eslint/parser": "^4.12.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^26.2.2",
"prettier": "^2.0.5",
"standard-version": "^9.0.0",
"standard-version": "^9.1.0",
"ts-jest": "^26.4.1",
"ts-node": "^9.0.0",
"typedoc": "^0.19.1",
"typedoc-plugin-markdown": "^3.0.2",
"typedoc": "^0.20.11",
"typedoc-plugin-markdown": "^3.2.1",
"typescript": "^4.0.2"
},
"resolutions": {
"acorn": ">=7.1.1",
"kind-of": ">=6.0.3",
"minimist": ">=1.2.2",
"dot-prop": "^5.1.1"
"dot-prop": ">=5.1.1"
}
}
......@@ -25,7 +25,7 @@ describe('decode', () => {
const signedTx = createSignedTx(unsigned, signature, KUSAMA_TEST_OPTIONS);
const txInfo = decode(signedTx, KUSAMA_TEST_OPTIONS);
const txInfo = decode(signedTx, KUSAMA_TEST_OPTIONS, true);
decodeSignedBase(txInfo);
expect(txInfo.method.pallet).toBe('balances');
......@@ -41,7 +41,7 @@ describe('decode', () => {
TEST_BASE_TX_INFO,
KUSAMA_TEST_OPTIONS
);
const txInfo = decode(unsigned, KUSAMA_TEST_OPTIONS);
const txInfo = decode(unsigned, KUSAMA_TEST_OPTIONS, true);
decodeUnsignedBase(txInfo);
expect(txInfo.method.pallet).toBe('balances');
......@@ -59,7 +59,8 @@ describe('decode', () => {
const txInfo = decode(
signingPayload,
KUSAMA_TEST_OPTIONS
KUSAMA_TEST_OPTIONS,
true
) as DecodedSigningPayload;
decodeSigningBase(txInfo);
......
......@@ -42,7 +42,7 @@ function testDecodeSignedTx(pallet: string, name: string): void {
const signedTx = createSignedTx(unsigned, signature, KUSAMA_TEST_OPTIONS);
const txInfo = decodeSignedTx(signedTx, KUSAMA_TEST_OPTIONS);
const txInfo = decodeSignedTx(signedTx, KUSAMA_TEST_OPTIONS, true);
decodeBaseTxInfo(txInfo);
expect(txInfo.method.pallet).toBe(pallet);
......
......@@ -42,7 +42,11 @@ function testDecodeSigningPayload(pallet: string, name: string): void {
),
KUSAMA_TEST_OPTIONS
);
const txInfo = decodeSigningPayload(signingPayload, KUSAMA_TEST_OPTIONS);
const txInfo = decodeSigningPayload(
signingPayload,
KUSAMA_TEST_OPTIONS,
true
);
decodeBaseTxInfo(txInfo);
expect(txInfo.method.pallet).toBe(pallet);
......
......@@ -43,7 +43,7 @@ function testDecodeUnsignedTx(pallet: string, name: string): void {
KUSAMA_TEST_OPTIONS
);
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-explicit-any */
const txInfo = decodeUnsignedTx(unsigned, KUSAMA_TEST_OPTIONS);
const txInfo = decodeUnsignedTx(unsigned, KUSAMA_TEST_OPTIONS, true);
decodeBaseTxInfo(txInfo);
expect(txInfo.method.pallet).toBe(pallet);
......
import { Metadata } from '@polkadot/metadata';
import {
constantsFromMeta,
extrinsicsFromMeta,
decorateConstants,
decorateExtrinsics,
} from '@polkadot/metadata/decorate';
import { Extrinsics } from '@polkadot/metadata/decorate/types';
import { Constants } from '@polkadot/metadata/decorate/types';
import { TypeRegistry } from '@polkadot/types';
import { ModulesWithCalls } from '@polkadot/types/types';
import { getSpecTypes } from '@polkadot/types-known';
import memoizee from 'memoizee';
......@@ -89,8 +89,9 @@ export const createMetadata = memoizee(createMetadataUnmemoized, {
export function createDecoratedTx(
registry: TypeRegistry,
metadataRpc: string
): ModulesWithCalls {
return extrinsicsFromMeta(registry, createMetadata(registry, metadataRpc));
): Extrinsics {
const metadata = createMetadata(registry, metadataRpc);
return decorateExtrinsics(registry, metadata.asLatest, metadata.version);
}
/**
......@@ -104,7 +105,10 @@ export function createDecoratedConstants(
registry: TypeRegistry,
metadataRpc: string
): Constants {
return constantsFromMeta(registry, createMetadata(registry, metadataRpc));
return decorateConstants(
registry,
createMetadata(registry, metadataRpc).asLatest
);
}
/**
......
......@@ -158,7 +158,7 @@ export function toTxMethod(
return {
args,
name: method.methodName,
pallet: method.sectionName,
name: method.method,
pallet: method.section,
};
}
......@@ -165,7 +165,7 @@ export const TEST_METHOD_ARGS = {
balances: {
transfer: {
dest: 'Fy2rsYCoowQBtuFXqLE65ehAY9T6KWcGiNCQAyPDCkfpm4s',
value: 12,
value: '12',
},
transferKeepAlive: {
dest: 'Fy2rsYCoowQBtuFXqLE65ehAY9T6KWcGiNCQAyPDCkfpm4s',
......
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment