Skip to content

Commit

Permalink
PP-355/update-rif-relay-server (#96)
Browse files Browse the repository at this point in the history
* refactor(index): expose typing for relay-server

* refactor: prettier
  • Loading branch information
franciscotobar committed Nov 30, 2022
1 parent 8746dfa commit 608bb6f
Show file tree
Hide file tree
Showing 25 changed files with 3,301 additions and 2,739 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
artifacts
cache
coverage
dist
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ cache
coverage*
gasReporterOutput.json
typechain-types
dist
45 changes: 26 additions & 19 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { withdraw, WithdrawSharesArg } from './tasks/withdraw';
import { HardhatUserConfig, task } from 'hardhat/config';
import { getAllowedTokens } from './tasks/getAllowedTokens';
import { deployCollector, DeployCollectorArg } from './tasks/deployCollector';
import { changePartnerShares, ChangePartnerSharesArg } from './tasks/changePartnerShares';
import {
changePartnerShares,
ChangePartnerSharesArg,
} from './tasks/changePartnerShares';

const config: HardhatUserConfig = {
solidity: {
Expand Down Expand Up @@ -80,8 +83,8 @@ const config: HardhatUserConfig = {
},
};

task('deploy', 'Deploys rif-relay contracts to selected network')
.setAction(async (_, hre) => {
task('deploy', 'Deploys rif-relay contracts to selected network').setAction(
async (_, hre) => {
await deploy(hre);
}
);
Expand All @@ -91,45 +94,49 @@ task('collector:deploy', 'Deploys the collector')
.addOptionalParam('outputFileName', 'Path of the output file')
.setAction(async (taskArgs: DeployCollectorArg, hre) => {
await deployCollector(taskArgs, hre);
}
);
});

task('allow-tokens', 'Allows a list of tokens')
.addPositionalParam('tokenlist', 'list of tokens')
.setAction(async (taskArgs: { tokenlist: string }, hre) => {
await allowTokens(taskArgs, hre);
}
);
});

task('allowed-tokens', 'Retrieves a list of allowed tokens')
.setAction(async (_, hre) => {
task('allowed-tokens', 'Retrieves a list of allowed tokens').setAction(
async (_, hre) => {
await getAllowedTokens(hre);
}
);

task('collector:withdraw', 'Withdraws funds from a collector contract')
.addParam('collectorAddress', 'address of the collector we want to withdraw from')
.addParam('partnerConfig', 'path of the file that includes the partner shares configuration')
.addParam(
'collectorAddress',
'address of the collector we want to withdraw from'
)
.addParam(
'partnerConfig',
'path of the file that includes the partner shares configuration'
)
.addOptionalParam('gasLimit', 'gasLimit to be used for the transaction')
.setAction(async (taskArgs: WithdrawSharesArg, hre) => {
await withdraw(taskArgs, hre);
}
);
});

task('remove-tokens', 'Removes a list of tokens')
.addPositionalParam('tokenlist', 'list of tokens')
.setAction(async (taskArgs: {tokenlist: string}, hre) => {
.setAction(async (taskArgs: { tokenlist: string }, hre) => {
await removeTokens(taskArgs, hre);
}
);
});

task('collector:change-partners', 'Change collector partners')
.addParam('collectorAddress', 'address of the collector we want to modify')
.addParam('partnerConfig', 'path of the file that includes the partner shares configuration')
.addParam(
'partnerConfig',
'path of the file that includes the partner shares configuration'
)
.addOptionalParam('gasLimit', 'gasLimit to be used for the transaction')
.setAction(async (taskArgs: ChangePartnerSharesArg, hre) => {
await changePartnerShares(taskArgs, hre);
}
);
});

export default config;
8 changes: 6 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
export * from './typechain-types';
export * from './typechain-types';
export * from './tasks/deploy';

// We need to explicitly export those types because they're not automatically exported by typechain
export { EnvelopingTypes } from './typechain-types/contracts/RelayHub';
export {
EnvelopingTypes,
StakeUnlockedEvent,
IForwarder as IForwarderTypes,
} from './typechain-types/contracts/RelayHub';
export { TypedEvent } from './typechain-types/common';
Loading

0 comments on commit 608bb6f

Please sign in to comment.