Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #234 from zeriontech/feature/addEthContractCallCon…
Browse files Browse the repository at this point in the history
…structor

Add EthContractCallBytes constructor, which accepts custom gasPrice
  • Loading branch information
rockfridrich authored Jul 7, 2020
2 parents 2e6fbec + 8a57972 commit 0c759e5
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions Web3Swift/TransactionBytes/EthContractCallBytes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,40 @@ public final class EthContractCallBytes: BytesScalar {
contractAddress: BytesScalar,
weiAmount: BytesScalar,
functionCall: BytesScalar
) {
let gasPrice = CachedBytes(
origin: EthGasPrice(
network: network
)
)
self.init(
network: network,
gasPrice: gasPrice,
senderKey: senderKey,
contractAddress: contractAddress,
weiAmount: weiAmount,
functionCall: functionCall
)
}

/**
Ctor

- parameters:
- network: network where transaction is to be deployed
- gasPrice: gas price in Wei
- senderKey: private key of a sender
- contractAddress: address of the recipient contract
- weiAmount: amount to be sent in wei
- functionCall: encoded function call
*/
public convenience init(
network: Network,
gasPrice: BytesScalar,
senderKey: PrivateKey,
contractAddress: BytesScalar,
weiAmount: BytesScalar,
functionCall: BytesScalar
) {
let senderAddress = CachedBytes(
origin: SimpleBytes{
Expand All @@ -75,11 +109,6 @@ public final class EthContractCallBytes: BytesScalar {
let contractAddress = CachedBytes(
origin: contractAddress
)
let gasPrice = CachedBytes(
origin: EthGasPrice(
network: network
)
)
let functionCall = CachedBytes(
origin: functionCall
)
Expand Down

0 comments on commit 0c759e5

Please sign in to comment.