Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fee calculation logic #50

Merged
merged 23 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
47cea2c
Update fee calculation logic
danforbes May 19, 2020
8ce7eaf
Address code review by @athei and @amaurymartiny
danforbes May 20, 2020
cae3531
Do not pull raw/parsed extrinsics into separate variables
danforbes May 20, 2020
2409f63
Remove Address and LookupSource types per @amaurymartiny
danforbes May 20, 2020
a7b8206
Bump Polkadot JS deps and remove WeightToFeeCoefficient type
danforbes May 21, 2020
28659ab
Use variables consistently
danforbes May 21, 2020
4dda869
Clean up diff
danforbes May 21, 2020
56f697f
Update lockfile, formatting changes
danforbes May 21, 2020
eb3211a
Update fee calculation logic
danforbes May 22, 2020
006e984
Rename variables, better comments (#54)
amaury1093 May 22, 2020
5b3b643
Upgraded to latest polkadot API release
athei May 26, 2020
017fc30
Fixes for weight calculation
athei May 26, 2020
1d3f87f
Calculate extrinsic fees in rust
athei May 27, 2020
52d91dc
Fix CI
athei May 27, 2020
f723c34
Merge branch 'master' into update-fees
athei Jun 6, 2020
7139830
Reproduce fixed128 bug that was deployed to polkadot v0.
athei Jun 6, 2020
8aa6f1f
Support kusama without queryInfo
athei Jun 7, 2020
1ab5267
Do not fail the whole request when runtime is not supported
athei Jun 7, 2020
3c21419
Do not send per block parameters for every extrinsic to wasm
athei Jun 7, 2020
d098672
Install wasm-pack through node
athei Jun 7, 2020
39c2796
Merge branch 'master' into update-fees
athei Jun 7, 2020
8c2230e
Remove no longer needed bn.js dependency
athei Jun 7, 2020
253989e
Revert "Install wasm-pack through node"
athei Jun 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ jobs:
node-version: [10.x, 12.x]

steps:
- name: Install wasm-pack
uses: jetli/[email protected]
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm i && npm run build
- run: yarn
- run: yarn build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.vscode
/node_modules
/build
/target
Expand Down
2 changes: 2 additions & 0 deletions calc-fee/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/pkg
281 changes: 281 additions & 0 deletions calc-fee/Cargo.lock

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

26 changes: 26 additions & 0 deletions calc-fee/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "calc-fee"
version = "0.1.0"
authors = ["Alexander Theißen <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
publish = false
repository = "https://github.com/polkadot-js/wasm/"
description = "Calculate extrinsic fees off-chain"

[lib]
crate-type = ["cdylib"]

[features]
debug = ["console_error_panic_hook"]

[dependencies]
wasm-bindgen = { version = "0.2", default_features = false, features = ["serde-serialize"] }
serde_derive = { version = "1", default_features = false }
serde = { version = "1", default_features = false }
console_error_panic_hook = { version = "0.1", optional = true }
sp-arithmetic = { git = "https://github.com/paritytech/substrate", default_features = false }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should replace that by a released version as soon as that is possible. The current release on crates.io (2.0.0-rc2) has a broken Fixed128 impl that does not work with negative coefficients on unsigned Balances.


[profile.release]
opt-level = "z"
lto = true
Loading