Skip to content

Commit

Permalink
New configuration format for service3
Browse files Browse the repository at this point in the history
  • Loading branch information
talkol committed Aug 6, 2020
1 parent 7454596 commit 88296d8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 1 addition & 2 deletions e2e/expectations-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ export const expectationNodeManagement = {
DistributionFrequencySeconds: 112233,
EthereumEndpoint: 'http://ganache:7545',
SignerEndpoint: 'http://signer:7777',
EthereumDelegationsContract: isValidEthereumAddress,
EthereumRewardsContract: isValidEthereumAddress,
EthereumGenesisContract: isValidEthereumAddress,
GuardianAddress: '0x29ce860a2247d97160d6dfc087a15f41e2349087',
NodeOrbsAddress: '16fcf728f8dc3f687132f2157d8379c021a08c12',
EthereumFirstBlock: 0,
Expand Down
3 changes: 1 addition & 2 deletions src/api/render-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ test.serial('[integration] getNodeManagement responds according to Ethereum and
t.deepEqual(res.services['rewards-service'].Config, {
EthereumEndpoint: config.EthereumEndpoint,
SignerEndpoint: 'http://signer:7777',
EthereumDelegationsContract: ethereum.getContractAddress('delegations'),
EthereumRewardsContract: ethereum.getContractAddress('rewards'),
EthereumGenesisContract: config.EthereumGenesisContract,
GuardianAddress: '0x29ce860a2247d97160d6dfc087a15f41e2349087',
NodeOrbsAddress: '16fcf728f8dc3f687132f2157d8379c021a08c12',
EthereumFirstBlock: config.EthereumFirstBlock,
Expand Down
7 changes: 1 addition & 6 deletions src/api/render-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ function getEthereumWriter(snapshot: StateSnapshot, config: ServiceConfiguration
function getRewardsService(snapshot: StateSnapshot, config: ServiceConfiguration) {
const version = snapshot.CurrentImageVersions['main']['rewards-service'];
if (!version) return undefined;
const delegations = snapshot.CurrentContractAddress['delegations'];
if (!delegations) return undefined;
const rewards = snapshot.CurrentContractAddress['rewards'];
if (!rewards) return undefined;
const guardian = _.findKey(snapshot.CurrentOrbsAddress, (orbsAddress) => orbsAddress == config['node-address']);
if (!guardian) return undefined;
const registration = snapshot.CurrentRegistrationData[guardian];
Expand All @@ -131,8 +127,7 @@ function getRewardsService(snapshot: StateSnapshot, config: ServiceConfiguration
DistributionFrequencySeconds: frequency > 0 ? frequency : undefined,
EthereumEndpoint: config.EthereumEndpoint,
SignerEndpoint: 'http://signer:7777',
EthereumDelegationsContract: delegations,
EthereumRewardsContract: rewards,
EthereumGenesisContract: config.EthereumGenesisContract,
GuardianAddress: `0x${guardian}`,
NodeOrbsAddress: config['node-address'],
EthereumFirstBlock: config.EthereumFirstBlock,
Expand Down

0 comments on commit 88296d8

Please sign in to comment.