Java源码示例:org.web3j.tx.gas.ContractGasProvider

示例1
public static RemoteCall<OnChainPrivacyGroupManagementProxy> deploy(
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider,
    String _implementation) {
  String encodedConstructor =
      FunctionEncoder.encodeConstructor(
          Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, _implementation)));
  return deployRemoteCall(
      OnChainPrivacyGroupManagementProxy.class,
      web3j,
      transactionManager,
      contractGasProvider,
      BINARY,
      encodedConstructor);
}
 
示例2
@Test
public void testStaticGasProvider() throws IOException, TransactionException {
    ContractGasProvider gasProvider = new ContractGasProvider(BigInteger.TEN, BigInteger.ONE);
    TransactionManager txManager = mock(TransactionManager.class);
    when(txManager.executeTransaction(any(), any(), any(), any(), any()))
            .thenReturn(new TransactionReceipt());

    contract = new TestContract(ADDRESS, web3j, txManager, gasProvider);

    Function func = new Function("test",
            Arrays.<Type>asList(), Collections.<TypeReference<?>>emptyList());
    contract.executeTransaction(func);

    verify(txManager).executeTransaction(eq(BigInteger.TEN),
            eq(BigInteger.ONE), any(), any(), any());
}
 
示例3
protected SimpleStorage(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
 
示例4
protected SimpleStorage(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例5
public static SimpleStorage load(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  return new SimpleStorage(contractAddress, web3j, credentials, contractGasProvider);
}
 
示例6
public static SimpleStorage load(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  return new SimpleStorage(contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例7
protected DefaultOnChainPrivacyGroupManagementContract(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
 
示例8
protected DefaultOnChainPrivacyGroupManagementContract(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例9
public static DefaultOnChainPrivacyGroupManagementContract load(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  return new DefaultOnChainPrivacyGroupManagementContract(
      contractAddress, web3j, credentials, contractGasProvider);
}
 
示例10
public static DefaultOnChainPrivacyGroupManagementContract load(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  return new DefaultOnChainPrivacyGroupManagementContract(
      contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例11
public static RemoteCall<DefaultOnChainPrivacyGroupManagementContract> deploy(
    Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      DefaultOnChainPrivacyGroupManagementContract.class,
      web3j,
      credentials,
      contractGasProvider,
      BINARY,
      "");
}
 
示例12
public static RemoteCall<DefaultOnChainPrivacyGroupManagementContract> deploy(
    Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      DefaultOnChainPrivacyGroupManagementContract.class,
      web3j,
      transactionManager,
      contractGasProvider,
      BINARY,
      "");
}
 
示例13
protected OnChainPrivacyGroupManagementInterface(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
 
示例14
protected OnChainPrivacyGroupManagementInterface(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例15
public static OnChainPrivacyGroupManagementInterface load(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  return new OnChainPrivacyGroupManagementInterface(
      contractAddress, web3j, credentials, contractGasProvider);
}
 
示例16
public static OnChainPrivacyGroupManagementInterface load(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  return new OnChainPrivacyGroupManagementInterface(
      contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例17
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy(
    Web3j web3j, Credentials credentials, ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      OnChainPrivacyGroupManagementInterface.class,
      web3j,
      credentials,
      contractGasProvider,
      BINARY,
      "");
}
 
示例18
public static RemoteCall<OnChainPrivacyGroupManagementInterface> deploy(
    Web3j web3j, TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      OnChainPrivacyGroupManagementInterface.class,
      web3j,
      transactionManager,
      contractGasProvider,
      BINARY,
      "");
}
 
示例19
protected OnChainPrivacyGroupManagementProxy(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
 
示例20
protected OnChainPrivacyGroupManagementProxy(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例21
public static OnChainPrivacyGroupManagementProxy load(
    String contractAddress,
    Web3j web3j,
    Credentials credentials,
    ContractGasProvider contractGasProvider) {
  return new OnChainPrivacyGroupManagementProxy(
      contractAddress, web3j, credentials, contractGasProvider);
}
 
示例22
public static OnChainPrivacyGroupManagementProxy load(
    String contractAddress,
    Web3j web3j,
    TransactionManager transactionManager,
    ContractGasProvider contractGasProvider) {
  return new OnChainPrivacyGroupManagementProxy(
      contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例23
@Override
public T execute(final NodeRequests node) {
  final PrivateTransactionManager privateTransactionManager =
      new BesuPrivateTransactionManager(
          node.privacy().getBesuClient(),
          GAS_PROVIDER,
          senderCredentials,
          chainId,
          privateFrom,
          privacyGroupId);
  try {
    final Method method =
        clazz.getMethod(
            "deploy", Web3j.class, TransactionManager.class, ContractGasProvider.class);

    final Object invoked =
        method.invoke(
            METHOD_IS_STATIC,
            node.privacy().getBesuClient(),
            privateTransactionManager,
            GAS_PROVIDER);

    return cast(invoked).send();
  } catch (final Exception e) {
    throw new RuntimeException(e);
  }
}
 
示例24
@Override
public T execute(final NodeRequests node) {
  final PrivateTransactionManager privateTransactionManager =
      new LegacyPrivateTransactionManager(
          node.privacy().getBesuClient(),
          GAS_PROVIDER,
          senderCredentials,
          chainId,
          privateFrom,
          privateFor);
  try {
    final Method method =
        clazz.getMethod(
            "deploy", Web3j.class, TransactionManager.class, ContractGasProvider.class);

    final Object invoked =
        method.invoke(
            METHOD_IS_STATIC,
            node.privacy().getBesuClient(),
            privateTransactionManager,
            GAS_PROVIDER);

    return cast(invoked).send();
  } catch (final Exception e) {
    throw new RuntimeException(e);
  }
}
 
示例25
protected EventEmitter(
    final String contractAddress,
    final Web3j web3j,
    final Credentials credentials,
    final ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
}
 
示例26
protected EventEmitter(
    final String contractAddress,
    final Web3j web3j,
    final TransactionManager transactionManager,
    final ContractGasProvider contractGasProvider) {
  super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例27
public static EventEmitter load(
    final String contractAddress,
    final Web3j web3j,
    final Credentials credentials,
    final ContractGasProvider contractGasProvider) {
  return new EventEmitter(contractAddress, web3j, credentials, contractGasProvider);
}
 
示例28
public static EventEmitter load(
    final String contractAddress,
    final Web3j web3j,
    final TransactionManager transactionManager,
    final ContractGasProvider contractGasProvider) {
  return new EventEmitter(contractAddress, web3j, transactionManager, contractGasProvider);
}
 
示例29
public static RemoteCall<EventEmitter> deploy(
    final Web3j web3j,
    final Credentials credentials,
    final ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      EventEmitter.class, web3j, credentials, contractGasProvider, BINARY, "");
}
 
示例30
public static RemoteCall<EventEmitter> deploy(
    final Web3j web3j,
    final TransactionManager transactionManager,
    final ContractGasProvider contractGasProvider) {
  return deployRemoteCall(
      EventEmitter.class, web3j, transactionManager, contractGasProvider, BINARY, "");
}