@@ -7,6 +7,7 @@ mod util;
77
88use common:: prelude:: * ;
99use common:: prometheus;
10+ use common:: web3:: signing:: Key ;
1011use contract:: * ;
1112use ipfs:: * ;
1213use manifest:: { Abi , DataSource , Manifest , Mapping } ;
@@ -18,6 +19,7 @@ use structopt::StructOpt;
1819use tiny_cid:: Cid ;
1920use tokio:: time:: MissedTickBehavior ;
2021use util:: bytes32_to_cid_v0;
22+ use secp256k1:: key:: SecretKey ;
2123
2224fn parse_secs ( secs : & str ) -> Result < Duration , Error > {
2325 Ok ( Duration :: from_secs ( u64:: from_str ( secs) ?) )
@@ -94,15 +96,6 @@ struct Config {
9496 ) ]
9597 contracts : Option < common:: contracts:: ContractConfig > ,
9698
97- #[ structopt(
98- short,
99- long,
100- env = "ORACLE_ADDRESS" ,
101- required_unless( "dry-run" ) ,
102- help = "The address used by by the oracle to sign transactions"
103- ) ]
104- oracle : Option < Address > ,
105-
10699 #[ structopt(
107100 long,
108101 env = "ORACLE_SIGNING_KEY" ,
@@ -151,10 +144,10 @@ async fn run(logger: Logger, config: Config) -> Result<()> {
151144 let subgraph = NetworkSubgraphImpl :: new ( logger. clone ( ) , config. subgraph ) ;
152145 let contract: Box < dyn RewardsManager > = match config. dry_run {
153146 false => {
154- let signing_key = & config. signing_key . unwrap ( ) . parse ( ) ?;
147+ let signing_key: & SecretKey = & config. signing_key . unwrap ( ) . parse ( ) ?;
155148 let contracts_config = config. contracts . unwrap ( ) ;
156149 let web3_context =
157- Web3Context :: new ( & contracts_config. url , config . oracle . unwrap ( ) , signing_key) ?;
150+ Web3Context :: new ( & contracts_config. url , signing_key . address ( ) , signing_key) ?;
158151 let contracts = Contracts :: new ( contracts_config, web3_context) ;
159152 Box :: new ( RewardsManagerContract :: new ( contracts) )
160153 }
0 commit comments