Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Mar 26, 2024
1 parent 1930c89 commit fd7372c
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 314 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,7 @@ test-short:
## test-race: Run unit tests in race mode.
test-race:
@echo "--> Running tests in race mode"
<<<<<<< HEAD
@go test ./... -v -race -skip "TestPrepareProposalConsistency|TestIntegrationTestSuite|TestQGBRPCQueries|TestSquareSizeIntegrationTest|TestStandardSDKIntegrationTestSuite|TestTxsimCommandFlags|TestTxsimCommandEnvVar|TestMintIntegrationTestSuite|TestQGBCLI|TestUpgrade|TestMaliciousTestNode|TestMaxTotalBlobSizeSuite|TestQGBIntegrationSuite|TestSignerTestSuite|TestPriorityTestSuite|TestTimeInPrepareProposalContext"
=======
@go test ./... -v -race -skip "TestPrepareProposalConsistency|TestIntegrationTestSuite|TestBlobstreamRPCQueries|TestSquareSizeIntegrationTest|TestStandardSDKIntegrationTestSuite|TestTxsimCommandFlags|TestTxsimCommandEnvVar|TestMintIntegrationTestSuite|TestBlobstreamCLI|TestUpgrade|TestMaliciousTestNode|TestBigBlobSuite|TestQGBIntegrationSuite|TestSignerTestSuite|TestPriorityTestSuite|TestTimeInPrepareProposalContext|TestBlobstream|TestCLITestSuite|TestLegacyUpgrade|TestSignerTwins|TestConcurrentTxSubmission"
>>>>>>> deefb542 (feat: nonce handling with signer (#3196))
@go test ./... -v -race -skip "TestPrepareProposalConsistency|TestIntegrationTestSuite|TestQGBRPCQueries|TestSquareSizeIntegrationTest|TestStandardSDKIntegrationTestSuite|TestTxsimCommandFlags|TestTxsimCommandEnvVar|TestMintIntegrationTestSuite|TestQGBCLI|TestUpgrade|TestMaliciousTestNode|TestMaxTotalBlobSizeSuite|TestQGBIntegrationSuite|TestSignerTestSuite|TestPriorityTestSuite|TestTimeInPrepareProposalContext|TestSignerTwins|TestConcurrentTxSubmission"
.PHONY: test-race

## test-bench: Run unit tests in bench mode.
Expand Down
4 changes: 0 additions & 4 deletions app/errors/insufficient_gas_price_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,7 @@ func TestInsufficientMinGasPriceIntegration(t *testing.T) {
pfb, err := blob.NewMsgPayForBlobs(address.String(), b)
require.NoError(t, err, address)

<<<<<<< HEAD
tx, err := signer.BuildSignedTx(builder, pfb)
=======
sdkTx, err := signer.CreateTx([]sdk.Msg{msg}, user.SetGasLimit(gasLimit), user.SetFeeAmount(fee))
>>>>>>> deefb542 (feat: nonce handling with signer (#3196))
require.NoError(t, err)

decorator := ante.NewDeductFeeDecorator(testApp.AccountKeeper, testApp.BankKeeper, testApp.FeeGrantKeeper, nil)
Expand Down
4 changes: 0 additions & 4 deletions app/errors/nonce_mismatch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@ func TestNonceMismatchIntegration(t *testing.T) {
pfb, err := blob.NewMsgPayForBlobs(address.String(), b)
require.NoError(t, err, address)

<<<<<<< HEAD
tx, err := signer.BuildSignedTx(builder, pfb)
=======
sdkTx, err := signer.CreateTx([]sdk.Msg{msg})
>>>>>>> deefb542 (feat: nonce handling with signer (#3196))
require.NoError(t, err)

decorator := ante.NewSigVerificationDecorator(testApp.AccountKeeper, encCfg.TxConfig.SignModeHandler())
Expand Down
89 changes: 0 additions & 89 deletions app/test/big_blob_test.go

This file was deleted.

20 changes: 1 addition & 19 deletions app/test/priority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,31 +77,14 @@ func (s *PriorityTestSuite) TestPriorityByGasPrice() {
gasLimit := blobtypes.DefaultEstimateGas([]uint32{blobSize})
wg := &sync.WaitGroup{}
for _, signer := range s.signers {
<<<<<<< HEAD
blobSize := uint32(100)
gasLimit := blobtypes.DefaultEstimateGas([]uint32{blobSize})
gasPrice := s.rand.Float64()
btx, err := signer.CreatePayForBlob(
blobfactory.ManyBlobs(
t,
s.rand,
[]namespace.Namespace{namespace.RandomBlobNamespace()},
[]int{100}),
user.SetGasLimitAndFee(gasLimit, gasPrice),
)
require.NoError(t, err)
resp, err := signer.BroadcastTx(s.cctx.GoContext(), btx)
require.NoError(t, err)
require.Equal(t, abci.CodeTypeOK, resp.Code)
hashes = append(hashes, resp.TxHash)
=======
wg.Add(1)
go func() {
defer wg.Done()
gasPrice := float64(s.rand.Intn(1000)+1) / 1000
resp, err := signer.SubmitPayForBlob(

Check failure on line 84 in app/test/priority_test.go

View workflow job for this annotation

GitHub Actions / lint / golangci-lint

loopclosure: loop variable signer captured by func literal (govet)
s.cctx.GoContext(),
blobfactory.ManyBlobs(
t,
s.rand,
[]namespace.Namespace{namespace.RandomBlobNamespace()},
[]int{100}),
Expand All @@ -111,7 +94,6 @@ func (s *PriorityTestSuite) TestPriorityByGasPrice() {
require.Equal(t, abci.CodeTypeOK, resp.Code, resp.RawLog)
hashes <- resp.TxHash
}()
>>>>>>> deefb542 (feat: nonce handling with signer (#3196))
}

wg.Wait()
Expand Down
29 changes: 18 additions & 11 deletions pkg/user/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import (
"testing"
"time"

"github.com/celestiaorg/celestia-app/app"
"github.com/celestiaorg/celestia-app/app/encoding"
"github.com/celestiaorg/celestia-app/pkg/appconsts"
"github.com/celestiaorg/celestia-app/pkg/user"
"github.com/celestiaorg/celestia-app/test/util/blobfactory"
"github.com/celestiaorg/celestia-app/test/util/testnode"
"github.com/celestiaorg/go-square/blob"
"github.com/stretchr/testify/require"
tmrand "github.com/tendermint/tendermint/libs/rand"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)

func TestConcurrentTxSubmission(t *testing.T) {
Expand All @@ -29,12 +31,12 @@ func TestConcurrentTxSubmission(t *testing.T) {
require.NoError(t, err)

// Setup signer
signer, err := testnode.NewSingleSignerFromContext(ctx)
signer, err := newSingleSignerFromContext(ctx)
require.NoError(t, err)

// Pregenerate all the blobs
numTxs := 10
blobs := blobfactory.ManyRandBlobs(tmrand.NewRand(), blobfactory.Repeat(2048, numTxs)...)
blobs := blobfactory.ManyRandBlobs(t, tmrand.NewRand(), blobfactory.Repeat(2048, numTxs)...)

// Prepare transactions
var (
Expand All @@ -47,9 +49,9 @@ func TestConcurrentTxSubmission(t *testing.T) {
time.AfterFunc(time.Minute, cancel)
for i := 0; i < numTxs; i++ {
wg.Add(1)
go func(b *blob.Blob) {
go func(b *tmproto.Blob) {
defer wg.Done()
_, err := signer.SubmitPayForBlob(subCtx, []*blob.Blob{b}, user.SetGasLimitAndFee(500_000, appconsts.DefaultGlobalMinGasPrice))
_, err := signer.SubmitPayForBlob(subCtx, []*tmproto.Blob{b}, user.SetGasLimitAndFee(500_000, appconsts.DefaultMinGasPrice))
if err != nil && !errors.Is(err, context.Canceled) {
// only catch the first error
select {
Expand Down Expand Up @@ -81,20 +83,25 @@ func TestSignerTwins(t *testing.T) {
_, err := ctx.WaitForHeight(1)
require.NoError(t, err)

signer1, err := testnode.NewSingleSignerFromContext(ctx)
signer1, err := newSingleSignerFromContext(ctx)
require.NoError(t, err)
signer2, err := testnode.NewSingleSignerFromContext(ctx)
signer2, err := newSingleSignerFromContext(ctx)
require.NoError(t, err)

blobs := blobfactory.ManyRandBlobs(tmrand.NewRand(), blobfactory.Repeat(2048, 8)...)
blobs := blobfactory.ManyRandBlobs(t, tmrand.NewRand(), blobfactory.Repeat(2048, 8)...)

_, err = signer1.SubmitPayForBlob(ctx.GoContext(), blobs[:1], user.SetGasLimitAndFee(500_000, appconsts.DefaultGlobalMinGasPrice))
_, err = signer1.SubmitPayForBlob(ctx.GoContext(), blobs[:1], user.SetGasLimitAndFee(500_000, appconsts.DefaultMinGasPrice))
require.NoError(t, err)

_, err = signer2.SubmitPayForBlob(ctx.GoContext(), blobs[1:3], user.SetGasLimitAndFee(500_000, appconsts.DefaultGlobalMinGasPrice))
_, err = signer2.SubmitPayForBlob(ctx.GoContext(), blobs[1:3], user.SetGasLimitAndFee(500_000, appconsts.DefaultMinGasPrice))
require.NoError(t, err)

signer1.ForceSetSequence(4)
_, err = signer1.SubmitPayForBlob(ctx.GoContext(), blobs[3:5], user.SetGasLimitAndFee(500_000, appconsts.DefaultGlobalMinGasPrice))
_, err = signer1.SubmitPayForBlob(ctx.GoContext(), blobs[3:5], user.SetGasLimitAndFee(500_000, appconsts.DefaultMinGasPrice))
require.NoError(t, err)
}

func newSingleSignerFromContext(ctx testnode.Context) (*user.Signer, error) {
encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
return user.SetupSingleSigner(ctx.GoContext(), ctx.Keyring, ctx.GRPCClient, encCfg)
}
Loading

0 comments on commit fd7372c

Please sign in to comment.