good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 67260a71 authored by Jaynti Kanani's avatar Jaynti Kanani Committed by GitHub
Browse files

Merge pull request #19 from maticnetwork/dev-span-sprint-api-calls

Dev span sprint api calls
parents b343bd10 04f5abcc
Branches
Tags
No related merge requests found
......@@ -87,3 +87,21 @@ func (api *API) GetSignersAtHash(hash common.Hash) ([]common.Address, error) {
}
return snap.signers(), nil
}
// GetCurrentProposer gets the current proposer
func (api *API) GetCurrentProposer() (common.Address, error) {
snap, err := api.GetSnapshot(nil)
if err != nil {
return common.Address{}, err
}
return snap.ValidatorSet.GetProposer().Address, nil
}
// GetCurrentValidators gets the current validators
func (api *API) GetCurrentValidators() ([]*Validator, error) {
snap, err := api.GetSnapshot(nil)
if err != nil {
return make([]*Validator, 0), err
}
return snap.ValidatorSet.Validators, nil
}
......@@ -22,6 +22,7 @@ var Modules = map[string]string{
"admin": AdminJs,
"chequebook": ChequebookJs,
"clique": CliqueJs,
"bor": BorJs,
"ethash": EthashJs,
"debug": DebugJs,
"eth": EthJs,
......@@ -112,6 +113,46 @@ web3._extend({
});
`
const BorJs = `
web3._extend({
property: 'bor',
methods: [
new web3._extend.Method({
name: 'getSnapshot',
call: 'bor_getSnapshot',
params: 1,
inputFormatter: [null]
}),
new web3._extend.Method({
name: 'getSnapshotAtHash',
call: 'bor_getSnapshotAtHash',
params: 1
}),
new web3._extend.Method({
name: 'getSigners',
call: 'bor_getSigners',
params: 1,
inputFormatter: [null]
}),
new web3._extend.Method({
name: 'getSignersAtHash',
call: 'bor_getSignersAtHash',
params: 1
}),
new web3._extend.Method({
name: 'getCurrentProposer',
call: 'bor_getCurrentProposer',
params: 0
}),
new web3._extend.Method({
name: 'getCurrentValidators',
call: 'bor_getCurrentValidators',
params: 0
}),
]
});
`
const EthashJs = `
web3._extend({
property: 'ethash',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment