mirror of
https://github.com/status-im/github-oracle.git
synced 2026-08-27 09:51:10 +00:00
added factory, added branch getter and public repositories
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
* Ricardo Guilherme Schmidt <3esmit@gmail.com>
|
||||
*/
|
||||
|
||||
import "GitHubAPIReg.sol";
|
||||
import "NameRegistry.sol";
|
||||
import "GitRepository.sol";
|
||||
import "./GitHubAPIReg.sol";
|
||||
import "./NameRegistry.sol";
|
||||
import "./GitRepository.sol";
|
||||
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
@@ -37,6 +37,10 @@ contract GitHubRepositoryReg is NameRegistry, GitHubAPIReg {
|
||||
function getAddr(string _name) public constant returns(address addr) {
|
||||
return repositories[indexes[sha3(_name)]].addr;
|
||||
}
|
||||
|
||||
function getBranch(uint256 _id) public constant returns(string branch) {
|
||||
return repositories[_id].branch;
|
||||
}
|
||||
|
||||
//oraclize response callback
|
||||
function __callback(bytes32 myid, string result, bytes proof) {
|
||||
@@ -78,4 +82,11 @@ contract GitHubRepositoryReg is NameRegistry, GitHubAPIReg {
|
||||
return strConcat("json(https://api.github.com/repos/",_repository,credentials,").$.id,full_name,default_branch");
|
||||
}
|
||||
|
||||
}
|
||||
library GitHubRepositoryRegFactory {
|
||||
|
||||
function create() returns (GitHubRepositoryReg){
|
||||
return new GitHubRepositoryReg();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user