Implemented the GetVoteOnHash under Bor namespace

This commit is contained in:
Vaibhav Jindal 2023-09-12 11:09:08 +05:30
parent 07d7c6c6e2
commit 43d54c4456
2 changed files with 17 additions and 0 deletions

View file

@ -139,6 +139,9 @@ func GetAPIs(apiBackend Backend) []rpc.API {
}, {
Namespace: "personal",
Service: NewPersonalAccountAPI(apiBackend, nonceLock),
}, {
Namespace: "bor",
Service: NewBorAPI(apiBackend),
},
}
}

View file

@ -51,3 +51,17 @@ func (s *BlockChainAPI) appendRPCMarshalBorTransaction(ctx context.Context, bloc
return fields
}
// EthereumAPI provides an API to access Ethereum related information.
type BorAPI struct {
b Backend
}
// NewEthereumAPI creates a new Ethereum protocol API.
func NewBorAPI(b Backend) *BorAPI {
return &BorAPI{b}
}
func (api *BorAPI) GetVoteOnHash(ctx context.Context, starBlockNr uint64, endBlockNr uint64, hash string, milestoneId string) (bool, error) {
return api.b.GetVoteOnHash(ctx, starBlockNr, endBlockNr, hash, milestoneId)
}