Search in sources :

Example 1 with Ok

use of org.fisco.bcos.channel.test.guomi.Ok in project web3sdk by FISCO-BCOS.

the class TestBase method setUpBeforeClass.

@BeforeClass
public static void setUpBeforeClass() throws Exception {
    context = new ClassPathXmlApplicationContext("classpath:applicationContext.xml");
    Service service = context.getBean(Service.class);
    service.run();
    ChannelEthereumService channelEthereumService = new ChannelEthereumService();
    channelEthereumService.setChannelService(service);
    System.out.println("EncryptType =>  " + EncryptType.getEncryptType());
    web3j = Web3j.build(channelEthereumService, service.getGroupId());
    credentials = GenCredential.create();
    Ok ok = Ok.deploy(web3j, credentials, new StaticGasProvider(gasPrice, gasLimit)).send();
    blockNumber = ok.getTransactionReceipt().get().getBlockNumber();
    blockHash = ok.getTransactionReceipt().get().getBlockHash();
    txHash = ok.getTransactionReceipt().get().getTransactionHash();
}
Also used : StaticGasProvider(org.fisco.bcos.web3j.tx.gas.StaticGasProvider) ClassPathXmlApplicationContext(org.springframework.context.support.ClassPathXmlApplicationContext) ChannelEthereumService(org.fisco.bcos.web3j.protocol.channel.ChannelEthereumService) Service(org.fisco.bcos.channel.client.Service) ChannelEthereumService(org.fisco.bcos.web3j.protocol.channel.ChannelEthereumService) Ok(org.fisco.bcos.channel.test.guomi.Ok) BeforeClass(org.junit.BeforeClass)

Aggregations

Service (org.fisco.bcos.channel.client.Service)1 Ok (org.fisco.bcos.channel.test.guomi.Ok)1 ChannelEthereumService (org.fisco.bcos.web3j.protocol.channel.ChannelEthereumService)1 StaticGasProvider (org.fisco.bcos.web3j.tx.gas.StaticGasProvider)1 BeforeClass (org.junit.BeforeClass)1 ClassPathXmlApplicationContext (org.springframework.context.support.ClassPathXmlApplicationContext)1