@Test public void generateERC67() { when(environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .thenReturn("150000"); final CreateERC67FundRequest erc67 = CreateERC67FundRequest .builder() .amount(new BigDecimal("100.384739")) .tokenAddress("0x0000000000000000000000000000000000000000") .platform("github") .platformId("1") .build(); when(erc67Generator.toByteData(erc67)).thenReturn( "0xcae9ca5100000000000000000000000000000000000000000000000000000000deadbeef0000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000c6769746875627c4141437c310000000000000000000000000000000000000000"); assertThat(requestService.generateERC67(erc67)) .isEqualTo( "ethereum:0x0000000000000000000000000000000000000000" + "?value=0" + "&gas=150000" + "&data" + "=0xcae9ca5100000000000000000000000000000000000000000000000000000000deadbeef0000000000000000000000000000000000000000000000056bc75e2d631000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000c6769746875627c4141437c310000000000000000000000000000000000000000"); }
@Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .withParameter("data", erc67Generator.toByteData(createERC67FundRequest)) .build() .visualize(); }
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .withParameter("data", erc67Generator.toByteData(createERC67FundRequest)) .build() .visualize(); } }
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .withParameter("data", erc67Generator.toByteData(createERC67FundRequest)) .build() .visualize(); } RequestServiceImpl(final RequestRepository requestRepository,
                              final Mappers mappers,
                              final GithubPlatformIdParser githubLinkParser,
                              final ProfileService profileService,
                              final ClaimRepository claimRepository,
                              final GithubGateway githubGateway,
                              final GithubClaimResolver githubClaimResolver,
                              final ApplicationEventPublisher eventPublisher,
                              final Erc67Generator erc67Generator,
                              final Environment environment); }
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .withParameter("data", erc67Generator.toByteData(createERC67FundRequest)) .build() .visualize(); } RequestServiceImpl(final RequestRepository requestRepository,
                              final Mappers mappers,
                              final GithubPlatformIdParser githubLinkParser,
                              final ProfileService profileService,
                              final ClaimRepository claimRepository,
                              final GithubGateway githubGateway,
                              final GithubClaimResolver githubClaimResolver,
                              final ApplicationEventPublisher eventPublisher,
                              final Erc67Generator erc67Generator,
                              final Environment environment); @Override @Transactional(readOnly = true) List<RequestDto> findAll(); @Transactional(readOnly = true) List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays); @Override @Transactional(readOnly = true) List<RequestDto> findAll(Iterable<Long> ids); @Override @Transactional(readOnly = true) @Cacheable(value = "technologies", key = "'all'") Set<String> findAllTechnologies(); @Override @Transactional(readOnly = true) @Cacheable(value = "projects", key = "'all'") Set<String> findAllProjects(); @Override @Transactional UserClaimableDto getUserClaimableResult(final Principal principal, final Long requestId); @Override @Transactional ClaimableResultDto getClaimableResult(final Long requestId); @Override @Transactional(readOnly = true) List<RequestDto> findRequestsForUser(Principal principal); @Override @Transactional(readOnly = true) RequestDto findRequest(Long id); @Override @Transactional(readOnly = true) List<CommentDto> getComments(Long requestId); @Override @Transactional(readOnly = true) RequestDto findRequest(Platform platform, String platformId); @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") Long createRequest(CreateRequestCommand command); @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") Request requestClaimed(RequestClaimedCommand command); @Override @Transactional(readOnly = true) SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest); @Override @Transactional(readOnly = true) Boolean canClaim(Principal user, CanClaimRequest canClaimRequest); @Override @Transactional void addWatcherToRequest(Principal principal, Long requestId); @Override @Transactional void removeWatcherFromRequest(Principal principal, Long requestId); @Override String generateERC67(final CreateERC67FundRequest createERC67FundRequest); @Override void update(final UpdateRequestStatusCommand command); }
RequestServiceImpl implements RequestService { @Override public String generateERC67(final CreateERC67FundRequest createERC67FundRequest) { return new ERC67.Builder() .withAddress(createERC67FundRequest.getTokenAddress()) .withNetwork("ethereum") .withParameter("value", "0") .withParameter("gas", environment.getProperty("io.fundrequest.payments.erc67.gas", "200000")) .withParameter("data", erc67Generator.toByteData(createERC67FundRequest)) .build() .visualize(); } RequestServiceImpl(final RequestRepository requestRepository,
                              final Mappers mappers,
                              final GithubPlatformIdParser githubLinkParser,
                              final ProfileService profileService,
                              final ClaimRepository claimRepository,
                              final GithubGateway githubGateway,
                              final GithubClaimResolver githubClaimResolver,
                              final ApplicationEventPublisher eventPublisher,
                              final Erc67Generator erc67Generator,
                              final Environment environment); @Override @Transactional(readOnly = true) List<RequestDto> findAll(); @Transactional(readOnly = true) List<RequestDto> findAllFor(final List<String> projects, final List<String> technologies, final Long lastUpdatedSinceDays); @Override @Transactional(readOnly = true) List<RequestDto> findAll(Iterable<Long> ids); @Override @Transactional(readOnly = true) @Cacheable(value = "technologies", key = "'all'") Set<String> findAllTechnologies(); @Override @Transactional(readOnly = true) @Cacheable(value = "projects", key = "'all'") Set<String> findAllProjects(); @Override @Transactional UserClaimableDto getUserClaimableResult(final Principal principal, final Long requestId); @Override @Transactional ClaimableResultDto getClaimableResult(final Long requestId); @Override @Transactional(readOnly = true) List<RequestDto> findRequestsForUser(Principal principal); @Override @Transactional(readOnly = true) RequestDto findRequest(Long id); @Override @Transactional(readOnly = true) List<CommentDto> getComments(Long requestId); @Override @Transactional(readOnly = true) RequestDto findRequest(Platform platform, String platformId); @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") Long createRequest(CreateRequestCommand command); @Override @Transactional @CacheEvict(value = {"projects", "technologies"}, key = "'all'") Request requestClaimed(RequestClaimedCommand command); @Override @Transactional(readOnly = true) SignedClaim signClaimRequest(Principal user, UserClaimRequest userClaimRequest); @Override @Transactional(readOnly = true) Boolean canClaim(Principal user, CanClaimRequest canClaimRequest); @Override @Transactional void addWatcherToRequest(Principal principal, Long requestId); @Override @Transactional void removeWatcherFromRequest(Principal principal, Long requestId); @Override String generateERC67(final CreateERC67FundRequest createERC67FundRequest); @Override void update(final UpdateRequestStatusCommand command);  }