Skip to content

Commit

Permalink
fix missing pr
Browse files Browse the repository at this point in the history
  • Loading branch information
noambergIL committed Oct 25, 2020
1 parent a105146 commit 04f761f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions services/consensuscontext/create_transactions_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ package consensuscontext
import (
"context"
"github.com/orbs-network/crypto-lib-go/crypto/digest"
config2 "github.com/orbs-network/orbs-network-go/config"
"github.com/orbs-network/orbs-network-go/config"
"github.com/orbs-network/orbs-network-go/services/processor/native/repository/Triggers"
"github.com/orbs-network/orbs-spec/types/go/primitives"
"github.com/orbs-network/orbs-spec/types/go/protocol"
Expand Down Expand Up @@ -121,7 +121,7 @@ func (s *service) fetchTransactions(ctx context.Context, blockProtocolVersion pr
func (s *service) createTriggerTransaction(blockTime primitives.TimestampNano) *protocol.SignedTransaction {
return (&protocol.SignedTransactionBuilder{
Transaction: &protocol.TransactionBuilder{
ProtocolVersion: config2.MAXIMAL_CLIENT_PROTOCOL_VERSION,
ProtocolVersion: config.MAXIMAL_CLIENT_PROTOCOL_VERSION,
VirtualChainId: s.config.VirtualChainId(),
Timestamp: blockTime,
ContractName: primitives.ContractName(triggers_systemcontract.CONTRACT_NAME),
Expand Down
4 changes: 2 additions & 2 deletions services/transactionpool/validate_transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ func (c *validationContext) ValidateTransactionForOrdering(transaction *protocol

func (c *validationContext) validateAddTransactionProtocolVersion(transaction *protocol.SignedTransaction) *ErrTransactionRejected {
if transaction.Transaction().ProtocolVersion() > config.MAXIMAL_CLIENT_PROTOCOL_VERSION {
return &ErrTransactionRejected{protocol.TRANSACTION_STATUS_REJECTED_UNSUPPORTED_VERSION, log.Stringable("client-protocol-version", config.MAXIMAL_CLIENT_PROTOCOL_VERSION), log.Stringable("protocol-version", transaction.Transaction().ProtocolVersion())}
return &ErrTransactionRejected{protocol.TRANSACTION_STATUS_REJECTED_UNSUPPORTED_VERSION, log.Stringable("maxiaml client-protocol-version", config.MAXIMAL_CLIENT_PROTOCOL_VERSION), log.Stringable("actual client-protocol-version", transaction.Transaction().ProtocolVersion())}
}
return nil
}

func (c *validationContext) validateProtocolVersion(transaction *protocol.SignedTransaction) *ErrTransactionRejected {
if transaction.Transaction().ProtocolVersion() > config.MAXIMAL_CLIENT_PROTOCOL_VERSION {
return &ErrTransactionRejected{protocol.TRANSACTION_STATUS_REJECTED_UNSUPPORTED_VERSION, log.Stringable("client-protocol-version", config.MAXIMAL_CLIENT_PROTOCOL_VERSION), log.Stringable("protocol-version", transaction.Transaction().ProtocolVersion())}
return &ErrTransactionRejected{protocol.TRANSACTION_STATUS_REJECTED_UNSUPPORTED_VERSION, log.Stringable("maxiaml client-protocol-version", config.MAXIMAL_CLIENT_PROTOCOL_VERSION), log.Stringable("actual client-protocol-version", transaction.Transaction().ProtocolVersion())}
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion test/builders/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func GetBalanceQuery() *QueryBuilder {
signer: keyPair.PrivateKey(),
builder: &protocol.SignedQueryBuilder{
Query: &protocol.QueryBuilder{
ProtocolVersion: config.MAXIMAL_CONSENSUS_BLOCK_PROTOCOL_VERSION,
ProtocolVersion: config.MAXIMAL_CLIENT_PROTOCOL_VERSION,
VirtualChainId: DEFAULT_TEST_VIRTUAL_CHAIN_ID,
ContractName: "BenchmarkToken",
MethodName: "getBalance",
Expand Down
2 changes: 1 addition & 1 deletion test/builders/transaction_refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type transactionRef struct {
func TransactionRef() *transactionRef {
return &transactionRef{
builder: &client.TransactionRefBuilder{
ProtocolVersion: config.MAXIMAL_CONSENSUS_BLOCK_PROTOCOL_VERSION,
ProtocolVersion: config.MAXIMAL_CLIENT_PROTOCOL_VERSION,
VirtualChainId: DEFAULT_TEST_VIRTUAL_CHAIN_ID,
TransactionTimestamp: primitives.TimestampNano(time.Now().UnixNano()),
Txhash: hash.CalcSha256([]byte("some-tx-hash")),
Expand Down

0 comments on commit 04f761f

Please sign in to comment.