diff --git a/go/oasis-node/cmd/debug/txsource/workload/junk.go b/go/oasis-node/cmd/debug/txsource/workload/runtimeplaceholder.go similarity index 73% rename from go/oasis-node/cmd/debug/txsource/workload/junk.go rename to go/oasis-node/cmd/debug/txsource/workload/runtimeplaceholder.go index 145d56ff315..f3fefde54f5 100644 --- a/go/oasis-node/cmd/debug/txsource/workload/junk.go +++ b/go/oasis-node/cmd/debug/txsource/workload/runtimeplaceholder.go @@ -7,11 +7,16 @@ import ( "google.golang.org/grpc" + "github.com/oasislabs/oasis-core/go/common/logging" consensus "github.com/oasislabs/oasis-core/go/consensus/api" runtimeClient "github.com/oasislabs/oasis-core/go/runtime/client/api" ) -var _ Workload = runtimePlaceholder{} +var ( + _ Workload = runtimePlaceholder{} + + runtimePlaceholderLogger = logging.GetLogger("cmd/txsource/workload/runtimeplaceholder") +) type runtimePlaceholder struct{} @@ -23,6 +28,6 @@ func (runtimePlaceholder) Run(_ context.Context, _ *rand.Rand, _ *grpc.ClientCon if err != nil { return fmt.Errorf("rtc.SubmitTx: %w", err) } - logger.Debug("output", "out", out) + runtimePlaceholderLogger.Debug("output", "out", out) return nil } diff --git a/go/oasis-node/cmd/debug/txsource/workload/transfer.go b/go/oasis-node/cmd/debug/txsource/workload/transfer.go index 12e94e3037a..41b9935fe88 100644 --- a/go/oasis-node/cmd/debug/txsource/workload/transfer.go +++ b/go/oasis-node/cmd/debug/txsource/workload/transfer.go @@ -23,7 +23,7 @@ const ( TransferAmount = 1 ) -var logger = logging.GetLogger("cmd/txsource/workload/transfer") +var transferLogger = logging.GetLogger("cmd/txsource/workload/transfer") type transfer struct{} @@ -50,13 +50,13 @@ func (transfer) Run(gracefulExit context.Context, rng *rand.Rand, conn *grpc.Cli for i := range accounts { var account *staking.Account account, err = stakingClient.AccountInfo(ctx, &staking.OwnerQuery{ - Height: 0, + Height: consensus.HeightLatest, Owner: accounts[i].signer.Public(), }) if err != nil { return fmt.Errorf("stakingClient.AccountInfo %s: %w", accounts[i].signer.Public(), err) } - logger.Debug("account info", + transferLogger.Debug("account info", "i", i, "pub", accounts[i].signer.Public(), "info", account, @@ -101,7 +101,7 @@ func (transfer) Run(gracefulExit context.Context, rng *rand.Rand, conn *grpc.Cli if err != nil { return fmt.Errorf("transaction.Sign: %w", err) } - logger.Debug("submitting transfer", + transferLogger.Debug("submitting transfer", "from", from.signer.Public(), "to", to.signer.Public(), ) @@ -121,7 +121,7 @@ func (transfer) Run(gracefulExit context.Context, rng *rand.Rand, conn *grpc.Cli select { case <-gracefulExit.Done(): - logger.Debug("time's up") + transferLogger.Debug("time's up") return nil default: } diff --git a/go/oasis-node/cmd/debug/txsource/workload/workload.go b/go/oasis-node/cmd/debug/txsource/workload/workload.go index fd56c8c6ec7..cf0b22c2520 100644 --- a/go/oasis-node/cmd/debug/txsource/workload/workload.go +++ b/go/oasis-node/cmd/debug/txsource/workload/workload.go @@ -10,6 +10,7 @@ import ( runtimeClient "github.com/oasislabs/oasis-core/go/runtime/client/api" ) +// Workload is a DRBG-backed schedule of transactions. type Workload interface { // Run executes the workload. // If `gracefulExit`'s deadline passes, it is not an error.