Fix payout size calculation (#4179)

This commit is contained in:
Jaco Greeff 2020-12-08 21:37:26 +01:00 committed by GitHub
parent 2e6cbe8f7c
commit ab67bdcac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,9 +94,9 @@ function PayButton ({ className, isAll, isDisabled, payout }: Props): React.Reac
.sub(api.consts.system.blockWeights.perClass.normal.baseExtrinsic)
.div(info.weight)
.toNumber()
// 65% of the block weight on a single extrinsic (64 for safety)
: (api.consts.system.maximumBlockWeight as Weight)
.muln(64)
.muln(64) // 65% of the block weight on a single extrinsic (64 for safety)
.div(info.weight)
.toNumber() / 100
)))
.catch(console.error);