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

Commit af804ae

Browse files
authored
Merge pull request #700 from iotaledger/fix/docker-test-framework
Fix docker test framework
2 parents fdc1df7 + ce03b2b commit af804ae

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

tools/docker-network/tests/dockerframework.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/mr-tron/base58"
1919
"github.com/stretchr/testify/require"
2020

21+
hiveEd25519 "github.com/iotaledger/hive.go/crypto/ed25519"
2122
"github.com/iotaledger/hive.go/ierrors"
2223
"github.com/iotaledger/hive.go/lo"
2324
"github.com/iotaledger/hive.go/runtime/options"
@@ -335,7 +336,7 @@ func (d *DockerTestFramework) CreateAccount(opts ...options.Option[builder.Accou
335336

336337
// transition to a full account with new Ed25519 address and staking feature
337338
accEd25519Addr, accPrivateKey := d.getAddress(iotago.AddressEd25519)
338-
accBlockIssuerKey := iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(accPrivateKey.Public().(ed25519.PublicKey))
339+
accBlockIssuerKey := iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(hiveEd25519.PublicKey(accPrivateKey.Public().(ed25519.PublicKey)))
339340
accountOutput := options.Apply(builder.NewAccountOutputBuilder(accEd25519Addr, implicitAccountOutput.BaseTokenAmount()),
340341
opts, func(b *builder.AccountOutputBuilder) {
341342
b.AccountID(accountID).
@@ -364,7 +365,7 @@ func (d *DockerTestFramework) CreateAccount(opts ...options.Option[builder.Accou
364365
AddCommitmentInput(&iotago.CommitmentInput{CommitmentID: lo.Return1(issuerResp.LatestCommitment.ID())}).
365366
AddBlockIssuanceCreditInput(&iotago.BlockIssuanceCreditInput{AccountID: accountID}).
366367
WithTransactionCapabilities(iotago.TransactionCapabilitiesBitMaskWithCapabilities(iotago.WithTransactionCanDoAnything())).
367-
AllotAllMana(currentSlot, accountID).
368+
AllotAllMana(currentSlot, accountID, 0).
368369
Build(implicitAddrSigner)
369370
require.NoError(d.Testing, err)
370371

@@ -417,7 +418,7 @@ func (d *DockerTestFramework) DelegateToValidator(from *Account, validator *Node
417418
SetCreationSlot(currentSlot).
418419
AddCommitmentInput(&iotago.CommitmentInput{CommitmentID: lo.Return1(issuerResp.LatestCommitment.ID())}).
419420
WithTransactionCapabilities(iotago.TransactionCapabilitiesBitMaskWithCapabilities(iotago.WithTransactionCanDoAnything())).
420-
AllotAllMana(currentSlot, from.AccountID).
421+
AllotAllMana(currentSlot, from.AccountID, 0).
421422
Build(fundsAddrSigner)
422423
require.NoError(d.Testing, err)
423424

tools/docker-network/tests/options.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func DefaultAccountOptions(protocolParams *iotago.V3ProtocolParameters) []option
3737
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))),
3838
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b"))),
3939
Amount: mock.MinValidatorAccountAmount(protocolParams),
40-
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b")))),
40+
IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x293dc170d9a59474e6d81cfba7f7d924c09b25d7166bcfba606e53114d0a758b")))),
4141
ExpirySlot: iotago.MaxSlotIndex,
4242
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
4343
StakingEndEpoch: iotago.MaxEpochIndex,
@@ -57,7 +57,7 @@ func DefaultAccountOptions(protocolParams *iotago.V3ProtocolParameters) []option
5757
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))),
5858
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064"))),
5959
Amount: mock.MinValidatorAccountAmount(protocolParams),
60-
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064")))),
60+
IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x05c1de274451db8de8182d64c6ee0dca3ae0c9077e0b4330c976976171d79064")))),
6161
ExpirySlot: iotago.MaxSlotIndex,
6262
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
6363
StakingEndEpoch: iotago.MaxEpochIndex,
@@ -77,7 +77,7 @@ func DefaultAccountOptions(protocolParams *iotago.V3ProtocolParameters) []option
7777
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))),
7878
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648"))),
7979
Amount: mock.MinValidatorAccountAmount(protocolParams),
80-
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648")))),
80+
IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x1e4b21eb51dcddf65c20db1065e1f1514658b23a3ddbf48d30c0efc926a9a648")))),
8181
ExpirySlot: iotago.MaxSlotIndex,
8282
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
8383
StakingEndEpoch: iotago.MaxEpochIndex,
@@ -98,7 +98,7 @@ func DefaultAccountOptions(protocolParams *iotago.V3ProtocolParameters) []option
9898
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
9999
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe"))),
100100
Amount: mock.MinValidatorAccountAmount(protocolParams),
101-
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))),
101+
IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0xc9ceac37d293155a578381aa313ee74edfa3ac73ee930d045564aae7771e8ffe")))),
102102
ExpirySlot: iotago.MaxSlotIndex,
103103
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
104104
StakingEndEpoch: iotago.MaxEpochIndex,
@@ -119,7 +119,7 @@ func DefaultAccountOptions(protocolParams *iotago.V3ProtocolParameters) []option
119119
AccountID: blake2b.Sum256(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))),
120120
Address: iotago.Ed25519AddressFromPubKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270"))),
121121
Amount: mock.MinIssuerAccountAmount(protocolParams),
122-
IssuerKey: iotago.Ed25519PublicKeyBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270")))),
122+
IssuerKey: iotago.Ed25519PublicKeyHashBlockIssuerKeyFromPublicKey(ed25519.PublicKey(lo.PanicOnErr(hexutil.DecodeHex("0x997be92a22b1933f36e26fba5f721756f95811d6b4ae21564197c2bfa4f28270")))),
123123
ExpirySlot: iotago.MaxSlotIndex,
124124
BlockIssuanceCredits: iotago.MaxBlockIssuanceCredits / 5,
125125
Mana: iotago.Mana(mock.MinIssuerAccountAmount(protocolParams)),

tools/docker-network/tests/utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ import (
1313
"os"
1414
"time"
1515

16+
"github.com/stretchr/testify/require"
17+
1618
"github.com/iotaledger/hive.go/ierrors"
1719
"github.com/iotaledger/hive.go/lo"
1820
"github.com/iotaledger/iota-crypto-demo/pkg/bip32path"
1921
iotago "github.com/iotaledger/iota.go/v4"
2022
"github.com/iotaledger/iota.go/v4/api"
2123
"github.com/iotaledger/iota.go/v4/wallet"
22-
"github.com/stretchr/testify/require"
2324
)
2425

2526
// Eventually asserts that given condition will be met in opts.waitFor time,

0 commit comments

Comments
 (0)