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

rpc type definition + enable test net #458

Merged
merged 2 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 6 additions & 4 deletions packages/api/src/derives/governance/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ export function proposals(instanceId: string, api: ApiInterfaceRx) {
return combineLatest([
api.query.governance.proposalCalls.multi(queryArgsList.map((arg) => [arg.proposalId])),
api.query.governance.proposals.multi(queryArgsList.map((arg) => [arg.proposalId])),
(api.rpc as any).governance.getProposalVotes(),
api.rpc.governance.getProposalVotes(),
]).pipe(
map(
([proposalCalls, proposals, votes]:
| [[], Vec<Option<Proposal>>, Vec<ProposalVotes>]
| [any]): DeriveProposalInfo[] => {
([proposalCalls, proposals, votes]: [
[],
Vec<Option<Proposal>>,
Vec<ProposalVotes>
]): DeriveProposalInfo[] => {
const proposalDetails = proposalCalls.map((call, idx) => {
if (proposals[idx].isSome) {
const proposalDetail = proposals[idx].unwrap().toJSON();
Expand Down
13 changes: 6 additions & 7 deletions packages/api/test/e2e/ethBridge.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,13 @@ describe('Eth bridge test', () => {
});

it( 'Get event id from rpc call', async done => {
// TODO - uncomment the following when rata is healthy again..
// api = await Api.create({network: 'rata'});
// const versionedEventProof = (await api.rpc.ethy.getEventProof('0')).toJSON();
// expect(versionedEventProof.EventProof.eventId.toString()).toEqual('0');
const eventId = api.registry.createType('EthyEventId',1);
const eventProof = await api.derive.ethBridge.eventProof(eventId);
api = await Api.create({network: 'rata'});
const versionedEventProof = (await api.rpc.ethy.getEventProof('1')).toJSON();
expect(versionedEventProof.eventProof.eventId.toString()).toEqual('1');

const eventProof = await api.derive.ethBridge.eventProof('2');
console.log('Proof::',eventProof);
expect(eventProof.eventId).toEqual('1');
expect(eventProof.eventId).toEqual('2');
done();
})

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@cennznet/types/*": ["packages/types/src/*"],
"@cennznet/types": ["packages/types/src/index"],
"@polkadot/api/augment": ["packages/types/src/interfaces/augment-api.ts"],
"@polkadot/rpc/augment": ["packages/types/src/interfaces/augment-api-rpc.ts"],
"@polkadot/types/augment": ["packages/types/src/interfaces/augment-types.ts"],
"@polkadot/types/lookup": ["packages/types/src/interfaces/types-lookup.ts"]
},
Expand Down