Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an empty signature for each signer when performing estimate #58

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import cosmos.tx.v1beta1.TxOuterClass.TxBody
import cosmos.tx.v1beta1.getTxRequest
import cosmos.tx.v1beta1.tx
import io.grpc.StatusException
import io.grpc.StatusRuntimeException
import io.grpc.netty.NettyChannelBuilder
import io.provenance.client.common.exceptions.TransactionTimeoutException
import io.provenance.client.common.extensions.txHash
Expand Down Expand Up @@ -102,7 +101,7 @@ open class PbCoroutinesClient(
val transaction = tx {
body = baseReq.body
authInfo = baseReq.buildAuthInfo()
signatures.add(ByteString.EMPTY)
signatures.addAll(baseReq.signers.map { ByteString.EMPTY })
}

val gasAdjustment = baseReq.gasAdjustment ?: GasEstimate.DEFAULT_FEE_ADJUSTMENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import io.grpc.Metadata
import io.grpc.StatusRuntimeException
import io.grpc.stub.AbstractStub
import io.grpc.stub.MetadataUtils
import io.provenance.client.common.gas.GasEstimate
import io.provenance.client.common.exceptions.TransactionTimeoutException
import io.provenance.client.common.extensions.txHash
import io.provenance.client.common.gas.GasEstimate
import io.provenance.client.protobuf.extensions.getBaseAccount
import io.provenance.client.protobuf.extensions.getTx
import io.provenance.msgfees.v1.QueryParamsRequest
Expand Down Expand Up @@ -105,7 +105,8 @@ open class AbstractPbClient<T : ManagedChannelBuilder<T>>(
val tx = TxOuterClass.Tx.newBuilder()
.setBody(baseReq.body)
.setAuthInfo(baseReq.buildAuthInfo())
.addSignatures(ByteString.EMPTY) // signatures are not used for estimates, but a value is required
// signatures are not used for estimates, but a value is required for each signer
.addAllSignatures(baseReq.signers.map { ByteString.EMPTY })
.build()
val gasAdjustment = baseReq.gasAdjustment ?: GasEstimate.DEFAULT_FEE_ADJUSTMENT

Expand Down
Loading