Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit cb28e56

Browse files
Cleanup nil payload test
1 parent 7dd62f4 commit cb28e56

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

tools/docker-network/tests/nil_payload_test.go

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ package tests
44

55
import (
66
"context"
7-
"fmt"
87
"testing"
98

109
"github.com/stretchr/testify/require"
@@ -14,11 +13,8 @@ import (
1413
"github.com/iotaledger/iota-core/tools/docker-network/tests/dockertestframework"
1514
)
1615

17-
// Test_AccountTransitions follows the account state transition flow described in:
18-
// 1. Create account-1.
19-
// 2. Create account-2.
20-
// 3. account-1 requests faucet funds then allots 1000 mana to account-2.
21-
// 4. account-2 requests faucet funds then creates native tokens.
16+
// Test_Payload_Nil tests that sending a nil payload does not result in a panic.
17+
// This is a test to ensure issue #978 is fixed.
2218
func Test_Payload_Nil_Test(t *testing.T) {
2319
d := dockertestframework.NewDockerTestFramework(t,
2420
dockertestframework.WithProtocolParametersOptions(dockertestframework.ShortSlotsAndEpochsProtocolParametersOptionsFunc()...),
@@ -42,18 +38,10 @@ func Test_Payload_Nil_Test(t *testing.T) {
4238
t.Cleanup(cancel)
4339

4440
// create account-1
45-
accounts := d.CreateAccountsFromFaucet(ctx, 2, "account-1", "account-2")
41+
accounts := d.CreateAccountsFromFaucet(ctx, 1, "account-1")
4642
account1 := accounts[0]
47-
account2 := accounts[1]
48-
49-
// allot 1000 mana from account-1 to account-2
50-
fmt.Println("Allotting mana from account-1 to account-2")
51-
d.RequestFaucetFundsAndAllotManaTo(account1.Wallet(), account2.Account(), 1000)
52-
53-
// create native token
54-
fmt.Println("Creating native token")
55-
d.CreateNativeToken(account1.Wallet(), 5_000_000, 10_000_000_000)
5643

44+
// Issue a block with a nil payload.
5745
blk := lo.PanicOnErr(account1.Wallet().CreateBasicBlock(ctx, "something", mock.WithPayload(nil)))
5846
d.SubmitBlock(ctx, blk.ProtocolBlock())
5947

0 commit comments

Comments
 (0)