Update RPCs (babe, contracts) (#2074)

* Update RPCs (babe, contracts)

* Babe in rpc-core
This commit is contained in:
Jaco Greeff
2020-03-21 07:50:56 +01:00
committed by GitHub
parent f412a5ac86
commit af11444b72
6 changed files with 52 additions and 4 deletions
+4 -1
View File
@@ -6,7 +6,7 @@ import { BitVec, Bytes, Data, Null, StorageKey, Text, Type, U256, Unconstructabl
import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations';
import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura';
import { UncleEntryItem } from '@polkadot/types/interfaces/authorship';
import { BabeAuthorityWeight, BabeBlockWeight, BabeWeight, MaybeVrf, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondary, RawBabePreDigestSecondaryTo159, RawBabePreDigestTo159, SlotNumber, VrfData, VrfProof } from '@polkadot/types/interfaces/babe';
import { BabeAuthorityWeight, BabeBlockWeight, BabeWeight, EpochAuthorship, MaybeVrf, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondary, RawBabePreDigestSecondaryTo159, RawBabePreDigestTo159, SlotNumber, VrfData, VrfProof } from '@polkadot/types/interfaces/babe';
import { AccountData, BalanceLock, BalanceLockTo212, Reasons, ReleasesBalances, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances';
import { EthereumAddress } from '@polkadot/types/interfaces/claims';
import { MemberCount, ProposalIndex, Votes, VotesTo230 } from '@polkadot/types/interfaces/collective';
@@ -292,6 +292,9 @@ declare module '@polkadot/types/types/registry' {
'Compact<BabeWeight>': Compact<BabeWeight>;
'Option<BabeWeight>': Option<BabeWeight>;
'Vec<BabeWeight>': Vec<BabeWeight>;
EpochAuthorship: EpochAuthorship;
'Option<EpochAuthorship>': Option<EpochAuthorship>;
'Vec<EpochAuthorship>': Vec<EpochAuthorship>;
RawBabePreDigest: RawBabePreDigest;
'Option<RawBabePreDigest>': Option<RawBabePreDigest>;
'Vec<RawBabePreDigest>': Vec<RawBabePreDigest>;
@@ -5,13 +5,23 @@
import { Definitions } from '../../types';
export default {
rpc: {},
rpc: {
epochAuthorship: {
description: 'Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore',
params: [],
type: 'HashMap<AuthorityId, EpochAuthorship>'
}
},
types: {
BabeAuthorityWeight: 'u64',
BabeBlockWeight: 'u32',
MaybeVrf: 'Option<VrfData>',
// TODO Remove as soon as merged and metadata static updated
BabeWeight: 'u64',
EpochAuthorship: {
primary: 'Vec<u64>',
secondary: 'Vec<u64>'
},
RawBabePreDigest: {
_enum: {
Phantom: 'Null', // index starts at 1... empty slot at 0
+7 -1
View File
@@ -1,7 +1,7 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import { Enum, Option, Struct, U8aFixed } from '@polkadot/types/codec';
import { Enum, Option, Struct, U8aFixed, Vec } from '@polkadot/types/codec';
import { u32, u64 } from '@polkadot/types/primitive';
/** @name BabeAuthorityWeight */
@@ -13,6 +13,12 @@ export interface BabeBlockWeight extends u32 {}
/** @name BabeWeight */
export interface BabeWeight extends u64 {}
/** @name EpochAuthorship */
export interface EpochAuthorship extends Struct {
readonly primary: Vec<u64>;
readonly secondary: Vec<u64>;
}
/** @name MaybeVrf */
export interface MaybeVrf extends Option<VrfData> {}
@@ -39,6 +39,21 @@ export default {
}
],
type: 'Option<Bytes>'
},
rentProjection: {
description: 'Returns the projected time a given contract will be able to sustain paying its rent',
params: [
{
name: 'address',
type: 'AccountId'
},
{
name: 'at',
type: 'BlockHash',
isOptional: true
}
],
type: 'Option<BlockNumber>'
}
},
types: {