diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 1c82f20f5..0fda3bd05 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -6,3 +6,4 @@ Briefly describe the changes introduced by this pull request.
## Related issue(s)
If this Pull Request is related to an issue, mention it here.
+- Fixes #(issue number)
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 50183c1ad..382e17d79 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2023 Pactus blockchain
+Copyright (c) 2020 Pactus blockchain
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/Makefile b/Makefile
index 179cd3a22..8b3954efb 100644
--- a/Makefile
+++ b/Makefile
@@ -3,8 +3,12 @@ BUILD_LDFLAGS= -ldflags "-X github.com/pactus-project/pactus/version.build=`git
ifneq (,$(filter $(OS),Windows_NT MINGW64))
EXE = .exe
+RM = del /q
+else
+RM = rm -rf
endif
+
all: build test
########################################
@@ -16,7 +20,7 @@ devtools:
go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2@v2.12
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
- go install github.com/bufbuild/buf/cmd/buf@v1.8
+ go install github.com/bufbuild/buf/cmd/buf@v1.25.0
go install github.com/rakyll/statik@v0.1
########################################
@@ -47,13 +51,9 @@ docker:
########################################
### proto
proto:
- cd www/grpc/ && rm -rf gen && buf generate \
- --path ./proto/blockchain.proto \
- --path ./proto/network.proto \
- --path ./proto/transaction.proto \
- --path ./proto/wallet.proto
+ cd www/grpc/ && $(RM) gen && buf generate proto
- # Generate static assets for Swagger-UI
+# Generate static assets for Swagger-UI
cd www/grpc/ && statik -m -f -src swagger-ui/
########################################
diff --git a/cmd/daemon/init.go b/cmd/daemon/init.go
index 3429e31ea..f004004ca 100644
--- a/cmd/daemon/init.go
+++ b/cmd/daemon/init.go
@@ -1,106 +1,96 @@
package main
import (
- "fmt"
"path/filepath"
- cli "github.com/jawher/mow.cli"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/genesis"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/wallet"
+ "github.com/spf13/cobra"
)
-// Init initializes a node for the Pactus blockchain.
-func Init() func(c *cli.Cmd) {
- return func(c *cli.Cmd) {
- workingDirOpt := c.String(cli.StringOpt{
- Name: "w working-dir",
- Desc: "A path to the working directory to save the wallet and node files",
- Value: cmd.PactusHomeDir(),
- })
- testnetOpt := c.Bool(cli.BoolOpt{
- Name: "testnet",
- Desc: "Initialize working directory for joining the testnet",
- Value: true, // TODO: make it false after mainnet launch
- })
- localnetOpt := c.Bool(cli.BoolOpt{
- Name: "localnet",
- Desc: "Initialize working directory for localnet (for developers)",
- Value: false,
- })
- restoreOpt := c.String(cli.StringOpt{
- Name: "restore",
- Desc: "Restore the default_wallet using a mnemonic (seed phrase)",
- Value: "",
- })
+// BuildInitCmd builds the init command for the Pactus blockchain.
+func buildInitCmd(parentCmd *cobra.Command) {
+ var initCmd = &cobra.Command{
+ Use: "init",
+ Short: "Initialize the Pactus blockchain",
+ }
+ parentCmd.AddCommand(initCmd)
+ workingDirOpt := initCmd.Flags().StringP("working-dir", "w",
+ cmd.PactusHomeDir(), "A path to the working directory to save the wallet and node files")
- c.LongDesc = "Initializing the working directory"
- c.Before = func() { fmt.Println(cmd.Pactus) }
- c.Action = func() {
- workingDir, _ := filepath.Abs(*workingDirOpt)
- if !util.IsDirNotExistsOrEmpty(workingDir) {
- cmd.PrintErrorMsg("The working directory is not empty: %s", workingDir)
- return
- }
- mnemonic := ""
- if len(*restoreOpt) == 0 {
- mnemonic = wallet.GenerateMnemonic(128)
- cmd.PrintLine()
- cmd.PrintInfoMsg("Your wallet seed is:")
- cmd.PrintInfoMsgBold(" " + mnemonic)
- cmd.PrintLine()
- cmd.PrintWarnMsg("Write down this seed on a piece of paper to recover your validator key in future.")
- cmd.PrintLine()
- confirmed := cmd.PromptConfirm("Do you want to continue")
- if !confirmed {
- return
- }
- } else {
- mnemonic = *restoreOpt
- err := wallet.CheckMnemonic(*restoreOpt)
- cmd.FatalErrorCheck(err)
- }
- cmd.PrintLine()
- cmd.PrintInfoMsg("Enter a password for wallet")
- password := cmd.PromptPassword("Password", true)
+ testnetOpt := initCmd.Flags().Bool("testnet", true,
+ "Initialize working directory for joining the testnet") // TODO: make it false after mainnet launch
- cmd.PrintLine()
- cmd.PrintInfoMsgBold("How many validators do you want to create?")
- cmd.PrintInfoMsg("Each node can run up to 32 validators, and each validator can hold up to 1000 staked coins.")
- cmd.PrintInfoMsg("You can define validators based on the amount of coins you want to stake.")
- numValidators := cmd.PromptInputWithRange("Number of Validators", 7, 1, 32)
+ localnetOpt := initCmd.Flags().Bool("localnet", false,
+ "Initialize working directory for localnet (for developers)")
- chain := genesis.Mainnet
- // The order of checking the network (chain type) matters here.
- if *testnetOpt {
- chain = genesis.Testnet
- }
- if *localnetOpt {
- chain = genesis.Localnet
- }
- validatorAddrs, rewardAddrs, err := cmd.CreateNode(numValidators, chain, workingDir, mnemonic, password)
- cmd.FatalErrorCheck(err)
+ restoreOpt := initCmd.Flags().String("restore", "", "Restore the default_wallet using a mnemonic (seed phrase)")
+ initCmd.Run = func(_ *cobra.Command, _ []string) {
+ workingDir, _ := filepath.Abs(*workingDirOpt)
+ if !util.IsDirNotExistsOrEmpty(workingDir) {
+ cmd.PrintErrorMsg("The working directory is not empty: %s", workingDir)
+ return
+ }
+ mnemonic := ""
+ if len(*restoreOpt) == 0 {
+ mnemonic = wallet.GenerateMnemonic(128)
cmd.PrintLine()
- cmd.PrintInfoMsgBold("Validator addresses:")
- for i, addr := range validatorAddrs {
- cmd.PrintInfoMsg("%v- %s", i+1, addr)
- }
+ cmd.PrintInfoMsg("Your wallet seed is:")
+ cmd.PrintInfoMsgBold(" " + mnemonic)
cmd.PrintLine()
-
- cmd.PrintInfoMsgBold("Reward addresses:")
- for i, addr := range rewardAddrs {
- cmd.PrintInfoMsg("%v- %s", i+1, addr)
+ cmd.PrintWarnMsg("Write down this seed on a piece of paper to recover your validator key in future.")
+ cmd.PrintLine()
+ confirmed := cmd.PromptConfirm("Do you want to continue")
+ if !confirmed {
+ return
}
+ } else {
+ mnemonic = *restoreOpt
+ err := wallet.CheckMnemonic(*restoreOpt)
+ cmd.FatalErrorCheck(err)
+ }
+ cmd.PrintLine()
+ cmd.PrintInfoMsg("Enter a password for wallet")
+ password := cmd.PromptPassword("Password", true)
- cmd.PrintLine()
- cmd.PrintInfoMsgBold("Network: %v", chain.String())
- cmd.PrintLine()
- cmd.PrintSuccessMsg("A pactus node is successfully initialized at %v", workingDir)
- cmd.PrintLine()
- cmd.PrintInfoMsg("You can start the node by running this command:")
- cmd.PrintInfoMsg("./pactus-daemon start -w %v", workingDir)
+ cmd.PrintLine()
+ cmd.PrintInfoMsgBold("How many validators do you want to create?")
+ cmd.PrintInfoMsg("Each node can run up to 32 validators, and each validator can hold up to 1000 staked coins.")
+ cmd.PrintInfoMsg("You can define validators based on the amount of coins you want to stake.")
+ numValidators := cmd.PromptInputWithRange("Number of Validators", 7, 1, 32)
+
+ chain := genesis.Mainnet
+ // The order of checking the network (chain type) matters here.
+ if *testnetOpt {
+ chain = genesis.Testnet
}
+ if *localnetOpt {
+ chain = genesis.Localnet
+ }
+ validatorAddrs, rewardAddrs, err := cmd.CreateNode(numValidators, chain, workingDir, mnemonic, password)
+ cmd.FatalErrorCheck(err)
+
+ cmd.PrintLine()
+ cmd.PrintInfoMsgBold("Validator addresses:")
+ for i, addr := range validatorAddrs {
+ cmd.PrintInfoMsg("%v- %s", i+1, addr)
+ }
+ cmd.PrintLine()
+
+ cmd.PrintInfoMsgBold("Reward addresses:")
+ for i, addr := range rewardAddrs {
+ cmd.PrintInfoMsg("%v- %s", i+1, addr)
+ }
+
+ cmd.PrintLine()
+ cmd.PrintInfoMsgBold("Network: %v", chain.String())
+ cmd.PrintLine()
+ cmd.PrintSuccessMsg("A pactus node is successfully initialized at %v", workingDir)
+ cmd.PrintLine()
+ cmd.PrintInfoMsg("You can start the node by running this command:")
+ cmd.PrintInfoMsg("./pactus-daemon start -w %v", workingDir)
}
}
diff --git a/cmd/daemon/main.go b/cmd/daemon/main.go
index e0415c96d..6f35e01a4 100644
--- a/cmd/daemon/main.go
+++ b/cmd/daemon/main.go
@@ -1,19 +1,25 @@
package main
import (
- "os"
+ "fmt"
- cli "github.com/jawher/mow.cli"
+ "github.com/spf13/cobra"
)
func main() {
- app := cli.App("pactus-daemon", "Pactus daemon")
-
- app.Command("init", "Initialize the Pactus blockchain", Init())
- app.Command("start", "Start the Pactus blockchain", Start())
- app.Command("version", "Print the Pactus version", Version())
+ var rootCmd = &cobra.Command{
+ Use: "pactus-daemon",
+ Short: "Pactus daemon",
+ Run: func(cmd *cobra.Command, args []string) {
+ fmt.Println("use --help")
+ },
+ }
- if err := app.Run(os.Args); err != nil {
+ buildVersionCmd(rootCmd)
+ buildInitCmd(rootCmd)
+ buildStartCmd(rootCmd)
+ err := rootCmd.Execute()
+ if err != nil {
panic(err)
}
}
diff --git a/cmd/daemon/start.go b/cmd/daemon/start.go
index 479980a25..c65632b6a 100644
--- a/cmd/daemon/start.go
+++ b/cmd/daemon/start.go
@@ -1,79 +1,74 @@
package main
import (
- "fmt"
"net/http"
_ "net/http/pprof" // #nosec
"os"
"path/filepath"
"time"
- cli "github.com/jawher/mow.cli"
"github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/wallet"
+ "github.com/spf13/cobra"
)
// Start starts the pactus node.
-func Start() func(c *cli.Cmd) {
- return func(c *cli.Cmd) {
- workingDirOpt := c.String(cli.StringOpt{
- Name: "w working-dir",
- Desc: "A path to the working directory to read the wallet and node files",
- Value: cmd.PactusHomeDir(),
- })
- passwordOpt := c.String(cli.StringOpt{
- Name: "p password",
- Desc: "The wallet password",
- })
- pprofOpt := c.String(cli.StringOpt{
- Name: "pprof",
- Desc: "debug pprof server address(not recommended to expose to internet)",
- })
+func buildStartCmd(parentCmd *cobra.Command) {
+ var startCmd = &cobra.Command{
+ Use: "start",
+ Short: "Start the Pactus blockchain",
+ }
- c.LongDesc = "Starting the node from working directory"
- c.Before = func() { fmt.Println(cmd.Pactus) }
- c.Action = func() {
- workingDir, _ := filepath.Abs(*workingDirOpt)
- // change working directory
- err := os.Chdir(workingDir)
- cmd.FatalErrorCheck(err)
+ parentCmd.AddCommand(startCmd)
- if *pprofOpt != "" {
- cmd.PrintWarnMsg("Starting Debug pprof server on: http://%s/debug/pprof/", *pprofOpt)
- server := &http.Server{
- Addr: *pprofOpt,
- ReadHeaderTimeout: 3 * time.Second,
- }
- go func() {
- err := server.ListenAndServe()
- cmd.FatalErrorCheck(err)
- }()
- }
+ workingDirOpt := startCmd.Flags().StringP("working-dir", "w",
+ cmd.PactusHomeDir(), "A path to the working directory to read the wallet and node files")
+
+ passwordOpt := startCmd.Flags().StringP("password", "p", "", "The wallet password")
+
+ pprofOpt := startCmd.Flags().String("pprof", "", "debug pprof server address(not recommended to expose to internet)")
- passwordFetcher := func(wallet *wallet.Wallet) (string, bool) {
- if !wallet.IsEncrypted() {
- return "", true
- }
+ startCmd.Run = func(_ *cobra.Command, _ []string) {
+ workingDir, _ := filepath.Abs(*workingDirOpt)
+ // change working directory
+ err := os.Chdir(workingDir)
+ cmd.FatalErrorCheck(err)
- var password string
- if *passwordOpt != "" {
- password = *passwordOpt
- } else {
- password = cmd.PromptPassword("Wallet password", false)
- }
- return password, true
+ if *pprofOpt != "" {
+ cmd.PrintWarnMsg("Starting Debug pprof server on: http://%s/debug/pprof/", *pprofOpt)
+ server := &http.Server{
+ Addr: *pprofOpt,
+ ReadHeaderTimeout: 3 * time.Second,
}
- node, _, err := cmd.StartNode(
- workingDir, passwordFetcher)
- cmd.FatalErrorCheck(err)
+ go func() {
+ err := server.ListenAndServe()
+ cmd.FatalErrorCheck(err)
+ }()
+ }
- cmd.TrapSignal(func() {
- node.Stop()
- cmd.PrintInfoMsg("Exiting ...")
- })
+ passwordFetcher := func(wallet *wallet.Wallet) (string, bool) {
+ if !wallet.IsEncrypted() {
+ return "", true
+ }
- // run forever (the node will not be returned)
- select {}
+ var password string
+ if *passwordOpt != "" {
+ password = *passwordOpt
+ } else {
+ password = cmd.PromptPassword("Wallet password", false)
+ }
+ return password, true
}
+ node, _, err := cmd.StartNode(
+ workingDir, passwordFetcher)
+ cmd.FatalErrorCheck(err)
+
+ cmd.TrapSignal(func() {
+ node.Stop()
+ cmd.PrintInfoMsg("Exiting ...")
+ })
+
+ // run forever (the node will not be returned)
+ select {}
}
}
diff --git a/cmd/daemon/version.go b/cmd/daemon/version.go
index 7f4989bd5..cbb9f8fe1 100644
--- a/cmd/daemon/version.go
+++ b/cmd/daemon/version.go
@@ -1,20 +1,18 @@
package main
import (
- "fmt"
-
- cli "github.com/jawher/mow.cli"
- "github.com/pactus-project/pactus/cmd"
"github.com/pactus-project/pactus/version"
+ "github.com/spf13/cobra"
)
// Version prints the version of the Pactus node.
-func Version() func(c *cli.Cmd) {
- return func(c *cli.Cmd) {
- c.Before = func() { fmt.Println(cmd.Pactus) }
- c.Action = func() {
- fmt.Println()
- cmd.PrintInfoMsg("Pactus version: %v", version.Version())
- }
+func buildVersionCmd(parentCmd *cobra.Command) {
+ var versionCmd = &cobra.Command{
+ Use: "version",
+ Short: "Print the Pactus version",
+ }
+ parentCmd.AddCommand(versionCmd)
+ versionCmd.Run = func(c *cobra.Command, args []string) {
+ c.Printf("Pactus version: %v\n", version.Version())
}
}
diff --git a/cmd/gtk/assets/css/style.css b/cmd/gtk/assets/css/style.css
new file mode 100644
index 000000000..9e0c88fd1
--- /dev/null
+++ b/cmd/gtk/assets/css/style.css
@@ -0,0 +1,8 @@
+.inline_button {
+ padding: 2px;
+ margin-right: 3px;
+}
+
+.copyable_entry {
+ padding-right: 36px;
+}
diff --git a/cmd/gtk/assets/ui/dialog_address_details.ui b/cmd/gtk/assets/ui/dialog_address_details.ui
index f3a85f983..83a968af9 100644
--- a/cmd/gtk/assets/ui/dialog_address_details.ui
+++ b/cmd/gtk/assets/ui/dialog_address_details.ui
@@ -67,13 +67,9 @@
-
-
+
True
- True
- True
- False
- 32
- False
+ False
False
diff --git a/cmd/gtk/dialog_addresss_details.go b/cmd/gtk/dialog_addresss_details.go
index 667f2e581..71d19f51c 100644
--- a/cmd/gtk/dialog_addresss_details.go
+++ b/cmd/gtk/dialog_addresss_details.go
@@ -23,8 +23,8 @@ func showAddressDetails(wallet *wallet.Wallet, addr string) {
}
dlg := getDialogObj(builder, "id_dialog_address_details")
- addressEntry := getEntryObj(builder, "id_entry_address")
- pubKeyEntry := getEntryObj(builder, "id_entry_public_key")
+ addressEntry := buildExtendedEntry(builder, "id_overlay_address")
+ pubKeyEntry := buildExtendedEntry(builder, "id_overlay_public_key")
pathEntry := getEntryObj(builder, "id_entry_path")
addressEntry.SetText(info.Address)
diff --git a/cmd/gtk/dialog_transaction_bond.go b/cmd/gtk/dialog_transaction_bond.go
index d4ac9c507..42fe7dedc 100644
--- a/cmd/gtk/dialog_transaction_bond.go
+++ b/cmd/gtk/dialog_transaction_bond.go
@@ -8,6 +8,7 @@ import (
"github.com/gotk3/gotk3/gtk"
"github.com/pactus-project/pactus/crypto"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/wallet"
)
@@ -54,7 +55,7 @@ func broadcastTransactionBond(wallet *wallet.Wallet, valAddrs []crypto.Address)
onAmountChanged := func() {
amtStr, _ := amountEntry.GetText()
- updateFeeHint(amountHint, amtStr, wallet)
+ updateFeeHint(amountHint, amtStr, wallet, payload.PayloadTypeBond)
}
onSend := func() {
diff --git a/cmd/gtk/dialog_transaction_send.go b/cmd/gtk/dialog_transaction_transfer.go
similarity index 95%
rename from cmd/gtk/dialog_transaction_send.go
rename to cmd/gtk/dialog_transaction_transfer.go
index bb8c766fb..d93ca2090 100644
--- a/cmd/gtk/dialog_transaction_send.go
+++ b/cmd/gtk/dialog_transaction_transfer.go
@@ -7,6 +7,7 @@ import (
"fmt"
"github.com/gotk3/gotk3/gtk"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/wallet"
)
@@ -46,7 +47,7 @@ func broadcastTransactionSend(wallet *wallet.Wallet) {
onAmountChanged := func() {
amtStr, _ := amountEntry.GetText()
- updateFeeHint(amountHint, amtStr, wallet)
+ updateFeeHint(amountHint, amtStr, wallet, payload.PayloadTypeTransfer)
}
onSend := func() {
diff --git a/cmd/gtk/main_window.go b/cmd/gtk/main_window.go
index b3322ee82..0d9b5a383 100644
--- a/cmd/gtk/main_window.go
+++ b/cmd/gtk/main_window.go
@@ -5,6 +5,7 @@ package main
import (
_ "embed"
+ "github.com/gotk3/gotk3/gdk"
"github.com/gotk3/gotk3/gtk"
"github.com/pactus-project/pactus/crypto"
)
@@ -12,6 +13,9 @@ import (
//go:embed assets/ui/main_window.ui
var uiMainWindow []byte
+//go:embed assets/css/style.css
+var cssCustom string
+
type mainWindow struct {
*gtk.ApplicationWindow
@@ -63,6 +67,18 @@ func buildMainWindow(nodeModel *nodeModel, walletModel *walletModel) *mainWindow
}
builder.ConnectSignals(signals)
+ // apply custom css
+ provider, err := gtk.CssProviderNew()
+ fatalErrorCheck(err)
+
+ err = provider.LoadFromData(cssCustom)
+ fatalErrorCheck(err)
+
+ screen, err := gdk.ScreenGetDefault()
+ fatalErrorCheck(err)
+
+ gtk.AddProviderForScreen(screen, provider, gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
+
return mw
}
diff --git a/cmd/gtk/utils.go b/cmd/gtk/utils.go
index 6a226897e..0b57a587e 100644
--- a/cmd/gtk/utils.go
+++ b/cmd/gtk/utils.go
@@ -10,38 +10,40 @@ import (
"os/exec"
"runtime"
+ "github.com/gotk3/gotk3/gdk"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
"github.com/pactus-project/pactus/types/tx"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/wallet"
)
func showQuestionDialog(parent gtk.IWindow, msg string) bool {
- dlg := gtk.MessageDialogNewWithMarkup(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, "")
- dlg.SetMarkup(msg)
+ dlg := gtk.MessageDialogNew(parent,
+ gtk.DIALOG_MODAL, gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO, msg)
res := dlg.Run()
dlg.Destroy()
return res == gtk.RESPONSE_YES
}
func showInfoDialog(parent gtk.IWindow, msg string) {
- dlg := gtk.MessageDialogNewWithMarkup(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, "")
- dlg.SetMarkup(msg)
+ dlg := gtk.MessageDialogNew(parent,
+ gtk.DIALOG_MODAL, gtk.MESSAGE_INFO, gtk.BUTTONS_OK, msg)
dlg.Run()
dlg.Destroy()
}
func showWarningDialog(parent gtk.IWindow, msg string) {
- dlg := gtk.MessageDialogNewWithMarkup(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, "")
- dlg.SetMarkup(msg)
+ dlg := gtk.MessageDialogNew(parent,
+ gtk.DIALOG_MODAL, gtk.MESSAGE_WARNING, gtk.BUTTONS_OK, msg)
dlg.Run()
dlg.Destroy()
}
func showErrorDialog(parent gtk.IWindow, msg string) {
- dlg := gtk.MessageDialogNewWithMarkup(parent, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "")
- dlg.SetMarkup(msg)
+ dlg := gtk.MessageDialogNew(parent,
+ gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, msg)
dlg.Run()
dlg.Destroy()
}
@@ -86,6 +88,10 @@ func getEntryObj(builder *gtk.Builder, name string) *gtk.Entry {
return getObj(builder, name).(*gtk.Entry)
}
+func getOverlayObj(builder *gtk.Builder, name string) *gtk.Overlay {
+ return getObj(builder, name).(*gtk.Overlay)
+}
+
func getTreeViewObj(builder *gtk.Builder, name string) *gtk.TreeView {
return getObj(builder, name).(*gtk.TreeView)
}
@@ -171,12 +177,16 @@ func updateAccountHint(lbl *gtk.Label, addr string, w *wallet.Wallet) {
}
}
-func updateFeeHint(lbl *gtk.Label, amtStr string, w *wallet.Wallet) {
+func updateFeeHint(lbl *gtk.Label, amtStr string, w *wallet.Wallet, payloadType payload.Type) {
amount, err := util.StringToChange(amtStr)
if err != nil {
updateHintLabel(lbl, "")
} else {
- fee := w.CalculateFee(amount)
+ fee, err := w.CalculateFee(amount, payloadType)
+ if err != nil {
+ errorCheck(err)
+ return
+ }
hint := fmt.Sprintf("payable: %v, fee: %v",
util.ChangeToString(fee+amount), util.ChangeToString(fee))
updateHintLabel(lbl, hint)
@@ -241,3 +251,50 @@ func openURLInBrowser(address string) error {
args = append(args, address)
return exec.Command(cmd, args...).Start()
}
+
+func buildExtendedEntry(builder *gtk.Builder, overlayID string) *gtk.Entry {
+ overlay := getOverlayObj(builder, overlayID)
+
+ // Create a new Entry
+ entry, err := gtk.EntryNew()
+ fatalErrorCheck(err)
+ entry.SetCanFocus(true)
+ entry.SetHExpand(true)
+ entry.SetEditable(false)
+
+ setCSSClass(&entry.Widget, "copyable_entry")
+
+ // Create a new Button
+ button, err := gtk.ButtonNewFromIconName("edit-copy-symbolic", gtk.ICON_SIZE_BUTTON)
+ fatalErrorCheck(err)
+
+ button.SetTooltipText("Copy to Clipboard") // TODO: Not working!
+ button.SetHAlign(gtk.ALIGN_END)
+ button.SetVAlign(gtk.ALIGN_CENTER)
+ button.SetHExpand(false)
+ button.SetVExpand(false)
+ button.SetBorderWidth(0)
+
+ setCSSClass(&button.Widget, "inline_button")
+
+ // Set the click event for the Button
+ button.Connect("clicked", func() {
+ buffer, _ := entry.GetText()
+ clipboard, _ := gtk.ClipboardGet(gdk.SELECTION_CLIPBOARD)
+ clipboard.SetText(buffer)
+ })
+
+ overlay.Add(entry)
+ overlay.AddOverlay(button)
+
+ overlay.ShowAll() // Ensure all child widgets are shown
+
+ return entry
+}
+
+func setCSSClass(widget *gtk.Widget, name string) {
+ styleContext, err := widget.GetStyleContext()
+ fatalErrorCheck(err)
+
+ styleContext.AddClass(name)
+}
diff --git a/committee/committee.go b/committee/committee.go
index e8aae74d0..e0e57a123 100644
--- a/committee/committee.go
+++ b/committee/committee.go
@@ -67,7 +67,7 @@ func (c *committee) Update(lastRound int16, joined []*validator.Validator) {
if committeeVal == nil {
c.validatorList.InsertBefore(cloneValidator(val), c.proposerPos)
} else {
- committeeVal.UpdateLastJoinedHeight(val.LastJoinedHeight())
+ committeeVal.UpdateLastSortitionHeight(val.LastSortitionHeight())
// Ensure that a validator's stake and bonding properties
// remain unchanged while they are part of the committee.
@@ -89,8 +89,8 @@ func (c *committee) Update(lastRound int16, joined []*validator.Validator) {
}
sort.SliceStable(oldestFirst, func(i, j int) bool {
- return oldestFirst[i].Value.(*validator.Validator).LastJoinedHeight() <
- oldestFirst[j].Value.(*validator.Validator).LastJoinedHeight()
+ return oldestFirst[i].Value.(*validator.Validator).LastSortitionHeight() <
+ oldestFirst[j].Value.(*validator.Validator).LastSortitionHeight()
})
for i := 0; i <= int(lastRound); i++ {
@@ -187,7 +187,7 @@ func (c *committee) String() string {
builder.WriteString("[ ")
for _, v := range c.Validators() {
- builder.WriteString(fmt.Sprintf("%v(%v)", v.Number(), v.LastJoinedHeight()))
+ builder.WriteString(fmt.Sprintf("%v(%v)", v.Number(), v.LastSortitionHeight()))
if c.IsProposer(v.Address(), 0) {
builder.WriteString("*")
}
diff --git a/committee/committee_test.go b/committee/committee_test.go
index db61ecd10..c678aa17d 100644
--- a/committee/committee_test.go
+++ b/committee/committee_test.go
@@ -140,7 +140,7 @@ func TestProposerJoin(t *testing.T) {
// Height 1000
// Val2 is in the committee
- val2.UpdateLastJoinedHeight(1000)
+ val2.UpdateLastSortitionHeight(1000)
committee.Update(0, []*validator.Validator{val2})
assert.Equal(t, committee.Proposer(0).Number(), int32(2))
assert.Equal(t, committee.Committers(), []int32{1, 2, 3, 4})
@@ -148,7 +148,7 @@ func TestProposerJoin(t *testing.T) {
fmt.Println(committee.String())
// Height 1001
- val5.UpdateLastJoinedHeight(1001)
+ val5.UpdateLastSortitionHeight(1001)
committee.Update(0, []*validator.Validator{val5})
assert.Equal(t, committee.Proposer(0).Number(), int32(3))
assert.Equal(t, committee.Proposer(1).Number(), int32(4))
@@ -163,9 +163,9 @@ func TestProposerJoin(t *testing.T) {
fmt.Println(committee.String())
// Height 1003
- val3.UpdateLastJoinedHeight(1003)
- val6.UpdateLastJoinedHeight(1003)
- val7.UpdateLastJoinedHeight(1003)
+ val3.UpdateLastSortitionHeight(1003)
+ val6.UpdateLastSortitionHeight(1003)
+ val7.UpdateLastSortitionHeight(1003)
committee.Update(1, []*validator.Validator{val7, val3, val6})
assert.Equal(t, committee.Proposer(0).Number(), int32(2))
assert.Equal(t, committee.Committers(), []int32{6, 7, 1, 5, 2, 3, 4})
@@ -258,7 +258,7 @@ func TestProposerJoinAndLeave(t *testing.T) {
// +-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+ +$+-+-+-+$+-+$+
// Height 1001
- val8.UpdateLastJoinedHeight(1001)
+ val8.UpdateLastSortitionHeight(1001)
committee.Update(0, []*validator.Validator{val8})
assert.Equal(t, committee.Proposer(0).Number(), int32(2))
assert.Equal(t, committee.Proposer(1).Number(), int32(3))
@@ -267,14 +267,14 @@ func TestProposerJoinAndLeave(t *testing.T) {
fmt.Println(committee.String())
// Height 1002
- val3.UpdateLastJoinedHeight(1002)
+ val3.UpdateLastSortitionHeight(1002)
committee.Update(3, []*validator.Validator{val3})
assert.Equal(t, committee.Proposer(0).Number(), int32(6))
fmt.Println(committee.String())
// Height 1003
- val2.UpdateLastJoinedHeight(1003)
- val9.UpdateLastJoinedHeight(1003)
+ val2.UpdateLastSortitionHeight(1003)
+ val9.UpdateLastSortitionHeight(1003)
committee.Update(0, []*validator.Validator{val9, val2})
assert.Equal(t, committee.Proposer(0).Number(), int32(7))
assert.Equal(t, committee.Proposer(1).Number(), int32(8))
@@ -282,15 +282,15 @@ func TestProposerJoinAndLeave(t *testing.T) {
fmt.Println(committee.String())
// Height 1004
- valA.UpdateLastJoinedHeight(1004)
+ valA.UpdateLastSortitionHeight(1004)
committee.Update(1, []*validator.Validator{valA})
assert.Equal(t, committee.Proposer(0).Number(), int32(2))
assert.Equal(t, committee.Committers(), []int32{8, 2, 3, 9, 6, 10, 7})
fmt.Println(committee.String())
// Height 1005
- valB.UpdateLastJoinedHeight(1005)
- valC.UpdateLastJoinedHeight(1005)
+ valB.UpdateLastSortitionHeight(1005)
+ valC.UpdateLastSortitionHeight(1005)
committee.Update(0, []*validator.Validator{valC, valB})
assert.Equal(t, committee.Proposer(0).Number(), int32(3))
assert.Equal(t, committee.Proposer(1).Number(), int32(9))
@@ -299,17 +299,17 @@ func TestProposerJoinAndLeave(t *testing.T) {
fmt.Println(committee.String())
// Height 1006
- val1.UpdateLastJoinedHeight(1006)
+ val1.UpdateLastSortitionHeight(1006)
committee.Update(2, []*validator.Validator{val1})
assert.Equal(t, committee.Proposer(0).Number(), int32(11))
assert.Equal(t, committee.Committers(), []int32{11, 12, 2, 1, 3, 9, 10})
fmt.Println(committee.String())
// Height 1007
- val2.UpdateLastJoinedHeight(1007)
- val3.UpdateLastJoinedHeight(1007)
- val5.UpdateLastJoinedHeight(1007)
- val6.UpdateLastJoinedHeight(1007)
+ val2.UpdateLastSortitionHeight(1007)
+ val3.UpdateLastSortitionHeight(1007)
+ val5.UpdateLastSortitionHeight(1007)
+ val6.UpdateLastSortitionHeight(1007)
committee.Update(4, []*validator.Validator{val2, val3, val5, val6})
assert.Equal(t, committee.Proposer(0).Number(), int32(5))
assert.Equal(t, committee.Committers(), []int32{5, 6, 11, 12, 2, 1, 3})
diff --git a/config/config.go b/config/config.go
index f709b7376..f485e9011 100644
--- a/config/config.go
+++ b/config/config.go
@@ -113,7 +113,7 @@ func SaveTestnetConfig(path string, numValidators int) error {
"/ip4/94.101.184.118/tcp/4002/p2p/12D3KooWCRHn8vjrKNBEQcut8uVCYX5q77RKidPaE6iMK31qEVHb",
}
conf.GRPC.Enable = true
- conf.GRPC.Listen = "[::]:9090"
+ conf.GRPC.Listen = "[::]:5105"
conf.GRPC.Gateway.Enable = true
conf.GRPC.Gateway.Listen = "[::]:80"
conf.HTTP.Enable = true
diff --git a/config/example_config.toml b/config/example_config.toml
index 0431ab0ad..aa1f07b7f 100644
--- a/config/example_config.toml
+++ b/config/example_config.toml
@@ -49,6 +49,10 @@
# Default is false.
## enable_mdns = false
+ # `enable_metrics` if enabled, it provides network metrics for the Prometheus software.
+ # Default is false.
+ ## enable_metrics = false
+
# `network.bootstrap` contains configuration for bootstrapping the node.
[network.bootstrap]
diff --git a/consensus/consensus.go b/consensus/consensus.go
index 70a145203..b860c1907 100644
--- a/consensus/consensus.go
+++ b/consensus/consensus.go
@@ -38,7 +38,7 @@ type consensus struct {
changeProposerState consState
broadcastCh chan message.Message
mediator mediator
- logger *logger.Logger
+ logger *logger.SubLogger
}
func NewConsensus(
@@ -57,7 +57,7 @@ func NewConsensus(
// Update height later, See enterNewHeight.
cs.log = log.NewLog()
- cs.logger = logger.NewLogger("_consensus", cs)
+ cs.logger = logger.NewSubLogger("_consensus", cs)
cs.rewardAddr = rewardAddr
cs.newHeightState = &newHeightState{cs}
@@ -82,9 +82,9 @@ func NewConsensus(
return cs
}
-func (cs *consensus) Fingerprint() string {
+func (cs *consensus) String() string {
return fmt.Sprintf("{%s %d/%d/%s}",
- cs.signer.Address().Fingerprint(),
+ cs.signer.Address().ShortString(),
cs.height, cs.round, cs.currentState.name())
}
@@ -320,18 +320,17 @@ func (cs *consensus) IsActive() bool {
}
// TODO: Improve the performance?
-func (cs *consensus) PickRandomVote() *vote.Vote {
+func (cs *consensus) PickRandomVote(round int16) *vote.Vote {
cs.lk.RLock()
defer cs.lk.RUnlock()
- rndRound := util.RandInt16(cs.round + 1)
votes := []*vote.Vote{}
- if rndRound == cs.round {
- m := cs.log.MustGetRoundMessages(rndRound)
+ if round == cs.round {
+ m := cs.log.MustGetRoundMessages(round)
votes = append(votes, m.AllVotes()...)
} else {
// Don't broadcast prepare and precommit votes for previous rounds
- vs := cs.log.ChangeProposerVoteSet(rndRound)
+ vs := cs.log.ChangeProposerVoteSet(round)
votes = append(votes, vs.AllVotes()...)
}
if len(votes) == 0 {
diff --git a/consensus/consensus_test.go b/consensus/consensus_test.go
index 4c579e332..b3eae2fa2 100644
--- a/consensus/consensus_test.go
+++ b/consensus/consensus_test.go
@@ -46,8 +46,8 @@ type testData struct {
consP *consensus // Partitioned peer
}
-type OverrideFingerprint struct {
- cons Consensus
+type OverrideStringer struct {
+ cons *consensus
name string
}
@@ -58,8 +58,8 @@ func testConfig() *Config {
}
}
-func (o *OverrideFingerprint) Fingerprint() string {
- return o.name + o.cons.Fingerprint()
+func (o *OverrideStringer) String() string {
+ return o.name + o.cons.String()
}
func setup(t *testing.T) *testData {
@@ -114,8 +114,8 @@ func setup(t *testing.T) *testData {
// -------------------------------
// For better logging when testing
overrideLogger := func(cons *consensus, name string) {
- cons.logger = logger.NewLogger("_consensus",
- &OverrideFingerprint{name: fmt.Sprintf("%s - %s: ", name, t.Name()), cons: cons})
+ cons.logger = logger.NewSubLogger("_consensus",
+ &OverrideStringer{name: fmt.Sprintf("%s - %s: ", name, t.Name()), cons: cons})
}
overrideLogger(consX, "consX")
@@ -149,7 +149,7 @@ func (td *testData) shouldPublishBlockAnnounce(t *testing.T, cons *consensus, ha
case msg := <-cons.broadcastCh:
logger.Info("shouldPublishBlockAnnounce", "message", msg)
- if msg.Type() == message.MessageTypeBlockAnnounce {
+ if msg.Type() == message.TypeBlockAnnounce {
m := msg.(*message.BlockAnnounceMessage)
assert.Equal(t, m.Block.Hash(), hash)
return
@@ -175,7 +175,7 @@ func shouldPublishProposal(t *testing.T, cons *consensus,
case msg := <-cons.broadcastCh:
logger.Info("shouldPublishProposal", "message", msg)
- if msg.Type() == message.MessageTypeProposal {
+ if msg.Type() == message.TypeProposal {
m := msg.(*message.ProposalMessage)
require.Equal(t, m.Proposal.Height(), height)
require.Equal(t, m.Proposal.Round(), round)
@@ -196,7 +196,7 @@ func (td *testData) shouldPublishQueryProposal(t *testing.T, cons *consensus, he
case msg := <-cons.broadcastCh:
logger.Info("shouldPublishQueryProposal", "message", msg)
- if msg.Type() == message.MessageTypeQueryProposal {
+ if msg.Type() == message.TypeQueryProposal {
m := msg.(*message.QueryProposalMessage)
assert.Equal(t, m.Height, height)
assert.Equal(t, m.Round, round)
@@ -216,7 +216,7 @@ func (td *testData) shouldPublishVote(t *testing.T, cons *consensus, voteType vo
case msg := <-cons.broadcastCh:
logger.Info("shouldPublishVote", "message", msg)
- if msg.Type() == message.MessageTypeVote {
+ if msg.Type() == message.TypeVote {
m := msg.(*message.VoteMessage)
if m.Vote.Type() == voteType &&
m.Vote.BlockHash().EqualsTo(hash) {
@@ -290,7 +290,7 @@ func (td *testData) commitBlockForAllStates(t *testing.T) (*block.Block, *block.
sig2 := td.signers[1].SignData(sb).(*bls.Signature)
sig4 := td.signers[3].SignData(sb).(*bls.Signature)
- sig := bls.Aggregate([]*bls.Signature{sig1, sig2, sig4})
+ sig := bls.SignatureAggregate([]*bls.Signature{sig1, sig2, sig4})
cert := block.NewCertificate(0, []int32{0, 1, 2, 3}, []int32{2}, sig)
block := p.Block()
@@ -490,10 +490,10 @@ func TestConsensusInvalidVote(t *testing.T) {
func TestPickRandomVote(t *testing.T) {
td := setup(t)
- assert.Nil(t, td.consP.PickRandomVote())
+ assert.Nil(t, td.consP.PickRandomVote(0))
td.enterNewHeight(td.consP)
- assert.Nil(t, td.consP.PickRandomVote())
+ assert.Nil(t, td.consP.PickRandomVote(0))
p1 := td.makeProposal(t, 1, 0)
p2 := td.makeProposal(t, 1, 1)
@@ -505,7 +505,7 @@ func TestPickRandomVote(t *testing.T) {
td.addVote(td.consP, vote.VoteTypePrecommit, 1, 0, p1.Block().Hash(), tIndexX)
td.addVote(td.consP, vote.VoteTypePrecommit, 1, 0, p1.Block().Hash(), tIndexY)
- assert.NotNil(t, td.consP.PickRandomVote())
+ assert.NotNil(t, td.consP.PickRandomVote(0))
td.addVote(td.consP, vote.VoteTypeChangeProposer, 1, 0, hash.UndefHash, tIndexX)
td.addVote(td.consP, vote.VoteTypeChangeProposer, 1, 0, hash.UndefHash, tIndexY)
@@ -522,8 +522,8 @@ func TestPickRandomVote(t *testing.T) {
// Round 2
td.addVote(td.consP, vote.VoteTypeChangeProposer, 1, 2, hash.UndefHash, tIndexP)
- for i := 0; i < 10; i++ {
- rndVote := td.consP.PickRandomVote()
+ for r := int16(0); r <= 2; r++ {
+ rndVote := td.consP.PickRandomVote(r)
assert.NotNil(t, rndVote)
assert.Equal(t, rndVote.Type(), vote.VoteTypeChangeProposer,
"Should only pick Change Proposer votes")
diff --git a/consensus/interface.go b/consensus/interface.go
index 470279151..35ba56d40 100644
--- a/consensus/interface.go
+++ b/consensus/interface.go
@@ -10,12 +10,11 @@ import (
type Reader interface {
SignerKey() crypto.PublicKey
AllVotes() []*vote.Vote
- PickRandomVote() *vote.Vote
+ PickRandomVote(round int16) *vote.Vote
RoundProposal(round int16) *proposal.Proposal
HasVote(hash hash.Hash) bool
HeightRound() (uint32, int16)
IsActive() bool
- Fingerprint() string
}
type Consensus interface {
@@ -28,7 +27,7 @@ type Consensus interface {
type ManagerReader interface {
Instances() []Reader
- PickRandomVote() *vote.Vote
+ PickRandomVote(round int16) *vote.Vote
RoundProposal(round int16) *proposal.Proposal
HeightRound() (uint32, int16)
HasActiveInstance() bool
diff --git a/consensus/manager.go b/consensus/manager.go
index 383ca00ad..0055c33a9 100644
--- a/consensus/manager.go
+++ b/consensus/manager.go
@@ -54,9 +54,9 @@ func (mgr *manager) Instances() []Reader {
}
// PickRandomVote retrieves a random vote from a random consensus instance.
-func (mgr *manager) PickRandomVote() *vote.Vote {
+func (mgr *manager) PickRandomVote(round int16) *vote.Vote {
cons := mgr.getBestInstance()
- return cons.PickRandomVote()
+ return cons.PickRandomVote(round)
}
// RoundProposal retrieves the proposal for a specific round from a random consensus instance.
diff --git a/consensus/mock.go b/consensus/mock.go
index 187f73bb8..202a5fc44 100644
--- a/consensus/mock.go
+++ b/consensus/mock.go
@@ -103,10 +103,10 @@ func (m *MockConsensus) HeightRound() (uint32, int16) {
return m.Height, m.Round
}
-func (m *MockConsensus) Fingerprint() string {
+func (m *MockConsensus) String() string {
return ""
}
-func (m *MockConsensus) PickRandomVote() *vote.Vote {
+func (m *MockConsensus) PickRandomVote(_ int16) *vote.Vote {
m.lk.Lock()
defer m.lk.Unlock()
diff --git a/consensus/spec/Pactus.cfg b/consensus/spec/Pactus.cfg
new file mode 100644
index 000000000..678e7c75e
--- /dev/null
+++ b/consensus/spec/Pactus.cfg
@@ -0,0 +1,9 @@
+SPECIFICATION Spec
+CONSTANTS
+ NumFaulty = 1
+ FaultyNodes = {3}
+ MaxHeight = 1
+ MaxRound = 1
+
+INVARIANT TypeOK
+PROPERTY Success
diff --git a/consensus/spec/Pactus.pdf b/consensus/spec/Pactus.pdf
index 7f0662a1a..a24d2b002 100644
Binary files a/consensus/spec/Pactus.pdf and b/consensus/spec/Pactus.pdf differ
diff --git a/consensus/spec/Pactus.tla b/consensus/spec/Pactus.tla
index c043587b7..955883d6b 100644
--- a/consensus/spec/Pactus.tla
+++ b/consensus/spec/Pactus.tla
@@ -1,147 +1,285 @@
-------------------------------- MODULE Pactus --------------------------------
(***************************************************************************)
-(* The specification of the Pactus consensus algorithm based on *)
-(* Practical Byzantine Fault Tolerant. *)
-(* For more information check here: *)
+(* The specification of the Pactus consensus algorithm: *)
(* `^\url{https://pactus.org/learn/consensus/protocol/}^' *)
(***************************************************************************)
EXTENDS Integers, Sequences, FiniteSets, TLC
CONSTANT
- \* The total number of faulty nodes
- NumFaulty,
+ \* The maximum number of height.
+ \* this is to restrict the allowed behaviours that TLC scans through.
+ MaxHeight,
\* The maximum number of round per height.
\* this is to restrict the allowed behaviours that TLC scans through.
- MaxRound
-
-ASSUME
- /\ NumFaulty >= 1
+ MaxRound,
+ \* The maximum number of cp-round per height.
+ \* this is to restrict the allowed behaviours that TLC scans through.
+ MaxCPRound,
+ \* The total number of faulty nodes
+ NumFaulty,
+ \* The index of faulty nodes
+ FaultyNodes
VARIABLES
+ \* `log` is a set of received messages in the system.
log,
+ \* `states` represents the state of each replica in the consensus protocol.
states
-\* Total number of replicas that is `3f+1' where `f' is number of faulty nodes.
+\* Total number of replicas, which is `3f+1', where `f' is the number of faulty nodes.
Replicas == (3 * NumFaulty) + 1
-\* 2/3 of total replicas that is `2f+1'
-QuorumCnt == (2 * NumFaulty) + 1
-\* 1/3 of total replicas that is `f+1'
+\* Quorum is 2/3+ of total replicas that is `2f+1'
+Quorum == (2 * NumFaulty) + 1
+\* OneThird is 1/3+ of total replicas that is `f+1'
OneThird == NumFaulty + 1
\* A tuple with all variables in the spec (for ease of use in temporal conditions)
vars == <>
+ASSUME
+ /\ NumFaulty >= 1
+ /\ FaultyNodes \subseteq 0..Replicas-1
+
-----------------------------------------------------------------------------
(***************************************************************************)
(* Helper functions *)
(***************************************************************************)
+
\* Fetch a subset of messages in the network based on the params filter.
SubsetOfMsgs(params) ==
{msg \in log: \A field \in DOMAIN params: msg[field] = params[field]}
-
-\* IsProposer checks if the replica is the proposer for this round
-\* To simplify, we assume the proposer always starts with the first replica
+\* IsProposer checks if the replica is the proposer for this round.
+\* To simplify, we assume the proposer always starts with the first replica,
\* and moves to the next by the change-proposer phase.
IsProposer(index) ==
states[index].round % Replicas = index
-\* HasPrepareQuorum checks if there is a quorum of the PREPARE votes in each round.
+\* Helper function to check if a node is faulty or not.
+IsFaulty(index) == index \in FaultyNodes
+
+\* HasPrepareQuorum checks if there is a quorum of
+\* the PREPARE votes in this round.
HasPrepareQuorum(index) ==
Cardinality(SubsetOfMsgs([
- type |-> "PREPARE",
- height |-> states[index].height,
- round |-> states[index].round])) >= QuorumCnt
+ type |-> "PREPARE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> 0])) >= Quorum
-\* HasPrecommitQuorum checks if there is a quorum of the PRECOMMIT votes in each round.
+\* HasPrecommitQuorum checks if there is a quorum of
+\* the PRECOMMIT votes in this round.
HasPrecommitQuorum(index) ==
Cardinality(SubsetOfMsgs([
- type |-> "PRECOMMIT",
- height |-> states[index].height,
- round |-> states[index].round])) >= QuorumCnt
+ type |-> "PRECOMMIT",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> 0])) >= Quorum
+
+CPHasPreVotesQuorum(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round])) >= Quorum
+
+CPHasPreVotesQuorumForOne(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 1])) >= Quorum
+
+CPHasPreVotesQuorumForZero(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 0])) >= Quorum
+
+CPHasPreVotesForZeroAndOne(index) ==
+ /\ Cardinality(SubsetOfMsgs([
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 0])) >= 1
+ /\ Cardinality(SubsetOfMsgs([
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 1])) >= 1
+
+CPHasOneMainVotesZeroInPrvRound(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round - 1,
+ cp_val |-> 0])) > 0
+
+CPHasOneThirdMainVotesOneInPrvRound(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round - 1,
+ cp_val |-> 1])) >= OneThird
+
+CPHasOneMainVotesOneInPrvRound(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round - 1,
+ cp_val |-> 1])) > 0
+
+CPAllMainVotesAbstainInPrvRound(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round - 1,
+ cp_val |-> 2])) >= Quorum
+
+
+CPHasMainVotesQuorum(index) ==
+ Cardinality(SubsetOfMsgs([
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round])) >= Quorum
-\* HasChangeProposerQuorum checks if there is a quorum of the CHANGE-PROPOSER votes in each round.
-HasChangeProposerQuorum(index) ==
+CPHasMainVotesQuorumForOne(index) ==
Cardinality(SubsetOfMsgs([
- type |-> "CHANGE-PROPOSER",
- height |-> states[index].height,
- round |-> states[index].round])) >= QuorumCnt
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 1])) >= Quorum
-HasOneThirdOfChangeProposer(index) ==
+CPHasMainVotesQuorumForZero(index) ==
Cardinality(SubsetOfMsgs([
- type |-> "CHANGE-PROPOSER",
- height |-> states[index].height,
- round |-> states[index].round])) >= OneThird
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> 0])) >= Quorum
GetProposal(height, round) ==
SubsetOfMsgs([type |-> "PROPOSAL", height |-> height, round |-> round])
-HasProposal(height, round) ==
- Cardinality(GetProposal(height, round)) > 0
-
-IsCommitted(height) ==
- Cardinality(SubsetOfMsgs([type |-> "BLOCK-ANNOUNCE", height |-> height])) > 0
+HasProposal(index) ==
+ Cardinality(GetProposal(states[index].height, states[index].round)) > 0
-HasVoted(index, type) ==
+HasBlockAnnounce(index) ==
Cardinality(SubsetOfMsgs([
- type |-> type,
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> index])) > 0
+ type |-> "BLOCK-ANNOUNCE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ cp_round |-> 0,
+ cp_val |-> 0])) >= 1
+
+\* Helper function to check if the block is committed or not.
+\* A block is considered committed iff supermajority of non-faulty replicas announce the same block.
+IsCommitted(height) ==
+ LET subset == SubsetOfMsgs([
+ type |-> "BLOCK-ANNOUNCE",
+ height |-> height,
+ cp_round |-> 0,
+ cp_val |-> 0])
+ IN /\ Cardinality(subset) >= Quorum
+ /\ \A m1, m2 \in subset : m1.round = m2.round
-----------------------------------------------------------------------------
(***************************************************************************)
(* Network functions *)
(***************************************************************************)
-\* SendMsg broadcasts the message iff the current height is not committed yet.
+\* `SendMsg` simulates a replica sending a message by appending it to the `log`.
SendMsg(msg) ==
- IF ~IsCommitted(msg.height)
- THEN log' = log \cup {msg}
- ELSE log' = log
-
+ log' = log \cup msg
\* SendProposal is used to broadcast the PROPOSAL into the network.
SendProposal(index) ==
- SendMsg([
- type |-> "PROPOSAL",
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> index])
+ SendMsg({[
+ type |-> "PROPOSAL",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> 0,
+ cp_val |-> 0]})
\* SendPrepareVote is used to broadcast PREPARE votes into the network.
SendPrepareVote(index) ==
- SendMsg([
- type |-> "PREPARE",
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> index])
+ SendMsg({[
+ type |-> "PREPARE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> 0,
+ cp_val |-> 0]})
\* SendPrecommitVote is used to broadcast PRECOMMIT votes into the network.
SendPrecommitVote(index) ==
- SendMsg([
- type |-> "PRECOMMIT",
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> index])
-
-\* SendChangeProposerRequest is used to broadcast CHANGE-PROPOSER votes into the network.
-SendChangeProposerRequest(index) ==
- SendMsg([
- type |-> "CHANGE-PROPOSER",
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> index])
-
-\* AnnounceBlock announces the block for the current height and clears the logs.
+ SendMsg({[
+ type |-> "PRECOMMIT",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> 0,
+ cp_val |-> 0]})
+
+\* SendCPPreVote is used to broadcast CP:PRE-VOTE votes into the network.
+SendCPPreVote(index, cp_val) ==
+ SendMsg({[
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> cp_val]})
+
+\* SendCPMainVote is used to broadcast CP:MAIN-VOTE votes into the network.
+SendCPMainVote(index, cp_val) ==
+ SendMsg({[
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> states[index].cp_round,
+ cp_val |-> cp_val]})
+
+SendCPVotesForNextRound(index, cp_val) ==
+ SendMsg({
+ [
+ type |-> "CP:PRE-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> states[index].cp_round + 1,
+ cp_val |-> cp_val],
+ [
+ type |-> "CP:MAIN-VOTE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> states[index].cp_round + 1,
+ cp_val |-> cp_val]})
+
+\* AnnounceBlock is used to broadcast BLOCK-ANNOUNCE messages into the network.
AnnounceBlock(index) ==
- log' = {msg \in log: (msg.type = "BLOCK-ANNOUNCE") \/ msg.height > states[index].height } \cup {[
- type |-> "BLOCK-ANNOUNCE",
- height |-> states[index].height,
- round |-> states[index].round,
- index |-> -1]}
+ SendMsg({[
+ type |-> "BLOCK-ANNOUNCE",
+ height |-> states[index].height,
+ round |-> states[index].round,
+ index |-> index,
+ cp_round |-> 0,
+ cp_val |-> 0]})
-IsFaulty(index) == index >= 3 * NumFaulty
-----------------------------------------------------------------------------
(***************************************************************************)
(* States functions *)
@@ -149,123 +287,180 @@ IsFaulty(index) == index >= 3 * NumFaulty
\* NewHeight state
NewHeight(index) ==
- /\ states[index].name = "new-height"
- /\ ~IsFaulty(index)
- /\ states' = [states EXCEPT
- ![index].name = "propose",
- ![index].height = states[index].height + 1,
- ![index].round = 0]
- /\ UNCHANGED <>
+ IF states[index].height >= MaxHeight
+ THEN UNCHANGED <>
+ ELSE
+ /\ ~IsFaulty(index)
+ /\ states[index].name = "new-height"
+ /\ states[index].height < MaxHeight
+ /\ states' = [states EXCEPT
+ ![index].name = "propose",
+ ![index].height = states[index].height + 1,
+ ![index].round = 0]
+ /\ UNCHANGED <>
\* Propose state
Propose(index) ==
- /\ states[index].name = "propose"
/\ ~IsFaulty(index)
+ /\ states[index].name = "propose"
/\ IF IsProposer(index)
THEN SendProposal(index)
- ELSE log' = log
+ ELSE UNCHANGED <>
/\ states' = [states EXCEPT
- ![index].name = "prepare"]
+ ![index].name = "prepare",
+ ![index].timeout = FALSE,
+ ![index].cp_round = 0]
\* Prepare state
Prepare(index) ==
- /\ states[index].name = "prepare"
/\ ~IsFaulty(index)
- /\ ~HasOneThirdOfChangeProposer(index) \* This check is optional
- /\ HasProposal(states[index].height, states[index].round)
- /\ SendPrepareVote(index)
- /\ IF /\ HasPrepareQuorum(index)
- THEN states' = [states EXCEPT ![index].name = "precommit"]
- ELSE states' = states
-
+ /\ states[index].name = "prepare"
+ /\ IF HasPrepareQuorum(index)
+ THEN /\ states' = [states EXCEPT ![index].name = "precommit"]
+ /\ UNCHANGED <>
+ ELSE /\ HasProposal(index)
+ /\ SendPrepareVote(index)
+ /\ UNCHANGED <>
\* Precommit state
Precommit(index) ==
- /\ states[index].name = "precommit"
/\ ~IsFaulty(index)
- /\ ~HasOneThirdOfChangeProposer(index) \* This check is optional
- /\ SendPrecommitVote(index)
- /\ IF /\ HasPrecommitQuorum(index)
- /\ HasVoted(index, "PRECOMMIT")
- THEN states' = [states EXCEPT ![index].name = "commit"]
- ELSE states' = states
-
+ /\ states[index].name = "precommit"
+ /\ IF HasPrecommitQuorum(index)
+ THEN /\ states' = [states EXCEPT ![index].name = "commit"]
+ /\ UNCHANGED <>
+ ELSE /\ HasProposal(index)
+ /\ SendPrecommitVote(index)
+ /\ UNCHANGED <>
-Timeout(index) ==
- /\
- \/ states[index].name = "prepare"
- \/ states[index].name = "precommit"
+\* Commit state
+Commit(index) ==
/\ ~IsFaulty(index)
- /\ (states[index].round < MaxRound)
- /\ SendChangeProposerRequest(index)
+ /\ states[index].name = "commit"
+ /\ AnnounceBlock(index)
/\ states' = [states EXCEPT
- ![index].name = "change-proposer"]
+ ![index].name = "new-height"]
+\* Timeout: A non-faulty Replica try to change the proposer if its timer expires.
+Timeout(index) ==
+ /\ ~IsFaulty(index)
+ /\ states[index].round < MaxRound
+ /\ states[index].timeout = FALSE
+ /\
+ \/
+ /\ states[index].name = "prepare"
+ /\ SendCPPreVote(index, 1)
-Byzantine(index) ==
- /\ IsFaulty(index)
- /\ SendChangeProposerRequest(index)
+ \/
+ /\ states[index].name = "precommit"
+ /\ SendCPPreVote(index, 0)
/\ states' = [states EXCEPT
- ![index].name = "change-proposer"]
+ ![index].name = "cp:main-vote",
+ ![index].timeout = TRUE]
-\* Commit state
-Commit(index) ==
- /\ states[index].name = "commit"
- /\ ~IsFaulty(index)
- /\ AnnounceBlock(index) \* this clear the logs
- /\ states' = [states EXCEPT
- ![index].name = "new-height"]
-\* ChangeProposer state
-ChangeProposer(index) ==
- /\ states[index].name = "change-proposer"
+CPPreVote(index) ==
/\ ~IsFaulty(index)
- /\ IF HasChangeProposerQuorum(index)
- THEN states' = [states EXCEPT
- ![index].name = "propose",
- ![index].round = states[index].round + 1]
- ELSE states' = states
- /\ UNCHANGED <>
+ /\ states[index].name = "cp:pre-vote"
+ /\
+ \/
+ /\
+ \/ states[index].cp_round = MaxCPRound
+ \/ CPHasOneThirdMainVotesOneInPrvRound(index)
+ /\ CPHasOneMainVotesOneInPrvRound(index)
+ /\ SendCPPreVote(index, 1)
+ \/
+ /\ CPHasOneMainVotesZeroInPrvRound(index)
+ /\ SendCPPreVote(index, 0)
+ \/
+ /\ CPAllMainVotesAbstainInPrvRound(index)
+ /\ SendCPPreVote(index, 0) \* biased to zero
+ /\ states' = [states EXCEPT ![index].name = "cp:main-vote"]
+
+
+CPMainVote(index) ==
+ /\ ~IsFaulty(index)
+ /\ states[index].name = "cp:main-vote"
+ /\ CPHasPreVotesQuorum(index)
+ /\
+ \/
+ \* all votes for 1
+ /\ CPHasPreVotesQuorumForOne(index)
+ /\ SendCPMainVote(index, 1)
+ /\ states' = [states EXCEPT ![index].name = "cp:decide"]
+ \/
+ \* all votes for 0
+ /\ CPHasPreVotesQuorumForZero(index)
+ /\ SendCPMainVote(index, 0)
+ /\ states' = [states EXCEPT ![index].name = "cp:decide"]
+ \/
+ \* Abstain vote
+ /\ CPHasPreVotesForZeroAndOne(index)
+ /\ SendCPMainVote(index, 2)
+ /\ states' = [states EXCEPT ![index].name = "cp:decide"]
+
+CPDecide(index) ==
+ /\ ~IsFaulty(index)
+ /\ states[index].name = "cp:decide"
+ /\ CPHasMainVotesQuorum(index)
+ /\ IF CPHasMainVotesQuorumForOne(index)
+ THEN /\ SendCPVotesForNextRound(index, 1)
+ /\ states' = [states EXCEPT ![index].name = "propose",
+ ![index].round = states[index].round + 1]
+ ELSE IF CPHasMainVotesQuorumForZero(index)
+ THEN /\ SendCPVotesForNextRound(index, 0)
+ /\ states' = [states EXCEPT ![index].name = "prepare"]
+ ELSE
+ /\ states' = [states EXCEPT ![index].name = "cp:pre-vote",
+ ![index].cp_round = states[index].cp_round + 1]
+ /\ log' = log
+
-\* Sync checks the log for the committed blocks at the current height.
-\* If such a block exists, it commits and moves to the next height.
Sync(index) ==
- LET
- blocks == SubsetOfMsgs([type |-> "BLOCK-ANNOUNCE", height |-> states[index].height])
- IN
- /\ Cardinality(blocks) > 0
- /\ states' = [states EXCEPT
- ![index].name = "propose",
- ![index].height = states[index].height + 1,
- ![index].round = 0]
- /\ log' = log
+ /\ ~IsFaulty(index)
+ /\
+ \/ states[index].name = "cp:pre-vote"
+ \/ states[index].name = "cp:main-vote"
+ \/ states[index].name = "cp:decide"
+ /\ HasBlockAnnounce(index)
+ /\ states' = [states EXCEPT ![index].name = "prepare"]
+ /\ log' = log
-----------------------------------------------------------------------------
Init ==
/\ log = {}
/\ states = [index \in 0..Replicas-1 |-> [
- name |-> "new-height",
- height |-> 0,
- round |-> 0]]
+ name |-> "new-height",
+ height |-> 0,
+ round |-> 0,
+ timeout |-> FALSE,
+ cp_round |-> 0]]
Next ==
\E index \in 0..Replicas-1:
- \/ Sync(index)
- \/ NewHeight(index)
- \/ Propose(index)
- \/ Prepare(index)
- \/ Precommit(index)
- \/ Timeout(index)
- \/ Commit(index)
- \/ ChangeProposer(index)
- \/ Byzantine(index)
+ \/ NewHeight(index)
+ \/ Propose(index)
+ \/ Prepare(index)
+ \/ Precommit(index)
+ \/ Timeout(index)
+ \/ Commit(index)
+ \/ Sync(index)
+ \/ CPPreVote(index)
+ \/ CPMainVote(index)
+ \/ CPDecide(index)
Spec ==
- Init /\ [][Next]_vars
+ Init /\ [][Next]_vars /\ WF_vars(Next)
+
+
+(***************************************************************************)
+(* Success: All non-faulty nodes eventually commit at MaxHeight. *)
+(***************************************************************************)
+Success == <>(IsCommitted(MaxHeight))
(***************************************************************************)
(* TypeOK is the type-correctness invariant. *)
@@ -273,24 +468,21 @@ Spec ==
TypeOK ==
/\ \A index \in 0..Replicas-1:
/\ states[index].name \in {"new-height", "propose", "prepare",
- "precommit", "commit", "change-proposer"}
- /\ ~IsCommitted(states[index].height) =>
- /\ states[index].name = "new-height" /\ states[index].height > 1 =>
- IsCommitted(states[index].height - 1)
- /\ states[index].name = "propose" /\ states[index].round > 0 =>
- /\ Cardinality(SubsetOfMsgs([
- type |-> "CHANGE-PROPOSER",
- height |-> states[index].height,
- round |-> states[index].round - 1])) >= QuorumCnt
- /\ states[index].name = "precommit" =>
- /\ HasPrepareQuorum(index)
- /\ HasProposal(states[index].height, states[index].round)
- /\ states[index].name = "commit" =>
- /\ HasPrepareQuorum(index)
- /\ HasPrecommitQuorum(index)
- /\ HasProposal(states[index].height, states[index].round)
- /\ \A round \in 0..states[index].round:
- \* Not more than one proposal per round
- /\ Cardinality(GetProposal(states[index].height, round)) <= 1
+ "precommit", "commit", "cp:pre-vote", "cp:main-vote", "cp:decide"}
+ /\ states[index].height <= MaxHeight
+ /\ states[index].round <= MaxRound
+ /\ states[index].cp_round <= MaxCPRound + 1
+ /\ states[index].name = "new-height" /\ states[index].height > 1 =>
+ /\ IsCommitted(states[index].height - 1)
+ /\ states[index].name = "precommit" =>
+ /\ HasPrepareQuorum(index)
+ /\ HasProposal(index)
+ /\ states[index].name = "commit" =>
+ /\ HasPrepareQuorum(index)
+ /\ HasPrecommitQuorum(index)
+ /\ HasProposal(index)
+ /\ \A round \in 0..states[index].round:
+ \* Not more than one proposal per round
+ /\ Cardinality(GetProposal(states[index].height, round)) <= 1
=============================================================================
diff --git a/consensus/spec/Pactus_Liveness.cfg b/consensus/spec/Pactus_Liveness.cfg
deleted file mode 100644
index e1cb445ba..000000000
--- a/consensus/spec/Pactus_Liveness.cfg
+++ /dev/null
@@ -1,9 +0,0 @@
-SPECIFICATION LiveSpec
-CONSTANTS
- NumFaulty = 1
- MaxRound = 2
- MaxHeight = 3
-
-INVARIANT TypeOK
-PROPERTY Success
-CONSTRAINTS Constraint
diff --git a/consensus/spec/Pactus_Liveness.tla b/consensus/spec/Pactus_Liveness.tla
deleted file mode 100644
index df8f2f126..000000000
--- a/consensus/spec/Pactus_Liveness.tla
+++ /dev/null
@@ -1,16 +0,0 @@
--------------------------------- MODULE Pactus_Liveness --------------------------------
-EXTENDS Pactus
-
-CONSTANT MaxHeight
-
-
------------------------------------------------------------------------------
-(***************************************************************************)
-(* Liveness: A node eventually moves to a new height. *)
-(***************************************************************************)
-LiveSpec == Spec /\ SF_vars(Next)
-
-Success == <>(IsCommitted(MaxHeight))
-
-Constraint == ~IsCommitted(MaxHeight)
-=============================================================================
diff --git a/consensus/spec/README.md b/consensus/spec/README.md
index 67296e674..26740b498 100644
--- a/consensus/spec/README.md
+++ b/consensus/spec/README.md
@@ -11,13 +11,14 @@ More info can be found [here](https://pactus.org/learn/consensus/specification/)
To run the model checker, you will need to download and install the [TLA+ Toolbox](https://lamport.azurewebsites.net/tla/toolbox.html),
which includes the TLC model checker. Follow the steps below to run the TLC model checker:
-- Add the `Pactus_Liveness.tla` spec to your TLA+ Toolbox project.
-- Create a new model and specify the temporal formula as `LiveSpec`.
-- Specify the invariants formula as `TypeOK`.
-- Specify the properties formula as `Success`.
-- Since we are checking for liveness, add the `Constraint` formula as the "State Constraint".
+- Add the `Pactus.tla` spec to your TLA+ Toolbox project.
+- Create a new model and specify a temporal formula as `Spec`.
+- Specify an invariants formula as `TypeOK`.
+- Specify a properties formula as `Success`.
- Define the required constants:
- `NumFaulty`: the number of faulty nodes (e.g. 1)
- - `MaxHeight`: the maximum height of the system (e.g. 2)
- - `MaxRound`: the maximum round of the consensus algorithm (e.g. 2)
+ - `FaultyNodes`: the index of faulty nodes (e.g. {3})
+ - `MaxHeight`: the maximum height of the system (e.g. 1)
+ - `MaxRound`: the maximum block-creation round of the consensus algorithm (e.g. 1)
+ - `MaxCPRound`: the maximum change-proposer round of the consensus algorithm (e.g. 1)
- Run the TLC checker to check the correctness of the specification.
diff --git a/consensus/voteset/voteset.go b/consensus/voteset/voteset.go
index 860463aa1..b66f43344 100644
--- a/consensus/voteset/voteset.go
+++ b/consensus/voteset/voteset.go
@@ -166,11 +166,11 @@ func (vs *VoteSet) ToCertificate() *block.Certificate {
committers[i] = val.Number()
}
- sig := bls.Aggregate(sigs)
+ sig := bls.SignatureAggregate(sigs)
return block.NewCertificate(vs.Round(), committers, absentees, sig)
}
-func (vs *VoteSet) Fingerprint() string {
+func (vs *VoteSet) String() string {
return fmt.Sprintf("{%v/%s SUM:%v}", vs.round, vs.voteType, vs.Len())
}
diff --git a/crypto/address.go b/crypto/address.go
index ce134d5a9..f81659523 100644
--- a/crypto/address.go
+++ b/crypto/address.go
@@ -64,8 +64,8 @@ func (addr Address) Bytes() []byte {
return addr[:]
}
-// Fingerprint returns a short string for the address useful for logger.
-func (addr Address) Fingerprint() string {
+// ShortString returns a short string for the address useful for logger.
+func (addr Address) ShortString() string {
return addr.String()[0:12]
}
diff --git a/crypto/address_test.go b/crypto/address_test.go
index 92aba47e4..2aef10602 100644
--- a/crypto/address_test.go
+++ b/crypto/address_test.go
@@ -23,11 +23,11 @@ func TestAddressKeyEqualsTo(t *testing.T) {
assert.NotEqual(t, addr1, addr2)
}
-func TestFingerprint(t *testing.T) {
+func TestString(t *testing.T) {
ts := testsuite.NewTestSuite(t)
addr1 := ts.RandomAddress()
- assert.Contains(t, addr1.String(), addr1.Fingerprint())
+ assert.Contains(t, addr1.String(), addr1.ShortString())
}
func TestToString(t *testing.T) {
diff --git a/crypto/bls/bls.go b/crypto/bls/bls.go
index 940db5b4e..ab5bf7af9 100644
--- a/crypto/bls/bls.go
+++ b/crypto/bls/bls.go
@@ -8,7 +8,7 @@ import (
// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-4.2.1
var dst = []byte("BLS_SIG_BLS12381G1_XMD:SHA-256_SSWU_RO_NUL_")
-func Aggregate(sigs []*Signature) *Signature {
+func SignatureAggregate(sigs []*Signature) *Signature {
if len(sigs) == 0 {
return nil
}
@@ -26,22 +26,27 @@ func Aggregate(sigs []*Signature) *Signature {
}
}
-func VerifyAggregated(sig *Signature, pubs []*PublicKey, msg []byte) bool {
+func PublicKeyAggregate(pubs []*PublicKey) *PublicKey {
if len(pubs) == 0 {
- return false
+ return nil
}
g2 := bls12381.NewG2()
aggPointG2 := pubs[0].pointG2
for i := 1; i < len(pubs); i++ {
if g2.IsZero(&pubs[i].pointG2) {
- return false
+ return nil
}
g2.Add(
&aggPointG2,
&aggPointG2,
&pubs[i].pointG2)
}
+ return &PublicKey{
+ pointG2: aggPointG2,
+ }
+}
- aggPub := PublicKey{pointG2: aggPointG2}
+func VerifyAggregated(sig *Signature, pubs []*PublicKey, msg []byte) bool {
+ aggPub := PublicKeyAggregate(pubs)
return aggPub.Verify(msg, sig) == nil
}
diff --git a/crypto/bls/bls_test.go b/crypto/bls/bls_test.go
index 26d73e9bb..da8025849 100644
--- a/crypto/bls/bls_test.go
+++ b/crypto/bls/bls_test.go
@@ -39,7 +39,7 @@ func TestSignatureAggregate(t *testing.T) {
sig1 := prv1.Sign(msg).(*bls.Signature)
sig2 := prv2.Sign(msg).(*bls.Signature)
- assert.True(t, bls.Aggregate([]*bls.Signature{sig1, sig2}).EqualsTo(agg))
+ assert.True(t, bls.SignatureAggregate([]*bls.Signature{sig1, sig2}).EqualsTo(agg))
assert.False(t, prv1.EqualsTo(prv2))
}
@@ -59,17 +59,22 @@ func TestAggregateFailed(t *testing.T) {
sig3 := prv3.Sign(msg1).(*bls.Signature)
sig4 := prv4.Sign(msg1).(*bls.Signature)
- agg1 := bls.Aggregate([]*bls.Signature{sig1, sig2, sig3})
- agg2 := bls.Aggregate([]*bls.Signature{sig1, sig2, sig4})
- agg3 := bls.Aggregate([]*bls.Signature{sig11, sig2, sig3})
- agg4 := bls.Aggregate([]*bls.Signature{sig1, sig2})
- agg5 := bls.Aggregate([]*bls.Signature{sig3, sig2, sig1})
+ agg1 := bls.SignatureAggregate([]*bls.Signature{sig1, sig2, sig3})
+ agg2 := bls.SignatureAggregate([]*bls.Signature{sig1, sig2, sig4})
+ agg3 := bls.SignatureAggregate([]*bls.Signature{sig11, sig2, sig3})
+ agg4 := bls.SignatureAggregate([]*bls.Signature{sig1, sig2})
+ agg5 := bls.SignatureAggregate([]*bls.Signature{sig3, sig2, sig1})
pubs1 := []*bls.PublicKey{pub1, pub2, pub3}
pubs2 := []*bls.PublicKey{pub1, pub2, pub4}
pubs3 := []*bls.PublicKey{pub1, pub2}
pubs4 := []*bls.PublicKey{pub3, pub2, pub1}
+ pubAgg1 := bls.PublicKeyAggregate(pubs1)
+ pubAgg2 := bls.PublicKeyAggregate(pubs2)
+ pubAgg3 := bls.PublicKeyAggregate(pubs3)
+ pubAgg4 := bls.PublicKeyAggregate(pubs4)
+
assert.NoError(t, pub1.Verify(msg1, sig1))
assert.NoError(t, pub2.Verify(msg1, sig2))
assert.NoError(t, pub3.Verify(msg1, sig3))
@@ -91,10 +96,24 @@ func TestAggregateFailed(t *testing.T) {
assert.False(t, bls.VerifyAggregated(agg1, pubs3, msg1))
assert.True(t, bls.VerifyAggregated(agg5, pubs1, msg1))
assert.True(t, bls.VerifyAggregated(agg1, pubs4, msg1))
+
+ assert.Nil(t, pubAgg1.Verify(msg1, agg1))
+ assert.NotNil(t, pubAgg1.Verify(msg2, agg1))
+ assert.NotNil(t, pubAgg1.Verify(msg1, agg2))
+ assert.NotNil(t, pubAgg2.Verify(msg1, agg1))
+ assert.Nil(t, pubAgg2.Verify(msg1, agg2))
+ assert.NotNil(t, pubAgg2.Verify(msg2, agg2))
+ assert.NotNil(t, pubAgg1.Verify(msg1, agg3))
+ assert.NotNil(t, pubAgg1.Verify(msg2, agg3))
+ assert.NotNil(t, pubAgg1.Verify(msg1, agg4))
+ assert.NotNil(t, pubAgg3.Verify(msg1, agg1))
+ assert.Nil(t, pubAgg1.Verify(msg1, agg5))
+ assert.Nil(t, pubAgg4.Verify(msg1, agg1))
}
func TestAggregateNil(t *testing.T) {
- assert.Nil(t, bls.Aggregate(nil))
+ assert.Nil(t, bls.SignatureAggregate(nil))
+ assert.Nil(t, bls.PublicKeyAggregate(nil))
}
func TestAggregateOnlyOneSignature(t *testing.T) {
@@ -103,11 +122,20 @@ func TestAggregateOnlyOneSignature(t *testing.T) {
_, prv1 := ts.RandomBLSKeyPair()
msg1 := []byte("zarb")
sig1 := prv1.Sign(msg1).(*bls.Signature)
- agg1 := bls.Aggregate([]*bls.Signature{sig1})
+ agg1 := bls.SignatureAggregate([]*bls.Signature{sig1})
assert.True(t, agg1.EqualsTo(sig1))
}
+func TestAggregateOnlyOnePublicKey(t *testing.T) {
+ ts := testsuite.NewTestSuite(t)
+
+ pub1, _ := ts.RandomBLSKeyPair()
+ agg1 := bls.PublicKeyAggregate([]*bls.PublicKey{pub1})
+
+ assert.True(t, agg1.EqualsTo(pub1))
+}
+
// TODO: should we check for duplication here?
func TestDuplicatedAggregate(t *testing.T) {
ts := testsuite.NewTestSuite(t)
@@ -120,15 +148,21 @@ func TestDuplicatedAggregate(t *testing.T) {
sig1 := prv1.Sign(msg1).(*bls.Signature)
sig2 := prv2.Sign(msg1).(*bls.Signature)
- agg1 := bls.Aggregate([]*bls.Signature{sig1, sig2, sig1})
- agg2 := bls.Aggregate([]*bls.Signature{sig1, sig2})
+ agg1 := bls.SignatureAggregate([]*bls.Signature{sig1, sig2, sig1})
+ agg2 := bls.SignatureAggregate([]*bls.Signature{sig1, sig2})
assert.False(t, agg1.EqualsTo(agg2))
pubs1 := []*bls.PublicKey{pub1, pub2}
+ pubs2 := []*bls.PublicKey{pub1, pub2, pub1}
+ pubAgg1 := bls.PublicKeyAggregate(pubs1)
+ pubAgg2 := bls.PublicKeyAggregate(pubs2)
+ assert.False(t, pubAgg1.EqualsTo(pubAgg2))
+
assert.False(t, bls.VerifyAggregated(agg1, pubs1, msg1))
+ assert.NotNil(t, pubAgg1.Verify(msg1, agg1))
- pubs2 := []*bls.PublicKey{pub1, pub2, pub1}
assert.True(t, bls.VerifyAggregated(agg1, pubs2, msg1))
+ assert.Nil(t, pubAgg2.Verify(msg1, agg1))
}
// TestHashToCurve ensures that the hash-to-curve function in kilic/bls12-381
diff --git a/crypto/hash/hash.go b/crypto/hash/hash.go
index f001ce561..87fcc2cf6 100644
--- a/crypto/hash/hash.go
+++ b/crypto/hash/hash.go
@@ -72,7 +72,7 @@ func (h Hash) Stamp() Stamp {
return stamp
}
-func (h Hash) Fingerprint() string {
+func (h Hash) ShortString() string {
return fmt.Sprintf("%X", h[:6])
}
diff --git a/crypto/hash/hash_test.go b/crypto/hash/hash_test.go
index 7bf2111a8..b16bd6745 100644
--- a/crypto/hash/hash_test.go
+++ b/crypto/hash/hash_test.go
@@ -15,7 +15,7 @@ func TestHashFromString(t *testing.T) {
hash1 := ts.RandomHash()
hash2, err := hash.FromString(hash1.String())
- assert.Contains(t, strings.ToUpper(hash1.String()), hash1.Fingerprint())
+ assert.Contains(t, strings.ToUpper(hash1.String()), hash1.ShortString())
assert.NoError(t, err)
assert.True(t, hash1.EqualsTo(hash2))
diff --git a/docs/metrics/metrics.md b/docs/metrics/metrics.md
new file mode 100644
index 000000000..0c23d544f
--- /dev/null
+++ b/docs/metrics/metrics.md
@@ -0,0 +1,43 @@
+# Metrics
+
+The Pactus blockchain offers [Prometheus](https://prometheus.io/) metrics for its network module, enabling users to monitor and analyze various network-related statistics. To activate this feature, inside the `config.toml`, set the `enable_metrics` parameter to true. Also, ensure that the HTTP module is enabled. You can enable HTTP module under the `[http]` section of the `config.toml` file. Once enabled, the metrics can be accessed at [http://localhost:8080/metrics/prometheus](http://localhost:8080/metrics/prometheus).
+
+After these changes, restart the Pactus node; you should now be able to view the metrics.
+
+## Prometheus Configuration
+
+Prometheus is an open-source monitoring and alerting tool that facilitates the collection and processing of metrics. A common method of running Prometheus is via Docker containers. To use Prometheus with Docker, follow these steps:
+
+1- Ensure [Docker](https://www.docker.com/) is installed on your system.
+
+2- Pull the Prometheus Docker image:
+
+```text
+docker pull prom/prometheus
+```
+
+3- Create a configuration file named `prometheus.yml` to define the Prometheus configuration. You can refer to the Prometheus [documentation](https://prometheus.io/docs/prometheus/latest/configuration/configuration/) for more guidance. As an example, here's a simple configuration:
+
+```yaml
+global:
+ scrape_interval: 1m
+
+scrape_configs:
+ - job_name: "prometheus"
+ scrape_interval: 1m
+ static_configs:
+ - targets: [ "127.0.0.1:9090" ]
+
+ - job_name: "pactus-metrics"
+ metrics_path: /metrics/prometheus
+ static_configs:
+ - targets: [ "127.0.0.1:8080" ]
+```
+4- Start Prometheus as a Docker container:
+
+```text
+docker run -p 9090:9090 -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus
+```
+Replace `/path/to/prometheus.yml` with the actual path to your configuration file.
+
+5- Prometheus should now be up and running. Access the Prometheus web interface by visiting [http://localhost:9090/](http://localhost:9090/) in your web browser.
diff --git a/execution/execution.go b/execution/execution.go
index 65edc46d9..902952cf3 100644
--- a/execution/execution.go
+++ b/execution/execution.go
@@ -3,6 +3,7 @@ package execution
import (
"github.com/pactus-project/pactus/execution/executor"
"github.com/pactus-project/pactus/sandbox"
+ "github.com/pactus-project/pactus/types/param"
"github.com/pactus-project/pactus/types/tx"
"github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/util"
@@ -122,7 +123,7 @@ func (exe *Execution) checkFee(trx *tx.Tx, sb sandbox.Sandbox) error {
return errors.Errorf(errors.ErrInvalidTx, "fee is wrong, expected: 0, got: %v", trx.Fee())
}
} else {
- fee := calculateFee(trx.Payload().Value(), sb)
+ fee := CalculateFee(trx.Payload().Value(), sb.Params())
if trx.Fee() != fee {
return errors.Errorf(errors.ErrInvalidFee, "fee is wrong, expected: %v, got: %v", fee, trx.Fee())
}
@@ -130,10 +131,9 @@ func (exe *Execution) checkFee(trx *tx.Tx, sb sandbox.Sandbox) error {
return nil
}
-func calculateFee(amt int64, sb sandbox.Sandbox) int64 {
- params := sb.Params()
+func CalculateFee(amt int64, params param.Params) int64 {
fee := int64(float64(amt) * params.FeeFraction)
- fee = util.Max64(fee, params.MinimumFee)
- fee = util.Min64(fee, params.MaximumFee)
+ fee = util.Max(fee, params.MinimumFee)
+ fee = util.Min(fee, params.MaximumFee)
return fee
}
diff --git a/execution/execution_test.go b/execution/execution_test.go
index 9a04a8535..5d7911236 100644
--- a/execution/execution_test.go
+++ b/execution/execution_test.go
@@ -34,61 +34,71 @@ func TestExecution(t *testing.T) {
t.Run("Invalid transaction, Should returns error", func(t *testing.T) {
trx, _ := ts.GenerateTestTransferTx()
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
assert.Zero(t, exe.AccumulatedFee())
})
t.Run("Genesis stamp (expired), Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(hash.UndefHash.Stamp(), 1, addr1, rcvAddr, 1000, 1000, "expired-stamp")
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("Expired stamp, Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(block1.Stamp(), 1, addr1, rcvAddr, 1000, 1000,
"expired-stamp")
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("stamp is valid", func(t *testing.T) {
trx := tx.NewTransferTx(block3.Stamp(), 1, addr1, rcvAddr, 1000, 1000, "ok")
signer1.SignMsg(trx)
- assert.NoError(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.NoError(t, err)
})
t.Run("Subsidy transaction has an invalid stamp", func(t *testing.T) {
trx := tx.NewSubsidyTx(block8641.Stamp(), 1, rcvAddr, 1000,
"expired-stamp")
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("Subsidy stamp is ok", func(t *testing.T) {
trx := tx.NewSubsidyTx(block8642.Stamp(), 1, rcvAddr, 1000, "ok")
- assert.NoError(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.NoError(t, err)
})
t.Run("Invalid fee, Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(block3.Stamp(), 2, addr1, rcvAddr, 1000, 1, "invalid fee")
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidFee)
})
t.Run("Invalid fee, Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(block3.Stamp(), 2, addr1, rcvAddr, 1000, 1001, "invalid fee")
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidFee)
})
t.Run("Invalid fee (subsidy tx), Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(block3.Stamp(), 2, crypto.TreasuryAddress, rcvAddr, 1000, 1, "invalid fee")
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidFee)
assert.Error(t, exe.checkFee(trx, sb))
})
t.Run("Invalid fee (send tx), Should returns error", func(t *testing.T) {
trx := tx.NewTransferTx(block3.Stamp(), 2, addr1, rcvAddr, 1000, 0, "invalid fee")
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidFee)
assert.Error(t, exe.checkFee(trx, sb))
})
@@ -96,14 +106,16 @@ func TestExecution(t *testing.T) {
proof := ts.RandomProof()
trx := tx.NewSortitionTx(block8635.Stamp(), 1, addr1, proof)
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("Execution failed", func(t *testing.T) {
proof := ts.RandomProof()
trx := tx.NewSortitionTx(block8642.Stamp(), 1, addr1, proof)
signer1.SignMsg(trx)
- assert.Error(t, exe.Execute(trx, sb))
+ err := exe.Execute(trx, sb)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAddress)
})
}
@@ -246,7 +258,7 @@ func TestFee(t *testing.T) {
assert.Equal(t, errors.Code(err), test.expectedErrCode,
"test %v failed. unexpected error", i)
- assert.Equal(t, calculateFee(test.amount, sb), test.expectedFee,
+ assert.Equal(t, CalculateFee(test.amount, sb.Params()), test.expectedFee,
"test %v failed. invalid fee", i)
}
}
diff --git a/execution/executor/bond.go b/execution/executor/bond.go
index 9ec06b44c..e564399a4 100644
--- a/execution/executor/bond.go
+++ b/execution/executor/bond.go
@@ -47,8 +47,8 @@ func (e *BondExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
}
if e.strict {
// In strict mode, bond transactions will be rejected if a validator is
- // in the committee.
- // In non-strict mode, we accept them and keep them inside the transaction pool
+ // already in the committee.
+ // In non-strict mode, we accept them and keep them in the transaction pool
// to process them when the validator leaves the committee.
if sb.Committee().Contains(pld.Receiver) {
return errors.Errorf(errors.ErrInvalidTx,
@@ -56,10 +56,10 @@ func (e *BondExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
}
// In strict mode, bond transactions will be rejected if a validator is
- // going to be in the committee for the next height.
- // In non-strict mode, we accept it and keep it inside the transaction pool to
+ // going to join the committee in the next height.
+ // In non-strict mode, we accept it and keep it in the transaction pool to
// process it when the validator leaves the committee.
- if receiverVal.LastJoinedHeight() == sb.CurrentHeight() {
+ if sb.IsJoinedCommittee(pld.Receiver) {
return errors.Errorf(errors.ErrInvalidTx,
"validator %v joins committee in the next height", pld.Receiver)
}
@@ -68,7 +68,7 @@ func (e *BondExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
return errors.Error(errors.ErrInsufficientFunds)
}
if receiverVal.Stake()+pld.Stake > sb.Params().MaximumStake {
- return errors.Errorf(errors.ErrInvalidTx,
+ return errors.Errorf(errors.ErrInvalidAmount,
"validator's stake can't be more than %v", sb.Params().MaximumStake)
} else if pld.Stake < sb.Params().MinimumStake {
return errors.Errorf(errors.ErrInvalidTx,
diff --git a/execution/executor/bond_test.go b/execution/executor/bond_test.go
index 4ed062630..63b286aa8 100644
--- a/execution/executor/bond_test.go
+++ b/execution/executor/bond_test.go
@@ -19,7 +19,7 @@ func TestExecuteBondTx(t *testing.T) {
receiverAddr := pub.Address()
amt, fee := td.randomAmountAndFee(td.sandbox.TestParams.MinimumStake, senderBalance)
t.Run("Should fail, invalid sender", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), 1, td.RandomAddress(),
+ trx := tx.NewBondTx(td.randStamp, 1, td.RandomAddress(),
receiverAddr, pub, amt, fee, "invalid sender")
err := exe.Execute(trx, td.sandbox)
@@ -27,7 +27,7 @@ func TestExecuteBondTx(t *testing.T) {
})
t.Run("Should fail, treasury address as receiver", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
crypto.TreasuryAddress, nil, amt, fee, "invalid ")
err := exe.Execute(trx, td.sandbox)
@@ -35,7 +35,7 @@ func TestExecuteBondTx(t *testing.T) {
})
t.Run("Should fail, invalid sequence", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+2, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+2, senderAddr,
receiverAddr, pub, amt, fee, "invalid sequence")
err := exe.Execute(trx, td.sandbox)
@@ -43,7 +43,7 @@ func TestExecuteBondTx(t *testing.T) {
})
t.Run("Should fail, insufficient balance", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
receiverAddr, pub, senderBalance+1, 0, "insufficient balance")
err := exe.Execute(trx, td.sandbox)
@@ -52,7 +52,7 @@ func TestExecuteBondTx(t *testing.T) {
t.Run("Should fail, inside committee", func(t *testing.T) {
pub := td.sandbox.Committee().Proposer(0).PublicKey()
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
pub.Address(), nil, amt, fee, "inside committee")
err := exe.Execute(trx, td.sandbox)
@@ -64,7 +64,7 @@ func TestExecuteBondTx(t *testing.T) {
val := td.sandbox.MakeNewValidator(pub)
val.UpdateUnbondingHeight(td.sandbox.CurrentHeight())
td.sandbox.UpdateValidator(val)
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
pub.Address(), nil, amt, fee, "unbonded before")
err := exe.Execute(trx, td.sandbox)
@@ -72,7 +72,7 @@ func TestExecuteBondTx(t *testing.T) {
})
t.Run("Should fail, public key is not set", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
receiverAddr, nil, amt, fee, "no public key")
err := exe.Execute(trx, td.sandbox)
@@ -88,15 +88,17 @@ func TestExecuteBondTx(t *testing.T) {
})
t.Run("Ok", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
receiverAddr, pub, amt, fee, "ok")
- assert.NoError(t, exe.Execute(trx, td.sandbox), "Ok")
- assert.Error(t, exe.Execute(trx, td.sandbox), "Execute again, should fail")
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err, "Ok")
+ err = exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence, "Execute again, should fail")
})
t.Run("Should fail, public key should not set for existing validators", func(t *testing.T) {
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+2, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+2, senderAddr,
receiverAddr, pub, amt, fee, "with public key")
err := exe.Execute(trx, td.sandbox)
@@ -111,8 +113,8 @@ func TestExecuteBondTx(t *testing.T) {
td.checkTotalCoin(t, fee)
}
-// TestBondInsideCommittee checks if a validator inside the committee tries to
-// increase the stake.
+// TestBondInsideCommittee checks if a validator inside the committee attempts to
+// increase their stake.
// In non-strict mode it should be accepted.
func TestBondInsideCommittee(t *testing.T) {
td := setup(t)
@@ -124,16 +126,16 @@ func TestBondInsideCommittee(t *testing.T) {
amt, fee := td.randomAmountAndFee(0, senderBalance)
pub := td.sandbox.Committee().Proposer(0).PublicKey()
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
pub.Address(), nil, amt, fee, "inside committee")
assert.Error(t, exe1.Execute(trx, td.sandbox))
assert.NoError(t, exe2.Execute(trx, td.sandbox))
}
-// TestBondJoiningCommittee checks if a validator tries to increase stake after
-// evaluating sortition.
-// In non-strict mode it should be accepted.
+// TestBondJoiningCommittee checks if a validator attempts to increase their
+// stake after evaluating sortition.
+// In non-strict mode, it should be accepted.
func TestBondJoiningCommittee(t *testing.T) {
td := setup(t)
@@ -145,18 +147,18 @@ func TestBondJoiningCommittee(t *testing.T) {
amt, fee := td.randomAmountAndFee(0, senderBalance)
val := td.sandbox.MakeNewValidator(pub)
- val.UpdateLastJoinedHeight(td.sandbox.CurrentHeight())
+ val.UpdateLastSortitionHeight(td.sandbox.CurrentHeight())
td.sandbox.UpdateValidator(val)
+ td.sandbox.JoinedToCommittee(val.Address())
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
pub.Address(), nil, amt, fee, "joining committee")
assert.Error(t, exe1.Execute(trx, td.sandbox))
assert.NoError(t, exe2.Execute(trx, td.sandbox))
}
-// TestStakeExceeded checks if the validator's stake exceeded the MaximumStake
-// parameter.
+// TestStakeExceeded checks if the validator's stake exceeded the MaximumStake parameter.
func TestStakeExceeded(t *testing.T) {
td := setup(t)
@@ -168,8 +170,9 @@ func TestStakeExceeded(t *testing.T) {
td.sandbox.UpdateAccount(senderAddr, senderAcc)
pub, _ := td.RandomBLSKeyPair()
- trx := tx.NewBondTx(td.RandomStamp(), senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewBondTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
pub.Address(), pub, amt, fee, "stake exceeded")
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAmount)
}
diff --git a/execution/executor/sortition.go b/execution/executor/sortition.go
index fc294bb23..3137e206e 100644
--- a/execution/executor/sortition.go
+++ b/execution/executor/sortition.go
@@ -31,27 +31,32 @@ func (e *SortitionExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
return errors.Errorf(errors.ErrInvalidHeight,
"validator has bonded at height %v", val.LastBondingHeight())
}
- // Power for parked validators (unbonded) set to zero.
- // So the proof is not valid, even if they have enough stake.
ok := sb.VerifyProof(trx.Stamp(), pld.Proof, val)
if !ok {
return errors.Error(errors.ErrInvalidProof)
}
+ sortitionHeight, _ := sb.RecentBlockByStamp(trx.Stamp())
if e.strict {
- // A validator might produce more than one sortition transaction
- // before entering into the committee
- // In non-strict mode we don't check the sequence number
+ // It is possible for a validator to generate multiple sortition transactions
+ // before entering the committee.
+ // In non-strict mode, we do not check the sequence number.
if val.Sequence()+1 != trx.Sequence() {
return errors.Errorf(errors.ErrInvalidSequence,
"expected: %v, got: %v", val.Sequence()+1, trx.Sequence())
}
+ // Check for the duplicated or expired sortition transactions
+ if sortitionHeight <= val.LastSortitionHeight() {
+ return errors.Errorf(errors.ErrInvalidTx,
+ "duplicated sortition transaction")
+ }
if sb.Committee().Size() >= sb.Params().CommitteeSize {
if err := e.joinCommittee(sb, val); err != nil {
return err
}
} else {
- // Committee has free seats.
- // Rejecting sortition transactions from existing committee members.
+ // There are available seats in the committee.
+ // We will add new members while ignoring any sortition transactions
+ // for existing committee members.
if sb.Committee().Contains(val.Address()) {
return errors.Errorf(errors.ErrInvalidTx,
"validator is in committee")
@@ -60,8 +65,9 @@ func (e *SortitionExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
}
val.IncSequence()
- val.UpdateLastJoinedHeight(sb.CurrentHeight())
+ val.UpdateLastSortitionHeight(sortitionHeight)
+ sb.JoinedToCommittee(pld.Address)
sb.UpdateValidator(val)
return nil
@@ -76,9 +82,8 @@ func (e *SortitionExecutor) joinCommittee(sb sandbox.Sandbox,
joiningNum := 0
joiningPower := int64(0)
committee := sb.Committee()
- currentHeight := sb.CurrentHeight()
- sb.IterateValidators(func(val *validator.Validator, updated bool) {
- if val.LastJoinedHeight() == currentHeight {
+ sb.IterateValidators(func(val *validator.Validator, updated bool, joined bool) {
+ if joined {
if !committee.Contains(val.Address()) {
joiningPower += val.Power()
joiningNum++
@@ -96,7 +101,7 @@ func (e *SortitionExecutor) joinCommittee(sb sandbox.Sandbox,
vals := committee.Validators()
sort.SliceStable(vals, func(i, j int) bool {
- return vals[i].LastJoinedHeight() < vals[j].LastJoinedHeight()
+ return vals[i].LastSortitionHeight() < vals[j].LastSortitionHeight()
})
leavingPower := int64(0)
for i := 0; i < joiningNum; i++ {
@@ -107,18 +112,17 @@ func (e *SortitionExecutor) joinCommittee(sb sandbox.Sandbox,
"in each height only 1/3 of stake can leave")
}
- oldestJoinedHeight := currentHeight
+ oldestSortitionHeight := sb.CurrentHeight()
for _, v := range committee.Validators() {
- if v.LastJoinedHeight() < oldestJoinedHeight {
- oldestJoinedHeight = v.LastJoinedHeight()
+ if v.LastSortitionHeight() < oldestSortitionHeight {
+ oldestSortitionHeight = v.LastSortitionHeight()
}
}
// If the oldest validator in the committee still hasn't propose a block yet,
// she stays in the committee.
- // We assumes all blocks has committed in round 0, in future we can consider
- // round parameter. It is backward compatible
- if currentHeight-oldestJoinedHeight < uint32(sb.Params().CommitteeSize) {
+ proposerHeight := sb.Committee().Proposer(0).LastSortitionHeight()
+ if oldestSortitionHeight >= proposerHeight {
return errors.Errorf(errors.ErrInvalidTx,
"oldest validator still didn't propose any block")
}
diff --git a/execution/executor/sortition_test.go b/execution/executor/sortition_test.go
index 5b664bb79..4bd7e430a 100644
--- a/execution/executor/sortition_test.go
+++ b/execution/executor/sortition_test.go
@@ -3,12 +3,26 @@ package executor
import (
"testing"
+ "github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/types/tx"
"github.com/pactus-project/pactus/types/validator"
"github.com/pactus-project/pactus/util/errors"
"github.com/stretchr/testify/assert"
)
+func updateCommittee(td *testData) {
+ joiningCommittee := make([]*validator.Validator, 0)
+ td.sandbox.IterateValidators(func(val *validator.Validator, updated bool, joined bool) {
+ if joined {
+ joiningCommittee = append(joiningCommittee, val)
+ }
+ })
+
+ td.sandbox.TestCommittee.Update(0, joiningCommittee)
+ td.sandbox.TestJoinedValidators = make(map[crypto.Address]bool)
+ // fmt.Println(td.sandbox.TestCommittee.String())
+}
+
func TestExecuteSortitionTx(t *testing.T) {
td := setup(t)
exe := NewSortitionExecutor(true)
@@ -27,51 +41,71 @@ func TestExecuteSortitionTx(t *testing.T) {
newVal.UpdateLastBondingHeight(td.sandbox.CurrentHeight() - td.sandbox.Params().BondInterval)
td.sandbox.UpdateValidator(newVal)
+ assert.Zero(t, td.sandbox.Validator(newVal.Address()).LastSortitionHeight())
+ assert.False(t, td.sandbox.IsJoinedCommittee(newVal.Address()))
t.Run("Should fail, Invalid address", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, 1, td.RandomAddress(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, 1, td.RandomAddress(), proof)
td.sandbox.TestAcceptSortition = true
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidAddress)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAddress)
})
newVal.UpdateLastBondingHeight(td.sandbox.CurrentHeight() - td.sandbox.Params().BondInterval + 1)
td.sandbox.UpdateValidator(newVal)
+
t.Run("Should fail, Bonding period", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, newVal.Sequence()+1, newVal.Address(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, newVal.Sequence()+1, newVal.Address(), proof)
td.sandbox.TestAcceptSortition = true
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidHeight)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidHeight)
})
- td.sandbox.TestStore.AddTestBlock(500001)
+ // Let's add one more block
+ td.sandbox.TestStore.AddTestBlock(td.randHeight + 1)
t.Run("Should fail, Invalid sequence", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, newVal.Sequence()+2, newVal.Address(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, newVal.Sequence(), newVal.Address(), proof)
td.sandbox.TestAcceptSortition = true
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidSequence)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
})
t.Run("Should fail, Invalid proof", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, newVal.Sequence()+1, newVal.Address(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, newVal.Sequence()+1, newVal.Address(), proof)
td.sandbox.TestAcceptSortition = false
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidProof)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidProof)
})
t.Run("Should fail, Committee has free seats and validator is in the committee", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, existingVal.Sequence()+1, existingVal.Address(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, existingVal.Sequence()+1, existingVal.Address(), proof)
td.sandbox.TestAcceptSortition = true
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidTx)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("Should be ok", func(t *testing.T) {
- trx := tx.NewSortitionTx(td.stamp500000, newVal.Sequence()+1, newVal.Address(), proof)
+ trx := tx.NewSortitionTx(td.randStamp, newVal.Sequence()+1, newVal.Address(), proof)
td.sandbox.TestAcceptSortition = true
- assert.NoError(t, exe.Execute(trx, td.sandbox))
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
// Execute again, should fail
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ err = exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
+ })
+
+ t.Run("Should fail, duplicated sortition", func(t *testing.T) {
+ trx := tx.NewSortitionTx(td.randStamp, newVal.Sequence()+2, newVal.Address(), proof)
+ td.sandbox.TestAcceptSortition = true
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
- assert.Equal(t, td.sandbox.Validator(newVal.Address()).LastJoinedHeight(), td.sandbox.CurrentHeight())
+ assert.Equal(t, td.sandbox.CurrentHeight(), td.randHeight+2)
+ assert.Equal(t, td.sandbox.Validator(newVal.Address()).LastSortitionHeight(), td.randHeight)
+ assert.True(t, td.sandbox.IsJoinedCommittee(newVal.Address()))
assert.Zero(t, exe.Fee())
td.checkTotalCoin(t, 0)
@@ -86,9 +120,11 @@ func TestSortitionNonStrictMode(t *testing.T) {
proof := td.RandomProof()
td.sandbox.TestAcceptSortition = true
- trx := tx.NewSortitionTx(td.stamp500000, val.Sequence(), val.Address(), proof)
- assert.Error(t, exe1.Execute(trx, td.sandbox))
- assert.NoError(t, exe2.Execute(trx, td.sandbox))
+ trx := tx.NewSortitionTx(td.randStamp, val.Sequence(), val.Address(), proof)
+ err := exe1.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
+ err = exe2.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
}
func TestChangePower1(t *testing.T) {
@@ -96,6 +132,9 @@ func TestChangePower1(t *testing.T) {
exe := NewSortitionExecutor(true)
+ // This moves proposer to next validator
+ updateCommittee(td)
+
// Let's create validators first
pub1, _ := td.RandomBLSKeyPair()
amt1 := td.sandbox.Committee().TotalPower() / 3
@@ -117,15 +156,18 @@ func TestChangePower1(t *testing.T) {
td.sandbox.TestParams.CommitteeSize = 4
td.sandbox.TestAcceptSortition = true
- trx1 := tx.NewSortitionTx(td.stamp500000, val1.Sequence()+1, val1.Address(), proof1)
- assert.NoError(t, exe.Execute(trx1, td.sandbox))
+ trx1 := tx.NewSortitionTx(td.randStamp, val1.Sequence()+1, val1.Address(), proof1)
+ err := exe.Execute(trx1, td.sandbox)
+ assert.NoError(t, err)
- trx2 := tx.NewSortitionTx(td.stamp500000, val2.Sequence()+1, val2.Address(), proof2)
- assert.Error(t, exe.Execute(trx2, td.sandbox), "More than 1/3 of power is joining at the same height")
+ trx2 := tx.NewSortitionTx(td.randStamp, val2.Sequence()+1, val2.Address(), proof2)
+ err = exe.Execute(trx2, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx, "More than 1/3 of power is joining at the same height")
// Committee member
- trx3 := tx.NewSortitionTx(td.stamp500000, val3.Sequence()+1, val3.Address(), proof3)
- assert.NoError(t, exe.Execute(trx3, td.sandbox))
+ trx3 := tx.NewSortitionTx(td.randStamp, val3.Sequence()+1, val3.Address(), proof3)
+ err = exe.Execute(trx3, td.sandbox)
+ assert.NoError(t, err)
}
func TestChangePower2(t *testing.T) {
@@ -133,6 +175,9 @@ func TestChangePower2(t *testing.T) {
exe := NewSortitionExecutor(true)
+ // This moves proposer to next validator
+ updateCommittee(td)
+
// Let's create validators first
pub1, _ := td.RandomBLSKeyPair()
val1 := td.sandbox.MakeNewValidator(pub1)
@@ -160,18 +205,22 @@ func TestChangePower2(t *testing.T) {
td.sandbox.TestParams.CommitteeSize = 7
td.sandbox.TestAcceptSortition = true
- trx1 := tx.NewSortitionTx(td.stamp500000, val1.Sequence()+1, val1.Address(), proof1)
- assert.NoError(t, exe.Execute(trx1, td.sandbox))
+ trx1 := tx.NewSortitionTx(td.randStamp, val1.Sequence()+1, val1.Address(), proof1)
+ err := exe.Execute(trx1, td.sandbox)
+ assert.NoError(t, err)
- trx2 := tx.NewSortitionTx(td.stamp500000, val2.Sequence()+1, val2.Address(), proof2)
- assert.NoError(t, exe.Execute(trx2, td.sandbox))
+ trx2 := tx.NewSortitionTx(td.randStamp, val2.Sequence()+1, val2.Address(), proof2)
+ err = exe.Execute(trx2, td.sandbox)
+ assert.NoError(t, err)
- trx3 := tx.NewSortitionTx(td.stamp500000, val3.Sequence()+1, val3.Address(), proof3)
- assert.Error(t, exe.Execute(trx3, td.sandbox), "More than 1/3 of power is leaving at the same height")
+ trx3 := tx.NewSortitionTx(td.randStamp, val3.Sequence()+1, val3.Address(), proof3)
+ err = exe.Execute(trx3, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx, "More than 1/3 of power is leaving at the same height")
// Committee member
- trx4 := tx.NewSortitionTx(td.stamp500000, val4.Sequence()+1, val4.Address(), proof4)
- assert.NoError(t, exe.Execute(trx4, td.sandbox))
+ trx4 := tx.NewSortitionTx(td.randStamp, val4.Sequence()+1, val4.Address(), proof4)
+ err = exe.Execute(trx4, td.sandbox)
+ assert.NoError(t, err)
}
// TestOldestDidNotPropose tests if the oldest validator in the committee had
@@ -187,7 +236,8 @@ func TestOldestDidNotPropose(t *testing.T) {
pub, _ := td.RandomBLSKeyPair()
val := td.sandbox.MakeNewValidator(pub)
val.AddToStake(10 * 1e9)
- val.UpdateLastBondingHeight(td.sandbox.CurrentHeight() - td.sandbox.Params().BondInterval)
+ val.UpdateLastBondingHeight(
+ td.sandbox.CurrentHeight() - td.sandbox.Params().BondInterval)
td.sandbox.UpdateValidator(val)
vals[i] = val
}
@@ -195,26 +245,44 @@ func TestOldestDidNotPropose(t *testing.T) {
td.sandbox.TestParams.CommitteeSize = 7
td.sandbox.TestAcceptSortition = true
- stamp := td.stamp500000
- for i := 0; i < 8; i = i + 2 {
- b := td.sandbox.TestStore.AddTestBlock(uint32(500001 + (i / 2)))
- stamp = b.Stamp()
+ // This moves proposer to the next validator
+ updateCommittee(td)
- trx1 := tx.NewSortitionTx(stamp, vals[i].Sequence()+1, vals[i].Address(), td.RandomProof())
- assert.NoError(t, exe.Execute(trx1, td.sandbox))
+ // Let's update committee
+ height := td.randHeight
+ for i := uint32(0); i < 7; i++ {
+ height++
+ b := td.sandbox.TestStore.AddTestBlock(height)
+ stamp := b.Stamp()
- trx2 := tx.NewSortitionTx(stamp, vals[i+1].Sequence()+1, vals[i+1].Address(), td.RandomProof())
- assert.NoError(t, exe.Execute(trx2, td.sandbox))
+ trx1 := tx.NewSortitionTx(stamp,
+ vals[i].Sequence()+1,
+ vals[i].Address(), td.RandomProof())
+ err := exe.Execute(trx1, td.sandbox)
+ assert.NoError(t, err)
- joined := make([]*validator.Validator, 0)
- td.sandbox.IterateValidators(func(val *validator.Validator, updated bool) {
- if val.LastJoinedHeight() == td.sandbox.CurrentHeight() {
- joined = append(joined, val)
- }
- })
- td.sandbox.TestCommittee.Update(0, joined)
+ updateCommittee(td)
}
- trx := tx.NewSortitionTx(stamp, vals[8].Sequence()+1, vals[8].Address(), td.RandomProof())
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ height++
+ b := td.sandbox.TestStore.AddTestBlock(height)
+ stamp := b.Stamp()
+
+ trx1 := tx.NewSortitionTx(stamp, vals[7].Sequence()+1, vals[7].Address(), td.RandomProof())
+ err := exe.Execute(trx1, td.sandbox)
+ assert.NoError(t, err)
+
+ trx2 := tx.NewSortitionTx(stamp, vals[8].Sequence()+1, vals[8].Address(), td.RandomProof())
+ err = exe.Execute(trx2, td.sandbox)
+ assert.NoError(t, err)
+ updateCommittee(td)
+
+ height++
+ b = td.sandbox.TestStore.AddTestBlock(height)
+ stamp = b.Stamp()
+
+ // Entering validator 16
+ trx3 := tx.NewSortitionTx(stamp, vals[8].Sequence()+2, vals[8].Address(), td.RandomProof())
+ err = exe.Execute(trx3, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
}
diff --git a/execution/executor/transfer_test.go b/execution/executor/transfer_test.go
index 8fd5dc434..8279cd6e0 100644
--- a/execution/executor/transfer_test.go
+++ b/execution/executor/transfer_test.go
@@ -14,21 +14,23 @@ import (
type testData struct {
*testsuite.TestSuite
- sandbox *sandbox.MockSandbox
- stamp500000 hash.Stamp
+ sandbox *sandbox.MockSandbox
+ randStamp hash.Stamp
+ randHeight uint32
}
func setup(t *testing.T) *testData {
ts := testsuite.NewTestSuite(t)
sandbox := sandbox.MockingSandbox(ts)
- block500000 := sandbox.TestStore.AddTestBlock(500000)
- stamp500000 := block500000.Stamp()
+ randHeight := ts.RandUint32NonZero(500000)
+ randBlock := sandbox.TestStore.AddTestBlock(randHeight)
return &testData{
- TestSuite: ts,
- sandbox: sandbox,
- stamp500000: stamp500000,
+ TestSuite: ts,
+ sandbox: sandbox,
+ randStamp: randBlock.Stamp(),
+ randHeight: randHeight,
}
}
@@ -64,34 +66,39 @@ func TestExecuteTransferTx(t *testing.T) {
amt, fee := td.randomAmountAndFee(0, senderBalance)
t.Run("Should fail, Sender has no account", func(t *testing.T) {
- trx := tx.NewTransferTx(td.stamp500000, 1, td.RandomAddress(),
+ trx := tx.NewTransferTx(td.randStamp, 1, td.RandomAddress(),
receiverAddr, amt, fee, "non-existing account")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidAddress)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAddress)
})
t.Run("Should fail, insufficient balance", func(t *testing.T) {
- trx := tx.NewTransferTx(td.stamp500000, senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewTransferTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
receiverAddr, senderBalance+1, 0, "insufficient balance")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInsufficientFunds)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInsufficientFunds)
})
t.Run("Should fail, Invalid sequence", func(t *testing.T) {
- trx := tx.NewTransferTx(td.stamp500000, senderAcc.Sequence()+2, senderAddr,
+ trx := tx.NewTransferTx(td.randStamp, senderAcc.Sequence()+2, senderAddr,
receiverAddr, amt, fee, "invalid sequence")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidSequence)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
})
t.Run("Ok", func(t *testing.T) {
- trx := tx.NewTransferTx(td.stamp500000, senderAcc.Sequence()+1, senderAddr,
+ trx := tx.NewTransferTx(td.randStamp, senderAcc.Sequence()+1, senderAddr,
receiverAddr, amt, fee, "ok")
- assert.NoError(t, exe.Execute(trx, td.sandbox))
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
// Execute again, should fail
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ err = exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
})
assert.Equal(t, td.sandbox.Account(senderAddr).Balance(), senderBalance-(amt+fee))
@@ -108,8 +115,9 @@ func TestTransferToSelf(t *testing.T) {
senderBalance := senderAcc.Balance()
amt, fee := td.randomAmountAndFee(0, senderBalance)
- trx := tx.NewTransferTx(td.stamp500000, senderAcc.Sequence()+1, senderAddr, senderAddr, amt, fee, "ok")
- assert.NoError(t, exe.Execute(trx, td.sandbox))
+ trx := tx.NewTransferTx(td.randStamp, senderAcc.Sequence()+1, senderAddr, senderAddr, amt, fee, "ok")
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
assert.Equal(t, td.sandbox.Account(senderAddr).Balance(), senderBalance-fee) // Fee should be deducted
assert.Equal(t, exe.Fee(), fee)
@@ -122,11 +130,11 @@ func TestTransferNonStrictMode(t *testing.T) {
receiver1 := td.RandomAddress()
- trx1 := tx.NewSubsidyTx(td.stamp500000, int32(td.sandbox.CurrentHeight()), receiver1, 1, "")
+ trx1 := tx.NewSubsidyTx(td.randStamp, int32(td.sandbox.CurrentHeight()), receiver1, 1, "")
assert.Equal(t, errors.Code(exe1.Execute(trx1, td.sandbox)), errors.ErrInvalidSequence)
assert.NoError(t, exe2.Execute(trx1, td.sandbox))
- trx2 := tx.NewSubsidyTx(td.stamp500000, int32(td.sandbox.CurrentHeight()+1), receiver1, 1, "")
+ trx2 := tx.NewSubsidyTx(td.randStamp, int32(td.sandbox.CurrentHeight()+1), receiver1, 1, "")
assert.Equal(t, errors.Code(exe1.Execute(trx2, td.sandbox)), errors.ErrInvalidSequence)
assert.Equal(t, errors.Code(exe2.Execute(trx2, td.sandbox)), errors.ErrInvalidSequence)
}
diff --git a/execution/executor/unbond.go b/execution/executor/unbond.go
index c3a48f99c..4e4aaaa77 100644
--- a/execution/executor/unbond.go
+++ b/execution/executor/unbond.go
@@ -45,7 +45,7 @@ func (e *UnbondExecutor) Execute(trx *tx.Tx, sb sandbox.Sandbox) error {
// going to be in the committee for the next height.
// In non-strict mode, we accept it and keep it inside the transaction pool to
// process it when the validator leaves the committee.
- if val.LastJoinedHeight() == sb.CurrentHeight() {
+ if sb.IsJoinedCommittee(pld.Validator) {
return errors.Errorf(errors.ErrInvalidHeight,
"validator %v joins committee in the next height", pld.Validator)
}
diff --git a/execution/executor/unbond_test.go b/execution/executor/unbond_test.go
index e460b2dba..3acad0983 100644
--- a/execution/executor/unbond_test.go
+++ b/execution/executor/unbond_test.go
@@ -18,19 +18,22 @@ func TestExecuteUnbondTx(t *testing.T) {
td.sandbox.UpdateValidator(val)
t.Run("Should fail, Invalid validator", func(t *testing.T) {
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, td.RandomAddress(), "invalid validator")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidAddress)
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, td.RandomAddress(), "invalid validator")
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAddress)
})
t.Run("Should fail, Invalid sequence", func(t *testing.T) {
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+2, valAddr, "invalid sequence")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidSequence)
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+2, valAddr, "invalid sequence")
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
})
t.Run("Should fail, Inside committee", func(t *testing.T) {
val := td.sandbox.Committee().Proposer(0)
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, val.Address(), "inside committee")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidTx)
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, val.Address(), "inside committee")
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidTx)
})
t.Run("Should fail, Cannot unbond if unbonded already", func(t *testing.T) {
@@ -39,17 +42,20 @@ func TestExecuteUnbondTx(t *testing.T) {
val.UpdateUnbondingHeight(td.sandbox.CurrentHeight())
td.sandbox.UpdateValidator(val)
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, pub.Address(), "Ok")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidHeight)
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, pub.Address(), "Ok")
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidHeight)
})
t.Run("Ok", func(t *testing.T) {
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, valAddr, "Ok")
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, valAddr, "Ok")
- assert.NoError(t, exe.Execute(trx, td.sandbox))
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
// Execute again, should fail
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ err = exe.Execute(trx, td.sandbox)
+ assert.Error(t, err)
})
assert.Zero(t, td.sandbox.Validator(valAddr).Stake())
@@ -70,7 +76,7 @@ func TestUnbondInsideCommittee(t *testing.T) {
exe2 := NewUnbondExecutor(false)
val := td.sandbox.Committee().Proposer(0)
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, val.Address(), "")
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, val.Address(), "")
assert.Error(t, exe1.Execute(trx, td.sandbox))
assert.NoError(t, exe2.Execute(trx, td.sandbox))
@@ -86,10 +92,11 @@ func TestUnbondJoiningCommittee(t *testing.T) {
pub, _ := td.RandomBLSKeyPair()
val := td.sandbox.MakeNewValidator(pub)
- val.UpdateLastJoinedHeight(td.sandbox.CurrentHeight())
+ val.UpdateLastSortitionHeight(td.randHeight)
td.sandbox.UpdateValidator(val)
+ td.sandbox.JoinedToCommittee(val.Address())
- trx := tx.NewUnbondTx(td.stamp500000, val.Sequence()+1, pub.Address(), "Ok")
+ trx := tx.NewUnbondTx(td.randStamp, val.Sequence()+1, pub.Address(), "Ok")
assert.Error(t, exe1.Execute(trx, td.sandbox))
assert.NoError(t, exe2.Execute(trx, td.sandbox))
}
diff --git a/execution/executor/withdraw_test.go b/execution/executor/withdraw_test.go
index 35be0ccdb..959c0d871 100644
--- a/execution/executor/withdraw_test.go
+++ b/execution/executor/withdraw_test.go
@@ -23,59 +23,67 @@ func TestExecuteWithdrawTx(t *testing.T) {
td.sandbox.UpdateValidator(val)
t.Run("Should fail, Invalid validator", func(t *testing.T) {
- trx := tx.NewWithdrawTx(td.stamp500000, 1, td.RandomAddress(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, 1, td.RandomAddress(), addr,
amt, fee, "invalid validator")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidAddress)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidAddress)
})
t.Run("Should fail, Invalid sequence", func(t *testing.T) {
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+2, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+2, val.Address(), addr,
amt, fee, "invalid sequence")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidSequence)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence)
})
t.Run("Should fail, insufficient balance", func(t *testing.T) {
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+1, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+1, val.Address(), addr,
amt+1, fee, "insufficient balance")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInsufficientFunds)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInsufficientFunds)
})
t.Run("Should fail, hasn't unbonded yet", func(t *testing.T) {
assert.Zero(t, val.UnbondingHeight())
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+1, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+1, val.Address(), addr,
amt, fee, "need to unbond first")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidHeight)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidHeight)
})
val.UpdateUnbondingHeight(td.sandbox.CurrentHeight() - td.sandbox.Params().UnbondInterval + 1)
td.sandbox.UpdateValidator(val)
t.Run("Should fail, hasn't passed unbonding interval", func(t *testing.T) {
assert.NotZero(t, val.UnbondingHeight())
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+1, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+1, val.Address(), addr,
amt, fee, "not passed unbonding interval")
- assert.Equal(t, errors.Code(exe.Execute(trx, td.sandbox)), errors.ErrInvalidHeight)
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidHeight)
})
- td.sandbox.TestStore.AddTestBlock(500001)
+ td.sandbox.TestStore.AddTestBlock(td.randHeight + 1)
t.Run("Should pass, Everything is Ok!", func(t *testing.T) {
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+1, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+1, val.Address(), addr,
amt, fee, "should be able to empty stake")
- assert.NoError(t, exe.Execute(trx, td.sandbox))
- assert.Error(t, exe.Execute(trx, td.sandbox), "Execute again, should fail")
+ err := exe.Execute(trx, td.sandbox)
+ assert.NoError(t, err)
+ err = exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInvalidSequence, "Execute again, should fail")
})
t.Run("Should fail, can't withdraw empty stake", func(t *testing.T) {
- trx := tx.NewWithdrawTx(td.stamp500000, val.Sequence()+1, val.Address(), addr,
+ trx := tx.NewWithdrawTx(td.randStamp, val.Sequence()+2, val.Address(), addr,
1, fee, "can't withdraw empty stake")
- assert.Error(t, exe.Execute(trx, td.sandbox))
+ err := exe.Execute(trx, td.sandbox)
+ assert.Equal(t, errors.Code(err), errors.ErrInsufficientFunds)
})
assert.Equal(t, exe.Fee(), fee)
diff --git a/go.mod b/go.mod
index 616ec6d0d..ef122aa09 100644
--- a/go.mod
+++ b/go.mod
@@ -7,9 +7,9 @@ require (
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
- github.com/gotk3/gotk3 v0.6.1
+ github.com/gotk3/gotk3 v0.6.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0
- github.com/hashicorp/golang-lru v0.6.0
+ github.com/hashicorp/golang-lru/v2 v2.0.2
github.com/jawher/mow.cli v1.2.0
github.com/kilic/bls12-381 v0.1.0
github.com/libp2p/go-libp2p v0.27.3
@@ -20,12 +20,13 @@ require (
github.com/pelletier/go-toml v1.9.5
github.com/pkg/errors v0.9.1
github.com/rakyll/statik v0.1.7
- github.com/sirupsen/logrus v1.9.0
+ github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.2
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
github.com/tyler-smith/go-bip39 v1.1.0
go.nanomsg.org/mangos/v3 v3.4.2
golang.org/x/crypto v0.7.0
+ golang.org/x/exp v0.0.0-20230321023759-10a507213a29
google.golang.org/grpc v1.53.0
google.golang.org/protobuf v1.30.0
)
@@ -59,8 +60,9 @@ require (
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
- github.com/hashicorp/golang-lru/v2 v2.0.2 // indirect
+ github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/huin/goupnp v1.1.0 // indirect
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/ipfs/boxo v0.8.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-datastore v0.6.0 // indirect
@@ -87,6 +89,7 @@ require (
github.com/libp2p/go-yamux/v4 v4.0.0 // indirect
github.com/libp2p/zeroconf/v2 v2.2.0 // indirect
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
+ github.com/mattn/go-colorable v0.1.12 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.53 // indirect
@@ -109,7 +112,7 @@ require (
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polydawn/refmt v0.89.0 // indirect
- github.com/prometheus/client_golang v1.14.0 // indirect
+ github.com/prometheus/client_golang v1.14.0
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
@@ -119,8 +122,10 @@ require (
github.com/quic-go/quic-go v0.33.0 // indirect
github.com/quic-go/webtransport-go v0.5.2 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
+ github.com/rs/zerolog v1.30.0
github.com/smartystreets/assertions v1.13.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.opencensus.io v0.24.0 // indirect
@@ -131,7 +136,6 @@ require (
go.uber.org/fx v1.19.2 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
- golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/sync v0.1.0 // indirect
diff --git a/go.sum b/go.sum
index 81df646af..3e3c96743 100644
--- a/go.sum
+++ b/go.sum
@@ -43,6 +43,7 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -174,8 +175,8 @@ github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB7
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
-github.com/gotk3/gotk3 v0.6.1 h1:GJ400a0ecEEWrzjBvzBzH+pB/esEMIGdB9zPSmBdoeo=
-github.com/gotk3/gotk3 v0.6.1/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
+github.com/gotk3/gotk3 v0.6.2 h1:sx/PjaKfKULJPTPq8p2kn2ZbcNFxpOJqi4VLzMbEOO8=
+github.com/gotk3/gotk3 v0.6.2/go.mod h1:/hqFpkNa9T3JgNAE2fLvCdov7c5bw//FHNZrZ3Uv9/Q=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
@@ -194,6 +195,8 @@ github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7
github.com/huin/goupnp v1.1.0 h1:gEe0Dp/lZmPZiDFzJJaOfUpOvv2MKUkoBX8lDrn9vKU=
github.com/huin/goupnp v1.1.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/ipfs/boxo v0.8.0 h1:UdjAJmHzQHo/j3g3b1bAcAXCj/GM6iTwvSlBDvPBNBs=
github.com/ipfs/boxo v0.8.0/go.mod h1:RIsi4CnTyQ7AUsNn5gXljJYZlQrHBMnJp94p73liFiA=
github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
@@ -290,6 +293,8 @@ github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYt
github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk=
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU=
+github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
+github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98=
@@ -406,8 +411,12 @@ github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtB
github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
+github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c=
+github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY=
github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM=
@@ -433,8 +442,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
-github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
-github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
github.com/smartystreets/assertions v1.13.0 h1:Dx1kYM01xsSqKPno3aqLnrwac2LetPvN23diwyr69Qs=
github.com/smartystreets/assertions v1.13.0/go.mod h1:wDmR7qL282YbGsPy6H/yAsesrxfxaaSlJazyFLYVFx8=
@@ -444,6 +451,10 @@ github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:Udh
github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA=
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
+github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
@@ -605,9 +616,9 @@ golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210426080607-c94f62235c83/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
diff --git a/network/bootstrap.go b/network/bootstrap.go
index 1c07b14a2..59b6b6865 100644
--- a/network/bootstrap.go
+++ b/network/bootstrap.go
@@ -28,13 +28,13 @@ type bootstrap struct {
dialer lp2pnet.Dialer
routing lp2prouting.Routing
- logger *logger.Logger
+ logger *logger.SubLogger
}
// newBootstrap returns a new Bootstrap that will attempt to keep connected
// to the network by connecting to the given bootstrap peers.
func newBootstrap(ctx context.Context, h lp2phost.Host, d lp2pnet.Dialer, r lp2prouting.Routing,
- conf *BootstrapConfig, logger *logger.Logger) *bootstrap {
+ conf *BootstrapConfig, logger *logger.SubLogger) *bootstrap {
b := &bootstrap{
ctx: ctx,
config: conf,
diff --git a/network/config.go b/network/config.go
index ffd545cac..27e28ea98 100644
--- a/network/config.go
+++ b/network/config.go
@@ -9,14 +9,15 @@ import (
)
type Config struct {
- Name string `toml:"name"`
- Listens []string `toml:"listens"`
- NetworkKey string `toml:"network_key"`
- EnableNAT bool `toml:"enable_nat"`
- EnableRelay bool `toml:"enable_relay"`
- RelayAddrs []string `toml:"relay_addresses"`
- EnableMdns bool `toml:"enable_mdns"`
- Bootstrap *BootstrapConfig `toml:"bootstrap"`
+ Name string `toml:"name"`
+ Listens []string `toml:"listens"`
+ NetworkKey string `toml:"network_key"`
+ EnableNAT bool `toml:"enable_nat"`
+ EnableRelay bool `toml:"enable_relay"`
+ RelayAddrs []string `toml:"relay_addresses"`
+ EnableMdns bool `toml:"enable_mdns"`
+ EnableMetrics bool `toml:"enable_metrics"`
+ Bootstrap *BootstrapConfig `toml:"bootstrap"`
}
// BootstrapConfig holds all configuration options related to bootstrap nodes.
@@ -47,12 +48,13 @@ func DefaultConfig() *Config {
}
return &Config{
- Name: "pactus",
- Listens: []string{"/ip4/0.0.0.0/tcp/21777", "/ip6/::/tcp/21777"},
- NetworkKey: "network_key",
- EnableNAT: true,
- EnableRelay: false,
- EnableMdns: false,
+ Name: "pactus",
+ Listens: []string{"/ip4/0.0.0.0/tcp/21777", "/ip6/::/tcp/21777"},
+ NetworkKey: "network_key",
+ EnableNAT: true,
+ EnableRelay: false,
+ EnableMdns: false,
+ EnableMetrics: false,
Bootstrap: &BootstrapConfig{
Addresses: addresses,
MinThreshold: 8,
diff --git a/network/dht.go b/network/dht.go
index 03e61a5a6..1d2a2a95e 100644
--- a/network/dht.go
+++ b/network/dht.go
@@ -14,11 +14,11 @@ type dhtService struct {
host lp2phost.Host
kademlia *lp2pdht.IpfsDHT
bootstrap *bootstrap
- logger *logger.Logger
+ logger *logger.SubLogger
}
func newDHTService(ctx context.Context, host lp2phost.Host, protocolID lp2pcore.ProtocolID,
- conf *BootstrapConfig, logger *logger.Logger) *dhtService {
+ conf *BootstrapConfig, logger *logger.SubLogger) *dhtService {
opts := []lp2pdht.Option{
lp2pdht.Mode(lp2pdht.ModeAuto),
lp2pdht.ProtocolPrefix(protocolID),
diff --git a/network/gossip.go b/network/gossip.go
index 95afe1dd2..5b05669ad 100644
--- a/network/gossip.go
+++ b/network/gossip.go
@@ -18,11 +18,11 @@ type gossipService struct {
topics []*lp2pps.Topic
subs []*lp2pps.Subscription
eventCh chan Event
- logger *logger.Logger
+ logger *logger.SubLogger
}
func newGossipService(ctx context.Context, host lp2phost.Host, eventCh chan Event,
- logger *logger.Logger) *gossipService {
+ logger *logger.SubLogger) *gossipService {
pubsub, err := lp2pps.NewGossipSub(ctx, host)
if err != nil {
logger.Panic("unable to start Gossip service", "err", err)
diff --git a/network/mdns.go b/network/mdns.go
index 8ae63d9b8..8070e3dac 100644
--- a/network/mdns.go
+++ b/network/mdns.go
@@ -15,12 +15,12 @@ type mdnsService struct {
ctx context.Context
host lp2phost.Host
service lp2pmdns.Service
- logger *logger.Logger
+ logger *logger.SubLogger
}
// newMdnsService creates an mDNS discovery service and attaches it to the libp2p Host.
// This lets us automatically discover peers on the same LAN and connect to them.
-func newMdnsService(ctx context.Context, host lp2phost.Host, logger *logger.Logger) *mdnsService {
+func newMdnsService(ctx context.Context, host lp2phost.Host, logger *logger.SubLogger) *mdnsService {
mdns := &mdnsService{
ctx: ctx,
host: host,
diff --git a/network/network.go b/network/network.go
index 31233e1f5..e3cb114e3 100644
--- a/network/network.go
+++ b/network/network.go
@@ -11,11 +11,14 @@ import (
lp2pcrypto "github.com/libp2p/go-libp2p/core/crypto"
lp2phost "github.com/libp2p/go-libp2p/core/host"
lp2ppeer "github.com/libp2p/go-libp2p/core/peer"
+ rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
+ rcmgrObs "github.com/libp2p/go-libp2p/p2p/host/resource-manager/obs"
ma "github.com/multiformats/go-multiaddr"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/errors"
"github.com/pactus-project/pactus/util/logger"
"github.com/pactus-project/pactus/version"
+ "github.com/prometheus/client_golang/prometheus"
)
var _ Network = &network{}
@@ -36,7 +39,7 @@ type network struct {
generalTopic *lp2pps.Topic
consensusTopic *lp2pps.Topic
eventChannel chan Event
- logger *logger.Logger
+ logger *logger.SubLogger
}
func loadOrCreateKey(path string) (lp2pcrypto.PrivKey, error) {
@@ -81,12 +84,35 @@ func newNetwork(conf *Config, opts []lp2p.Option) (*network, error) {
return nil, errors.Errorf(errors.ErrNetwork, err.Error())
}
+ if conf.EnableMetrics {
+ rcmgrObs.MustRegisterWith(prometheus.DefaultRegisterer)
+ }
+
+ str, err := rcmgrObs.NewStatsTraceReporter()
+ if err != nil {
+ return nil, errors.Errorf(errors.ErrNetwork, err.Error())
+ }
+
+ rmgr, err := rcmgr.NewResourceManager(
+ rcmgr.NewFixedLimiter(rcmgr.DefaultLimits.AutoScale()),
+ rcmgr.WithTraceReporter(str),
+ )
+
+ if err != nil {
+ return nil, errors.Errorf(errors.ErrNetwork, err.Error())
+ }
+
opts = append(opts,
lp2p.Identity(networkKey),
lp2p.ListenAddrStrings(conf.Listens...),
lp2p.UserAgent(version.Agent()),
+ lp2p.ResourceManager(rmgr),
)
+ if !conf.EnableMetrics {
+ opts = append(opts, lp2p.DisableMetrics())
+ }
+
if conf.EnableNAT {
opts = append(opts,
lp2p.EnableNATService(),
@@ -133,7 +159,7 @@ func newNetwork(conf *Config, opts []lp2p.Option) (*network, error) {
eventChannel: make(chan Event, 100),
}
- n.logger = logger.NewLogger("_network", n)
+ n.logger = logger.NewSubLogger("_network", n)
if conf.EnableMdns {
n.mdns = newMdnsService(ctx, n.host, n.logger)
@@ -265,7 +291,7 @@ func (n *network) CloseConnection(pid lp2ppeer.ID) {
}
}
-func (n *network) Fingerprint() string {
+func (n *network) String() string {
return fmt.Sprintf("{%d}", n.NumConnectedPeers())
}
diff --git a/network/stream.go b/network/stream.go
index 8e2499ef8..381adea74 100644
--- a/network/stream.go
+++ b/network/stream.go
@@ -19,12 +19,12 @@ type streamService struct {
protocolID lp2pcore.ProtocolID
relayAddrs []ma.Multiaddr
eventCh chan Event
- logger *logger.Logger
+ logger *logger.SubLogger
}
func newStreamService(ctx context.Context, host lp2phost.Host,
protocolID lp2pcore.ProtocolID, relayAddrs []ma.Multiaddr,
- eventCh chan Event, logger *logger.Logger) *streamService {
+ eventCh chan Event, logger *logger.SubLogger) *streamService {
s := &streamService{
ctx: ctx,
host: host,
diff --git a/node/node.go b/node/node.go
index db3c3b752..6e6891203 100644
--- a/node/node.go
+++ b/node/node.go
@@ -40,9 +40,9 @@ type Node struct {
func NewNode(genDoc *genesis.Genesis, conf *config.Config,
signers []crypto.Signer, rewardAddrs []crypto.Address) (*Node, error) {
// Initialize the logger
- logger.InitLogger(conf.Logger)
+ logger.InitGlobalLogger(conf.Logger)
- logger.Info("You are running a pactus block chain",
+ logger.Info("You are running a Pactus blockchain",
"version", version.Version(),
"network", genDoc.ChainType())
diff --git a/sandbox/interface.go b/sandbox/interface.go
index 2567f49cd..0e9c9079f 100644
--- a/sandbox/interface.go
+++ b/sandbox/interface.go
@@ -20,6 +20,8 @@ type Sandbox interface {
Validator(crypto.Address) *validator.Validator
MakeNewValidator(*bls.PublicKey) *validator.Validator
UpdateValidator(*validator.Validator)
+ JoinedToCommittee(crypto.Address)
+ IsJoinedCommittee(crypto.Address) bool
UpdatePowerDelta(delta int64)
PowerDelta() int64
@@ -30,6 +32,6 @@ type Sandbox interface {
Params() param.Params
CurrentHeight() uint32
- IterateAccounts(consumer func(addr crypto.Address, acc *account.Account, updated bool))
- IterateValidators(consumer func(val *validator.Validator, updated bool))
+ IterateAccounts(consumer func(crypto.Address, *account.Account, bool))
+ IterateValidators(consumer func(*validator.Validator, bool, bool))
}
diff --git a/sandbox/mock.go b/sandbox/mock.go
index 6a9f61dc8..ac3536739 100644
--- a/sandbox/mock.go
+++ b/sandbox/mock.go
@@ -25,6 +25,7 @@ type MockSandbox struct {
TestCommittee committee.Committee
TestCommitteeSigners []crypto.Signer
TestAcceptSortition bool
+ TestJoinedValidators map[crypto.Address]bool
TestPowerDelta int64
}
@@ -37,6 +38,7 @@ func MockingSandbox(ts *testsuite.TestSuite) *MockSandbox {
TestStore: store.MockingStore(ts),
TestCommittee: committee,
TestCommitteeSigners: signers,
+ TestJoinedValidators: make(map[crypto.Address]bool),
}
treasuryAmt := int64(21000000 * 1e9)
@@ -71,6 +73,12 @@ func (m *MockSandbox) Validator(addr crypto.Address) *validator.Validator {
val, _ := m.TestStore.Validator(addr)
return val
}
+func (m *MockSandbox) JoinedToCommittee(addr crypto.Address) {
+ m.TestJoinedValidators[addr] = true
+}
+func (m *MockSandbox) IsJoinedCommittee(addr crypto.Address) bool {
+ return m.TestJoinedValidators[addr]
+}
func (m *MockSandbox) MakeNewValidator(pub *bls.PublicKey) *validator.Validator {
return validator.NewValidator(pub, m.TestStore.TotalValidators())
}
@@ -92,9 +100,9 @@ func (m *MockSandbox) IterateAccounts(consumer func(crypto.Address, *account.Acc
return false
})
}
-func (m *MockSandbox) IterateValidators(consumer func(*validator.Validator, bool)) {
+func (m *MockSandbox) IterateValidators(consumer func(*validator.Validator, bool, bool)) {
m.TestStore.IterateValidators(func(val *validator.Validator) bool {
- consumer(val, true)
+ consumer(val, true, m.TestJoinedValidators[val.Address()])
return false
})
}
diff --git a/sandbox/sandbox.go b/sandbox/sandbox.go
index 87c475bd0..bb7d8d973 100644
--- a/sandbox/sandbox.go
+++ b/sandbox/sandbox.go
@@ -35,6 +35,7 @@ type sandbox struct {
type sandboxValidator struct {
validator *validator.Validator
updated bool
+ joined bool // Is joined committee
}
type sandboxAccount struct {
@@ -61,19 +62,20 @@ func NewSandbox(store store.Reader, params param.Params,
func (sb *sandbox) shouldPanicForDuplicatedAddress() {
//
- // Why we should panic here?
+ // Why is it necessary to panic here?
//
- // Try to make a new item which already exists in store.
+ // An attempt is made to create a new item that already exists in the store.
//
logger.Panic("duplicated address")
}
func (sb *sandbox) shouldPanicForUnknownAddress() {
//
- // Why we should panic here?
+ // Why is it necessary to panic here?
//
- // We only update accounts or validators which we have them inside the sandbox.
- // We must either make a new one (i.e. `MakeNewAccount`) or get it from store (i.e. `Account`) in advance.
+ // We only update accounts or validators that are already present within the sandbox.
+ // This can be achieved either by creating a new account using MakeNewAccount or
+ // retrieving it from the store using Account.
//
logger.Panic("unknown address")
}
@@ -149,6 +151,29 @@ func (sb *sandbox) Validator(addr crypto.Address) *validator.Validator {
return val.Clone()
}
+func (sb *sandbox) JoinedToCommittee(addr crypto.Address) {
+ sb.lk.Lock()
+ defer sb.lk.Unlock()
+
+ s, ok := sb.validators[addr]
+ if !ok {
+ sb.shouldPanicForUnknownAddress()
+ }
+
+ s.joined = true
+}
+
+func (sb *sandbox) IsJoinedCommittee(addr crypto.Address) bool {
+ sb.lk.Lock()
+ defer sb.lk.Unlock()
+
+ s, ok := sb.validators[addr]
+ if ok {
+ return s.joined
+ }
+ return false
+}
+
func (sb *sandbox) MakeNewValidator(pub *bls.PublicKey) *validator.Validator {
sb.lk.Lock()
defer sb.lk.Unlock()
@@ -201,7 +226,8 @@ func (sb *sandbox) currentHeight() uint32 {
return h + 1
}
-func (sb *sandbox) IterateAccounts(consumer func(crypto.Address, *account.Account, bool)) {
+func (sb *sandbox) IterateAccounts(
+ consumer func(crypto.Address, *account.Account, bool)) {
sb.lk.RLock()
defer sb.lk.RUnlock()
@@ -210,12 +236,13 @@ func (sb *sandbox) IterateAccounts(consumer func(crypto.Address, *account.Accoun
}
}
-func (sb *sandbox) IterateValidators(consumer func(*validator.Validator, bool)) {
+func (sb *sandbox) IterateValidators(
+ consumer func(*validator.Validator, bool, bool)) {
sb.lk.RLock()
defer sb.lk.RUnlock()
for _, sv := range sb.validators {
- consumer(sv.validator, sv.updated)
+ consumer(sv.validator, sv.updated, sv.joined)
}
}
diff --git a/sandbox/sandbox_test.go b/sandbox/sandbox_test.go
index 77ccfcd88..afb802a97 100644
--- a/sandbox/sandbox_test.go
+++ b/sandbox/sandbox_test.go
@@ -151,7 +151,7 @@ func TestValidatorChange(t *testing.T) {
invAddr := td.RandomAddress()
assert.Nil(t, td.sandbox.Validator(invAddr))
- td.sandbox.IterateValidators(func(_ *validator.Validator, _ bool) {
+ td.sandbox.IterateValidators(func(_ *validator.Validator, _ bool, _ bool) {
panic("should be empty")
})
})
@@ -192,8 +192,9 @@ func TestValidatorChange(t *testing.T) {
})
t.Run("Should be iterated", func(t *testing.T) {
- td.sandbox.IterateValidators(func(val *validator.Validator, updated bool) {
+ td.sandbox.IterateValidators(func(val *validator.Validator, updated bool, joined bool) {
assert.True(t, updated)
+ assert.False(t, joined)
assert.Equal(t, val.Stake(), stk+2)
})
})
@@ -211,9 +212,10 @@ func TestValidatorChange(t *testing.T) {
assert.Equal(t, val, sbVal)
t.Run("Should be iterated", func(t *testing.T) {
- td.sandbox.IterateValidators(func(val *validator.Validator, updated bool) {
+ td.sandbox.IterateValidators(func(val *validator.Validator, updated bool, joined bool) {
if val.PublicKey() == pub {
assert.True(t, updated)
+ assert.False(t, joined)
assert.Equal(t, val.Stake(), int64(1))
}
})
diff --git a/state/facade.go b/state/facade.go
index 704e12151..7b66e646f 100644
--- a/state/facade.go
+++ b/state/facade.go
@@ -11,6 +11,7 @@ import (
"github.com/pactus-project/pactus/types/block"
"github.com/pactus-project/pactus/types/param"
"github.com/pactus-project/pactus/types/tx"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/types/validator"
)
@@ -48,5 +49,5 @@ type Facade interface {
ValidatorAddresses() []crypto.Address
Params() param.Params
Close() error
- Fingerprint() string
+ CalculateFee(amount int64, payloadType payload.Type) (int64, error)
}
diff --git a/state/lastinfo/last_info_test.go b/state/lastinfo/last_info_test.go
index 7fc5eb36e..e495c271f 100644
--- a/state/lastinfo/last_info_test.go
+++ b/state/lastinfo/last_info_test.go
@@ -50,11 +50,11 @@ func setup(t *testing.T) *testData {
val3.AddToStake(100)
val4.AddToStake(100)
- val0.UpdateLastJoinedHeight(0)
- val1.UpdateLastJoinedHeight(0)
- val2.UpdateLastJoinedHeight(0)
- val3.UpdateLastJoinedHeight(0)
- val4.UpdateLastJoinedHeight(100)
+ val0.UpdateLastSortitionHeight(0)
+ val1.UpdateLastSortitionHeight(0)
+ val2.UpdateLastSortitionHeight(0)
+ val3.UpdateLastSortitionHeight(0)
+ val4.UpdateLastSortitionHeight(100)
store.UpdateValidator(val0)
store.UpdateValidator(val1)
diff --git a/state/mock.go b/state/mock.go
index 010b6240b..292e0f32f 100644
--- a/state/mock.go
+++ b/state/mock.go
@@ -15,6 +15,7 @@ import (
"github.com/pactus-project/pactus/types/block"
"github.com/pactus-project/pactus/types/param"
"github.com/pactus-project/pactus/types/tx"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/types/validator"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/errors"
@@ -87,9 +88,7 @@ func (m *MockState) UpdateLastCertificate(cert *block.Certificate) error {
m.TestStore.LastCert = cert
return nil
}
-func (m *MockState) Fingerprint() string {
- return ""
-}
+
func (m *MockState) CommitBlock(h uint32, b *block.Block, cert *block.Certificate) error {
m.lk.Lock()
defer m.lk.Unlock()
@@ -209,3 +208,23 @@ func (m *MockState) AddPendingTxAndBroadcast(trx *tx.Tx) error {
func (m *MockState) Params() param.Params {
return m.TestParams
}
+
+func (m *MockState) CalculateFee(_ int64, payloadType payload.Type) (int64, error) {
+ switch payloadType {
+ case payload.PayloadTypeTransfer,
+ payload.PayloadTypeBond,
+ payload.PayloadTypeWithdraw:
+ {
+ return m.ts.RandInt64(1e9), nil
+ }
+
+ case payload.PayloadTypeUnbond,
+ payload.PayloadTypeSortition:
+ {
+ return 0, nil
+ }
+
+ default:
+ return 0, errors.Errorf(errors.ErrInvalidTx, "unexpected tx type: %v", payloadType)
+ }
+}
diff --git a/state/state.go b/state/state.go
index 9336f039e..a764177d0 100644
--- a/state/state.go
+++ b/state/state.go
@@ -19,6 +19,7 @@ import (
"github.com/pactus-project/pactus/types/block"
"github.com/pactus-project/pactus/types/param"
"github.com/pactus-project/pactus/types/tx"
+ "github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/types/validator"
"github.com/pactus-project/pactus/util"
"github.com/pactus-project/pactus/util/errors"
@@ -41,7 +42,7 @@ type state struct {
lastInfo *lastinfo.LastInfo
accountMerkle *persistentmerkle.Tree
validatorMerkle *persistentmerkle.Tree
- logger *logger.Logger
+ logger *logger.SubLogger
eventCh chan event.Event
}
@@ -61,7 +62,7 @@ func LoadOrNewState(
validatorMerkle: persistentmerkle.New(),
eventCh: eventCh,
}
- st.logger = logger.NewLogger("_state", st)
+ st.logger = logger.NewSubLogger("_state", st)
st.store = store
// The first account is Treasury Account at the genesis time.
@@ -85,7 +86,7 @@ func LoadOrNewState(
txPool.SetNewSandboxAndRecheck(st.concreteSandbox())
- st.logger.Debug("last info", "committers", st.committee.Committers(), "state_root", st.stateRoot().Fingerprint())
+ st.logger.Debug("last info", "committers", st.committee.Committers(), "state_root", st.stateRoot().ShortString())
return st, nil
}
@@ -496,24 +497,23 @@ func (st *state) evaluateSortition() bool {
return evaluated
}
-func (st *state) Fingerprint() string {
+func (st *state) String() string {
return fmt.Sprintf("{#%d ⌘ %v 🕣 %v}",
st.lastInfo.BlockHeight(),
- st.lastInfo.BlockHash().Fingerprint(),
+ st.lastInfo.BlockHash().ShortString(),
st.lastInfo.BlockTime().Format("15.04.05"))
}
func (st *state) commitSandbox(sb sandbox.Sandbox, round int16) {
- joined := make([]*validator.Validator, 0)
- currentHeight := sb.CurrentHeight()
- sb.IterateValidators(func(val *validator.Validator, updated bool) {
- if val.LastJoinedHeight() == currentHeight {
+ joiningCommittee := make([]*validator.Validator, 0)
+ sb.IterateValidators(func(val *validator.Validator, _ bool, joined bool) {
+ if joined {
st.logger.Info("new validator joined", "address", val.Address(), "power", val.Power())
- joined = append(joined, val)
+ joiningCommittee = append(joiningCommittee, val)
}
})
- st.committee.Update(round, joined)
+ st.committee.Update(round, joiningCommittee)
sb.IterateAccounts(func(addr crypto.Address, acc *account.Account, updated bool) {
if updated {
@@ -522,7 +522,7 @@ func (st *state) commitSandbox(sb sandbox.Sandbox, round int16) {
}
})
- sb.IterateValidators(func(val *validator.Validator, updated bool) {
+ sb.IterateValidators(func(val *validator.Validator, updated bool, _ bool) {
if updated {
st.store.UpdateValidator(val)
st.validatorMerkle.SetHash(int(val.Number()), val.Hash())
@@ -703,3 +703,23 @@ func (st *state) publishEvents(height uint32, block *block.Block) {
st.eventCh <- TxEvent
}
}
+
+func (st *state) CalculateFee(amount int64, payloadType payload.Type) (int64, error) {
+ switch payloadType {
+ case payload.PayloadTypeTransfer,
+ payload.PayloadTypeBond,
+ payload.PayloadTypeWithdraw:
+ {
+ return execution.CalculateFee(amount, st.params), nil
+ }
+
+ case payload.PayloadTypeUnbond,
+ payload.PayloadTypeSortition:
+ {
+ return 0, nil
+ }
+
+ default:
+ return 0, errors.Errorf(errors.ErrInvalidTx, "unexpected tx type: %v", payloadType)
+ }
+}
diff --git a/state/state_test.go b/state/state_test.go
index f96a09c7e..9bdd6da91 100644
--- a/state/state_test.go
+++ b/state/state_test.go
@@ -18,6 +18,7 @@ import (
"github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/types/validator"
"github.com/pactus-project/pactus/util"
+ "github.com/pactus-project/pactus/util/errors"
"github.com/pactus-project/pactus/util/testsuite"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -151,7 +152,7 @@ func (td *testData) makeCertificateAndSign(t *testing.T, blockHash hash.Hash, ro
}
absentees := util.Subtracts(committers, signedBy)
- return block.NewCertificate(round, committers, absentees, bls.Aggregate(sigs))
+ return block.NewCertificate(round, committers, absentees, bls.SignatureAggregate(sigs))
}
func (td *testData) commitBlockForAllStates(t *testing.T, b *block.Block, c *block.Certificate) {
@@ -449,7 +450,7 @@ func TestSortition(t *testing.T) {
sigs[1] = td.valSigner3.SignData(sb).(*bls.Signature)
sigs[2] = td.valSigner4.SignData(sb).(*bls.Signature)
sigs[3] = signer.SignData(sb).(*bls.Signature)
- c14 := block.NewCertificate(3, []int32{4, 0, 1, 2, 3}, []int32{0}, bls.Aggregate(sigs))
+ c14 := block.NewCertificate(3, []int32{4, 0, 1, 2, 3}, []int32{0}, bls.SignatureAggregate(sigs))
height++
assert.NoError(t, st1.CommitBlock(height, b14, c14))
@@ -728,3 +729,37 @@ func TestCommittingInvalidBlock(t *testing.T) {
// It is possible that the same block would be considered valid by td.state2.
assert.Error(t, td.state1.CommitBlock(2, b, c))
}
+
+func TestCalcFee(t *testing.T) {
+ td := setup(t)
+ tests := []struct {
+ amount int64
+ pldType payload.Type
+ fee int64
+ expectedFee int64
+ expectedErrCode int
+ }{
+ {1, payload.PayloadTypeTransfer, 1, td.state1.params.MinimumFee, errors.ErrInvalidFee},
+ {1, payload.PayloadTypeWithdraw, 1001, td.state1.params.MinimumFee, errors.ErrInvalidFee},
+ {1, payload.PayloadTypeBond, 1000, td.state1.params.MinimumFee, errors.ErrNone},
+
+ {1 * 1e9, payload.PayloadTypeTransfer, 1, 100000, errors.ErrInvalidFee},
+ {1 * 1e9, payload.PayloadTypeWithdraw, 100001, 100000, errors.ErrInvalidFee},
+ {1 * 1e9, payload.PayloadTypeBond, 100000, 100000, errors.ErrNone},
+
+ {1 * 1e12, payload.PayloadTypeTransfer, 1, 1000000, errors.ErrInvalidFee},
+ {1 * 1e12, payload.PayloadTypeWithdraw, 1000001, 1000000, errors.ErrInvalidFee},
+ {1 * 1e12, payload.PayloadTypeBond, 1000000, 1000000, errors.ErrNone},
+
+ {1 * 1e12, payload.PayloadTypeSortition, 0, 0, errors.ErrInvalidFee},
+ {1 * 1e12, payload.PayloadTypeUnbond, 0, 0, errors.ErrNone},
+ }
+ for _, test := range tests {
+ fee, err := td.state2.CalculateFee(test.amount, test.pldType)
+ assert.NoError(t, err)
+ assert.Equal(t, test.expectedFee, fee)
+
+ _, err = td.state2.CalculateFee(test.amount, 6)
+ assert.Error(t, err)
+ }
+}
diff --git a/state/validation_test.go b/state/validation_test.go
index 68f317eb8..f2e28cf4f 100644
--- a/state/validation_test.go
+++ b/state/validation_test.go
@@ -16,7 +16,7 @@ func aggregate(sigs []crypto.Signature) *bls.Signature {
for i, s := range sigs {
blsSigs[i] = s.(*bls.Signature)
}
- return bls.Aggregate(blsSigs)
+ return bls.SignatureAggregate(blsSigs)
}
func TestCertificateValidation(t *testing.T) {
diff --git a/sync/bundle/bundle.go b/sync/bundle/bundle.go
index 7e4e30492..f7e3ec080 100644
--- a/sync/bundle/bundle.go
+++ b/sync/bundle/bundle.go
@@ -44,8 +44,8 @@ func (b *Bundle) SanityCheck() error {
return nil
}
-func (b *Bundle) Fingerprint() string {
- return fmt.Sprintf("%s%s", b.Message.Type(), b.Message.Fingerprint())
+func (b *Bundle) String() string {
+ return fmt.Sprintf("%s%s", b.Message.Type(), b.Message.String())
}
func (b *Bundle) CompressIt() {
diff --git a/sync/bundle/bundle_test.go b/sync/bundle/bundle_test.go
index c156a84de..c238e3b40 100644
--- a/sync/bundle/bundle_test.go
+++ b/sync/bundle/bundle_test.go
@@ -39,7 +39,8 @@ func TestMessageCompress(t *testing.T) {
d, _ := b.Bytes()
blocksData = append(blocksData, d)
}
- msg := message.NewBlocksResponseMessage(message.ResponseCodeBusy, 1234, 888, blocksData, nil)
+ msg := message.NewBlocksResponseMessage(message.ResponseCodeOK, message.ResponseCodeOK.String(),
+ 1234, 888, blocksData, nil)
bdl := NewBundle(ts.RandomPeerID(), msg)
bs0, err := bdl.Encode()
assert.NoError(t, err)
diff --git a/sync/bundle/message/block_announce.go b/sync/bundle/message/block_announce.go
index 26d5f7e1b..1addd78c5 100644
--- a/sync/bundle/message/block_announce.go
+++ b/sync/bundle/message/block_announce.go
@@ -28,9 +28,9 @@ func (m *BlockAnnounceMessage) SanityCheck() error {
}
func (m *BlockAnnounceMessage) Type() Type {
- return MessageTypeBlockAnnounce
+ return TypeBlockAnnounce
}
-func (m *BlockAnnounceMessage) Fingerprint() string {
- return fmt.Sprintf("{⌘ %d %v}", m.Height, m.Block.Hash().Fingerprint())
+func (m *BlockAnnounceMessage) String() string {
+ return fmt.Sprintf("{⌘ %d %v}", m.Height, m.Block.Hash().ShortString())
}
diff --git a/sync/bundle/message/block_announce_test.go b/sync/bundle/message/block_announce_test.go
index 961a66268..351e17dbd 100644
--- a/sync/bundle/message/block_announce_test.go
+++ b/sync/bundle/message/block_announce_test.go
@@ -11,7 +11,7 @@ import (
func TestBlockAnnounceType(t *testing.T) {
m := &BlockAnnounceMessage{}
- assert.Equal(t, m.Type(), MessageTypeBlockAnnounce)
+ assert.Equal(t, m.Type(), TypeBlockAnnounce)
}
func TestBlockAnnounceMessage(t *testing.T) {
@@ -31,6 +31,6 @@ func TestBlockAnnounceMessage(t *testing.T) {
m := NewBlockAnnounceMessage(100, b, c)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/blocks_request.go b/sync/bundle/message/blocks_request.go
index be87fcfb2..59ca3e69e 100644
--- a/sync/bundle/message/blocks_request.go
+++ b/sync/bundle/message/blocks_request.go
@@ -35,9 +35,9 @@ func (m *BlocksRequestMessage) SanityCheck() error {
}
func (m *BlocksRequestMessage) Type() Type {
- return MessageTypeBlocksRequest
+ return TypeBlocksRequest
}
-func (m *BlocksRequestMessage) Fingerprint() string {
+func (m *BlocksRequestMessage) String() string {
return fmt.Sprintf("{⚓ %d %v:%v}", m.SessionID, m.From, m.To())
}
diff --git a/sync/bundle/message/blocks_request_test.go b/sync/bundle/message/blocks_request_test.go
index 94160d2b5..7bcfbc144 100644
--- a/sync/bundle/message/blocks_request_test.go
+++ b/sync/bundle/message/blocks_request_test.go
@@ -9,7 +9,7 @@ import (
func TestLatestBlocksRequestType(t *testing.T) {
m := &BlocksRequestMessage{}
- assert.Equal(t, m.Type(), MessageTypeBlocksRequest)
+ assert.Equal(t, m.Type(), TypeBlocksRequest)
}
func TestBlocksRequestMessage(t *testing.T) {
@@ -29,6 +29,6 @@ func TestBlocksRequestMessage(t *testing.T) {
assert.NoError(t, m.SanityCheck())
assert.Equal(t, m.To(), uint32(106))
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/blocks_response.go b/sync/bundle/message/blocks_response.go
index 80b87816d..3040877c6 100644
--- a/sync/bundle/message/blocks_response.go
+++ b/sync/bundle/message/blocks_response.go
@@ -16,9 +16,10 @@ type BlocksResponseMessage struct {
From uint32 `cbor:"3,keyasint"`
BlocksData [][]byte `cbor:"4,keyasint"`
LastCertificate *block.Certificate `cbor:"6,keyasint"`
+ Reason string `cbor:"7,keyasint"`
}
-func NewBlocksResponseMessage(code ResponseCode, sid int, from uint32,
+func NewBlocksResponseMessage(code ResponseCode, reason string, sid int, from uint32,
blocksData [][]byte, lastCert *block.Certificate) *BlocksResponseMessage {
return &BlocksResponseMessage{
ResponseCode: code,
@@ -26,6 +27,7 @@ func NewBlocksResponseMessage(code ResponseCode, sid int, from uint32,
From: from,
BlocksData: blocksData,
LastCertificate: lastCert,
+ Reason: reason,
}
}
func (m *BlocksResponseMessage) SanityCheck() error {
@@ -42,7 +44,7 @@ func (m *BlocksResponseMessage) SanityCheck() error {
}
func (m *BlocksResponseMessage) Type() Type {
- return MessageTypeBlocksResponse
+ return TypeBlocksResponse
}
func (m *BlocksResponseMessage) Count() uint32 {
@@ -64,15 +66,10 @@ func (m *BlocksResponseMessage) LastCertificateHeight() uint32 {
return 0
}
-func (m *BlocksResponseMessage) Fingerprint() string {
+func (m *BlocksResponseMessage) String() string {
return fmt.Sprintf("{⚓ %d %s %v-%v}", m.SessionID, m.ResponseCode, m.From, m.To())
}
func (m *BlocksResponseMessage) IsRequestRejected() bool {
- if m.ResponseCode == ResponseCodeBusy ||
- m.ResponseCode == ResponseCodeRejected {
- return true
- }
-
- return false
+ return m.ResponseCode == ResponseCodeRejected
}
diff --git a/sync/bundle/message/blocks_response_test.go b/sync/bundle/message/blocks_response_test.go
index a510fd693..b1d6eaf09 100644
--- a/sync/bundle/message/blocks_response_test.go
+++ b/sync/bundle/message/blocks_response_test.go
@@ -11,7 +11,7 @@ import (
func TestLatestBlocksResponseType(t *testing.T) {
m := &BlocksResponseMessage{}
- assert.Equal(t, m.Type(), MessageTypeBlocksResponse)
+ assert.Equal(t, m.Type(), TypeBlocksResponse)
}
func TestBlocksResponseMessage(t *testing.T) {
@@ -22,17 +22,19 @@ func TestBlocksResponseMessage(t *testing.T) {
b := ts.GenerateTestBlock(nil, nil)
c := block.NewCertificate(-1, nil, nil, nil)
d, _ := b.Bytes()
- m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, sid, 100, [][]byte{d}, c)
+ m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, ResponseCodeMoreBlocks.String(), sid, 100, [][]byte{d}, c)
assert.Equal(t, errors.Code(m.SanityCheck()), errors.ErrInvalidRound)
+ assert.Equal(t, m.Reason, ResponseCodeMoreBlocks.String())
})
t.Run("Unexpected block for height zero", func(t *testing.T) {
b := ts.GenerateTestBlock(nil, nil)
d, _ := b.Bytes()
- m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, sid, 0, [][]byte{d}, nil)
+ m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, ResponseCodeMoreBlocks.String(), sid, 0, [][]byte{d}, nil)
assert.Equal(t, errors.Code(m.SanityCheck()), errors.ErrInvalidHeight)
+ assert.Equal(t, m.Reason, ResponseCodeMoreBlocks.String())
})
t.Run("OK", func(t *testing.T) {
@@ -40,11 +42,13 @@ func TestBlocksResponseMessage(t *testing.T) {
b2 := ts.GenerateTestBlock(nil, nil)
d1, _ := b1.Bytes()
d2, _ := b2.Bytes()
- m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, sid, 100, [][]byte{d1, d2}, nil)
+ m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, ResponseCodeMoreBlocks.String(), sid, 100,
+ [][]byte{d1, d2}, nil)
assert.NoError(t, m.SanityCheck())
assert.Zero(t, m.LastCertificateHeight())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
+ assert.Equal(t, m.Reason, ResponseCodeMoreBlocks.String())
})
}
@@ -52,23 +56,25 @@ func TestLatestBlocksResponseCode(t *testing.T) {
ts := testsuite.NewTestSuite(t)
t.Run("busy", func(t *testing.T) {
- m := NewBlocksResponseMessage(ResponseCodeBusy, 1, 0, nil, nil)
+ m := NewBlocksResponseMessage(ResponseCodeRejected, ResponseCodeRejected.String(), 1, 0, nil, nil)
assert.NoError(t, m.SanityCheck())
assert.Zero(t, m.From)
assert.Zero(t, m.To())
assert.Zero(t, m.Count())
assert.True(t, m.IsRequestRejected())
+ assert.Equal(t, m.Reason, ResponseCodeRejected.String())
})
t.Run("rejected", func(t *testing.T) {
- m := NewBlocksResponseMessage(ResponseCodeRejected, 1, 0, nil, nil)
+ m := NewBlocksResponseMessage(ResponseCodeRejected, ResponseCodeRejected.String(), 1, 0, nil, nil)
assert.NoError(t, m.SanityCheck())
assert.Zero(t, m.From)
assert.Zero(t, m.To())
assert.Zero(t, m.Count())
assert.True(t, m.IsRequestRejected())
+ assert.Equal(t, m.Reason, ResponseCodeRejected.String())
})
t.Run("OK - MoreBlocks", func(t *testing.T) {
@@ -76,7 +82,7 @@ func TestLatestBlocksResponseCode(t *testing.T) {
b2 := ts.GenerateTestBlock(nil, nil)
d1, _ := b1.Bytes()
d2, _ := b2.Bytes()
- m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, 1, 100, [][]byte{d1, d2}, nil)
+ m := NewBlocksResponseMessage(ResponseCodeMoreBlocks, ResponseCodeMoreBlocks.String(), 1, 100, [][]byte{d1, d2}, nil)
assert.NoError(t, m.SanityCheck())
assert.Equal(t, m.From, uint32(100))
@@ -84,17 +90,19 @@ func TestLatestBlocksResponseCode(t *testing.T) {
assert.Equal(t, m.Count(), uint32(2))
assert.Zero(t, m.LastCertificateHeight())
assert.False(t, m.IsRequestRejected())
+ assert.Equal(t, m.Reason, ResponseCodeMoreBlocks.String())
})
t.Run("OK - Synced", func(t *testing.T) {
cert := ts.GenerateTestCertificate(ts.RandomHash())
- m := NewBlocksResponseMessage(ResponseCodeSynced, 1, 100, nil, cert)
+ m := NewBlocksResponseMessage(ResponseCodeSynced, ResponseCodeSynced.String(), 1, 100, nil, cert)
assert.NoError(t, m.SanityCheck())
assert.Equal(t, m.From, uint32(100))
assert.Zero(t, m.To())
assert.Zero(t, m.Count())
assert.Equal(t, m.LastCertificateHeight(), uint32(100))
assert.False(t, m.IsRequestRejected())
+ assert.Equal(t, m.Reason, ResponseCodeSynced.String())
})
}
diff --git a/sync/bundle/message/heart_beat.go b/sync/bundle/message/heart_beat.go
index 1478f09b2..732adf21c 100644
--- a/sync/bundle/message/heart_beat.go
+++ b/sync/bundle/message/heart_beat.go
@@ -25,16 +25,13 @@ func (m *HeartBeatMessage) SanityCheck() error {
if m.Height == 0 {
return errors.Errorf(errors.ErrInvalidHeight, "invalid height")
}
- if m.Round < 0 {
- return errors.Error(errors.ErrInvalidRound)
- }
return nil
}
func (m *HeartBeatMessage) Type() Type {
- return MessageTypeHeartBeat
+ return TypeHeartBeat
}
-func (m *HeartBeatMessage) Fingerprint() string {
+func (m *HeartBeatMessage) String() string {
return fmt.Sprintf("{%d/%d}", m.Height, m.Round)
}
diff --git a/sync/bundle/message/heart_beat_test.go b/sync/bundle/message/heart_beat_test.go
index 2dd2a81e7..578d04d55 100644
--- a/sync/bundle/message/heart_beat_test.go
+++ b/sync/bundle/message/heart_beat_test.go
@@ -10,7 +10,7 @@ import (
func TestHeartBeatType(t *testing.T) {
m := &HeartBeatMessage{}
- assert.Equal(t, m.Type(), MessageTypeHeartBeat)
+ assert.Equal(t, m.Type(), TypeHeartBeat)
}
func TestHeartBeatMessage(t *testing.T) {
@@ -21,16 +21,11 @@ func TestHeartBeatMessage(t *testing.T) {
assert.Equal(t, errors.Code(m.SanityCheck()), errors.ErrInvalidHeight)
})
- t.Run("Invalid round", func(t *testing.T) {
- m := NewHeartBeatMessage(100, -1, ts.RandomHash())
-
- assert.Equal(t, errors.Code(m.SanityCheck()), errors.ErrInvalidRound)
- })
t.Run("OK", func(t *testing.T) {
m := NewHeartBeatMessage(100, 1, ts.RandomHash())
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/hello.go b/sync/bundle/message/hello.go
index 12570d357..1ee8c0ce0 100644
--- a/sync/bundle/message/hello.go
+++ b/sync/bundle/message/hello.go
@@ -26,15 +26,17 @@ type HelloMessage struct {
Height uint32 `cbor:"6,keyasint"`
Flags int `cbor:"7,keyasint"`
GenesisHash hash.Hash `cbor:"8,keyasint"`
+ BlockHash hash.Hash `cbor:"10,keyasint"`
}
func NewHelloMessage(pid peer.ID, moniker string,
- height uint32, flags int, genesisHash hash.Hash) *HelloMessage {
+ height uint32, flags int, blockHash, genesisHash hash.Hash) *HelloMessage {
return &HelloMessage{
PeerID: pid,
Agent: version.Agent(),
Moniker: moniker,
GenesisHash: genesisHash,
+ BlockHash: blockHash,
Height: height,
Flags: flags,
}
@@ -63,10 +65,10 @@ func (m *HelloMessage) SetPublicKey(pub crypto.PublicKey) {
}
func (m *HelloMessage) Type() Type {
- return MessageTypeHello
+ return TypeHello
}
-func (m *HelloMessage) Fingerprint() string {
+func (m *HelloMessage) String() string {
ack := ""
if util.IsFlagSet(m.Flags, FlagHelloAck) {
ack = " ack"
diff --git a/sync/bundle/message/hello_test.go b/sync/bundle/message/hello_test.go
index d6bc6cc2b..9a539baa5 100644
--- a/sync/bundle/message/hello_test.go
+++ b/sync/bundle/message/hello_test.go
@@ -10,7 +10,7 @@ import (
func TestHelloType(t *testing.T) {
m := &HelloMessage{}
- assert.Equal(t, m.Type(), MessageTypeHello)
+ assert.Equal(t, m.Type(), TypeHello)
}
func TestHelloMessage(t *testing.T) {
@@ -19,7 +19,7 @@ func TestHelloMessage(t *testing.T) {
t.Run("Invalid signature", func(t *testing.T) {
signer1 := ts.RandomSigner()
signer2 := ts.RandomSigner()
- m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash())
+ m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash(), ts.RandomHash())
signer1.SignMsg(m)
m.SetPublicKey(signer2.PublicKey())
@@ -28,7 +28,7 @@ func TestHelloMessage(t *testing.T) {
t.Run("Signature is nil", func(t *testing.T) {
signer := ts.RandomSigner()
- m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash())
+ m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash(), ts.RandomHash())
signer.SignMsg(m)
m.Signature = nil
@@ -37,7 +37,7 @@ func TestHelloMessage(t *testing.T) {
t.Run("PublicKey is nil", func(t *testing.T) {
signer := ts.RandomSigner()
- m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash())
+ m := NewHelloMessage(ts.RandomPeerID(), "Oscar", 100, 0, ts.RandomHash(), ts.RandomHash())
signer.SignMsg(m)
m.PublicKey = nil
@@ -46,10 +46,10 @@ func TestHelloMessage(t *testing.T) {
t.Run("Ok", func(t *testing.T) {
signer := ts.RandomSigner()
- m := NewHelloMessage(ts.RandomPeerID(), "Alice", 100, 0, ts.RandomHash())
+ m := NewHelloMessage(ts.RandomPeerID(), "Alice", 100, 0, ts.RandomHash(), ts.RandomHash())
signer.SignMsg(m)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "Alice")
+ assert.Contains(t, m.String(), "Alice")
})
}
diff --git a/sync/bundle/message/message.go b/sync/bundle/message/message.go
index 093cf0161..17fae77df 100644
--- a/sync/bundle/message/message.go
+++ b/sync/bundle/message/message.go
@@ -12,10 +12,9 @@ const (
ResponseCodeNone = ResponseCode(-1)
ResponseCodeOK = ResponseCode(0)
ResponseCodeRejected = ResponseCode(1)
- ResponseCodeBusy = ResponseCode(2)
- ResponseCodeMoreBlocks = ResponseCode(3)
- ResponseCodeNoMoreBlocks = ResponseCode(4)
- ResponseCodeSynced = ResponseCode(5)
+ ResponseCodeMoreBlocks = ResponseCode(2)
+ ResponseCodeNoMoreBlocks = ResponseCode(3)
+ ResponseCodeSynced = ResponseCode(4)
)
func (c ResponseCode) String() string {
@@ -24,8 +23,6 @@ func (c ResponseCode) String() string {
return "ok"
case ResponseCodeRejected:
return "rejected"
- case ResponseCodeBusy:
- return "busy"
case ResponseCodeMoreBlocks:
return "more-blocks"
case ResponseCodeNoMoreBlocks:
@@ -36,33 +33,34 @@ func (c ResponseCode) String() string {
return fmt.Sprintf("%d", c)
}
-type Type int
+type Type int32
const (
- MessageTypeHello = Type(1)
- MessageTypeHeartBeat = Type(2)
- MessageTypeTransactions = Type(3)
- MessageTypeQueryProposal = Type(4)
- MessageTypeProposal = Type(5)
- MessageTypeQueryVotes = Type(6)
- MessageTypeVote = Type(7)
- MessageTypeBlockAnnounce = Type(8)
- MessageTypeBlocksRequest = Type(9)
- MessageTypeBlocksResponse = Type(10)
+ TypeUnspecified = Type(0)
+ TypeHello = Type(1)
+ TypeHeartBeat = Type(2)
+ TypeTransactions = Type(3)
+ TypeQueryProposal = Type(4)
+ TypeProposal = Type(5)
+ TypeQueryVotes = Type(6)
+ TypeVote = Type(7)
+ TypeBlockAnnounce = Type(8)
+ TypeBlocksRequest = Type(9)
+ TypeBlocksResponse = Type(10)
)
func (t Type) TopicID() network.TopicID {
switch t {
- case MessageTypeHello,
- MessageTypeHeartBeat,
- MessageTypeTransactions,
- MessageTypeBlockAnnounce:
+ case TypeHello,
+ TypeHeartBeat,
+ TypeTransactions,
+ TypeBlockAnnounce:
return network.TopicIDGeneral
- case MessageTypeQueryProposal,
- MessageTypeProposal,
- MessageTypeQueryVotes,
- MessageTypeVote:
+ case TypeQueryProposal,
+ TypeProposal,
+ TypeQueryVotes,
+ TypeVote:
return network.TopicIDConsensus
default:
@@ -72,25 +70,25 @@ func (t Type) TopicID() network.TopicID {
func (t Type) String() string {
switch t {
- case MessageTypeHello:
+ case TypeHello:
return "hello"
- case MessageTypeHeartBeat:
+ case TypeHeartBeat:
return "heart-beat"
- case MessageTypeTransactions:
+ case TypeTransactions:
return "txs"
- case MessageTypeQueryProposal:
+ case TypeQueryProposal:
return "query-proposal"
- case MessageTypeProposal:
+ case TypeProposal:
return "proposal"
- case MessageTypeQueryVotes:
+ case TypeQueryVotes:
return "query-votes"
- case MessageTypeVote:
+ case TypeVote:
return "vote"
- case MessageTypeBlockAnnounce:
+ case TypeBlockAnnounce:
return "block-announce"
- case MessageTypeBlocksRequest:
+ case TypeBlocksRequest:
return "blocks-req"
- case MessageTypeBlocksResponse:
+ case TypeBlocksResponse:
return "blocks-res"
}
return fmt.Sprintf("%d", t)
@@ -98,25 +96,25 @@ func (t Type) String() string {
func MakeMessage(t Type) Message {
switch t {
- case MessageTypeHello:
+ case TypeHello:
return &HelloMessage{}
- case MessageTypeHeartBeat:
+ case TypeHeartBeat:
return &HeartBeatMessage{}
- case MessageTypeTransactions:
+ case TypeTransactions:
return &TransactionsMessage{}
- case MessageTypeQueryProposal:
+ case TypeQueryProposal:
return &QueryProposalMessage{}
- case MessageTypeProposal:
+ case TypeProposal:
return &ProposalMessage{}
- case MessageTypeQueryVotes:
+ case TypeQueryVotes:
return &QueryVotesMessage{}
- case MessageTypeVote:
+ case TypeVote:
return &VoteMessage{}
- case MessageTypeBlockAnnounce:
+ case TypeBlockAnnounce:
return &BlockAnnounceMessage{}
- case MessageTypeBlocksRequest:
+ case TypeBlocksRequest:
return &BlocksRequestMessage{}
- case MessageTypeBlocksResponse:
+ case TypeBlocksResponse:
return &BlocksResponseMessage{}
}
@@ -127,5 +125,5 @@ func MakeMessage(t Type) Message {
type Message interface {
SanityCheck() error
Type() Type
- Fingerprint() string
+ String() string
}
diff --git a/sync/bundle/message/proposal.go b/sync/bundle/message/proposal.go
index 5ec26d11c..f700d1fcf 100644
--- a/sync/bundle/message/proposal.go
+++ b/sync/bundle/message/proposal.go
@@ -19,9 +19,9 @@ func (m *ProposalMessage) SanityCheck() error {
}
func (m *ProposalMessage) Type() Type {
- return MessageTypeProposal
+ return TypeProposal
}
-func (m *ProposalMessage) Fingerprint() string {
- return m.Proposal.Fingerprint()
+func (m *ProposalMessage) String() string {
+ return m.Proposal.String()
}
diff --git a/sync/bundle/message/proposal_test.go b/sync/bundle/message/proposal_test.go
index 272c55786..05a67089a 100644
--- a/sync/bundle/message/proposal_test.go
+++ b/sync/bundle/message/proposal_test.go
@@ -10,7 +10,7 @@ import (
func TestProposalType(t *testing.T) {
m := &ProposalMessage{}
- assert.Equal(t, m.Type(), MessageTypeProposal)
+ assert.Equal(t, m.Type(), TypeProposal)
}
func TestProposalMessage(t *testing.T) {
@@ -28,6 +28,6 @@ func TestProposalMessage(t *testing.T) {
m := NewProposalMessage(proposal)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/query_proposal.go b/sync/bundle/message/query_proposal.go
index d5eea889c..937e2da64 100644
--- a/sync/bundle/message/query_proposal.go
+++ b/sync/bundle/message/query_proposal.go
@@ -27,9 +27,9 @@ func (m *QueryProposalMessage) SanityCheck() error {
}
func (m *QueryProposalMessage) Type() Type {
- return MessageTypeQueryProposal
+ return TypeQueryProposal
}
-func (m *QueryProposalMessage) Fingerprint() string {
+func (m *QueryProposalMessage) String() string {
return fmt.Sprintf("{%v/%v}", m.Height, m.Round)
}
diff --git a/sync/bundle/message/query_proposal_test.go b/sync/bundle/message/query_proposal_test.go
index 8904b636f..244b5d9bb 100644
--- a/sync/bundle/message/query_proposal_test.go
+++ b/sync/bundle/message/query_proposal_test.go
@@ -9,7 +9,7 @@ import (
func TestQueryProposalType(t *testing.T) {
m := &QueryProposalMessage{}
- assert.Equal(t, m.Type(), MessageTypeQueryProposal)
+ assert.Equal(t, m.Type(), TypeQueryProposal)
}
func TestQueryProposalMessage(t *testing.T) {
@@ -23,6 +23,6 @@ func TestQueryProposalMessage(t *testing.T) {
m := NewQueryProposalMessage(100, 0)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/query_votes.go b/sync/bundle/message/query_votes.go
index f91583543..6b48b9c38 100644
--- a/sync/bundle/message/query_votes.go
+++ b/sync/bundle/message/query_votes.go
@@ -26,9 +26,9 @@ func (m *QueryVotesMessage) SanityCheck() error {
}
func (m *QueryVotesMessage) Type() Type {
- return MessageTypeQueryVotes
+ return TypeQueryVotes
}
-func (m *QueryVotesMessage) Fingerprint() string {
+func (m *QueryVotesMessage) String() string {
return fmt.Sprintf("{%d/%d}", m.Height, m.Round)
}
diff --git a/sync/bundle/message/query_votes_test.go b/sync/bundle/message/query_votes_test.go
index 1b85c1913..981c04a2e 100644
--- a/sync/bundle/message/query_votes_test.go
+++ b/sync/bundle/message/query_votes_test.go
@@ -9,7 +9,7 @@ import (
func TestQueryVotesType(t *testing.T) {
m := &QueryVotesMessage{}
- assert.Equal(t, m.Type(), MessageTypeQueryVotes)
+ assert.Equal(t, m.Type(), TypeQueryVotes)
}
func TestQueryVotesMessage(t *testing.T) {
@@ -23,6 +23,6 @@ func TestQueryVotesMessage(t *testing.T) {
m := NewQueryVotesMessage(100, 0)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), "100")
+ assert.Contains(t, m.String(), "100")
})
}
diff --git a/sync/bundle/message/transactions.go b/sync/bundle/message/transactions.go
index 987a4591e..4a97560c3 100644
--- a/sync/bundle/message/transactions.go
+++ b/sync/bundle/message/transactions.go
@@ -32,14 +32,14 @@ func (m *TransactionsMessage) SanityCheck() error {
}
func (m *TransactionsMessage) Type() Type {
- return MessageTypeTransactions
+ return TypeTransactions
}
-func (m *TransactionsMessage) Fingerprint() string {
+func (m *TransactionsMessage) String() string {
var builder strings.Builder
for _, tx := range m.Transactions {
- builder.WriteString(fmt.Sprintf("%v ", tx.ID().Fingerprint()))
+ builder.WriteString(fmt.Sprintf("%v ", tx.ID().ShortString()))
}
builder.WriteString(fmt.Sprintf("{%v: ⌘ [%v]}", len(m.Transactions), builder.String()))
return builder.String()
diff --git a/sync/bundle/message/transactions_test.go b/sync/bundle/message/transactions_test.go
index 583cc8ba9..079eecf6e 100644
--- a/sync/bundle/message/transactions_test.go
+++ b/sync/bundle/message/transactions_test.go
@@ -11,7 +11,7 @@ import (
func TestTransactionsType(t *testing.T) {
m := &TransactionsMessage{}
- assert.Equal(t, m.Type(), MessageTypeTransactions)
+ assert.Equal(t, m.Type(), TypeTransactions)
}
func TestTransactionsMessage(t *testing.T) {
@@ -28,6 +28,6 @@ func TestTransactionsMessage(t *testing.T) {
m := NewTransactionsMessage([]*tx.Tx{trx})
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), trx.ID().Fingerprint())
+ assert.Contains(t, m.String(), trx.ID().ShortString())
})
}
diff --git a/sync/bundle/message/vote.go b/sync/bundle/message/vote.go
index a3b4e1191..33d9ebba5 100644
--- a/sync/bundle/message/vote.go
+++ b/sync/bundle/message/vote.go
@@ -19,9 +19,9 @@ func (m *VoteMessage) SanityCheck() error {
}
func (m *VoteMessage) Type() Type {
- return MessageTypeVote
+ return TypeVote
}
-func (m *VoteMessage) Fingerprint() string {
- return m.Vote.Fingerprint()
+func (m *VoteMessage) String() string {
+ return m.Vote.String()
}
diff --git a/sync/bundle/message/vote_test.go b/sync/bundle/message/vote_test.go
index 67bbfccab..c422a329b 100644
--- a/sync/bundle/message/vote_test.go
+++ b/sync/bundle/message/vote_test.go
@@ -10,7 +10,7 @@ import (
func TestVoteType(t *testing.T) {
m := &VoteMessage{}
- assert.Equal(t, m.Type(), MessageTypeVote)
+ assert.Equal(t, m.Type(), TypeVote)
}
func TestVoteMessage(t *testing.T) {
@@ -28,6 +28,6 @@ func TestVoteMessage(t *testing.T) {
m := NewVoteMessage(v)
assert.NoError(t, m.SanityCheck())
- assert.Contains(t, m.Fingerprint(), v.Fingerprint())
+ assert.Contains(t, m.String(), v.String())
})
}
diff --git a/sync/cache/cache.go b/sync/cache/cache.go
index 0a66e29ab..9d9234c85 100644
--- a/sync/cache/cache.go
+++ b/sync/cache/cache.go
@@ -1,69 +1,55 @@
package cache
import (
- lru "github.com/hashicorp/golang-lru"
+ lru "github.com/hashicorp/golang-lru/v2"
"github.com/pactus-project/pactus/types/block"
"github.com/pactus-project/pactus/util"
)
-const (
- blockPrefix = 0x01
- certificatePrefix = 0x02
-)
-
-type key [32]byte
-
-func blockKey(height uint32) key {
- var k key
- k[0] = blockPrefix
- copy(k[1:], util.Uint32ToSlice(height))
- return k
-}
-
-func certificateKey(height uint32) key {
- var k key
- k[0] = certificatePrefix
- copy(k[1:], util.Uint32ToSlice(height))
- return k
-}
-
type Cache struct {
- cache *lru.Cache // it's thread safe
+ blocks *lru.Cache[uint32, *block.Block] // it's thread safe
+ certs *lru.Cache[uint32, *block.Certificate]
}
func NewCache(size int) (*Cache, error) {
- c, err := lru.New(size)
+ b, err := lru.New[uint32, *block.Block](size)
+ if err != nil {
+ return nil, err
+ }
+
+ c, err := lru.New[uint32, *block.Certificate](size)
if err != nil {
return nil, err
}
+
return &Cache{
- cache: c,
+ blocks: b,
+ certs: c,
}, nil
}
func (c *Cache) HasBlockInCache(height uint32) bool {
- _, ok := c.cache.Get(blockKey(height))
- return ok
+ return c.blocks.Contains(height)
}
func (c *Cache) GetBlock(height uint32) *block.Block {
- i, ok := c.cache.Get(blockKey(height))
+ block, ok := c.blocks.Get(height)
if ok {
- return i.(*block.Block)
+ return block
}
return nil
}
func (c *Cache) AddBlock(height uint32, block *block.Block) {
- c.cache.Add(blockKey(height), block)
+ c.blocks.Add(height, block)
c.AddCertificate(height-1, block.PrevCertificate())
}
func (c *Cache) GetCertificate(height uint32) *block.Certificate {
- i, ok := c.cache.Get(certificateKey(height))
+ certificate, ok := c.certs.Get(height)
if ok {
- return i.(*block.Certificate)
+ return certificate
}
return nil
@@ -71,14 +57,16 @@ func (c *Cache) GetCertificate(height uint32) *block.Certificate {
func (c *Cache) AddCertificate(height uint32, cert *block.Certificate) {
if cert != nil {
- c.cache.Add(certificateKey(height), cert)
+ c.certs.Add(height, cert)
}
}
+// Len returns the maximum number of items in the blocks and certificates cache.
func (c *Cache) Len() int {
- return c.cache.Len()
+ return util.Max(c.blocks.Len(), c.certs.Len())
}
func (c *Cache) Clear() {
- c.cache.Purge()
+ c.blocks.Purge()
+ c.certs.Purge()
}
diff --git a/sync/cache/cache_test.go b/sync/cache/cache_test.go
index 91205c478..4acbf14e7 100644
--- a/sync/cache/cache_test.go
+++ b/sync/cache/cache_test.go
@@ -7,13 +7,6 @@ import (
"github.com/stretchr/testify/assert"
)
-func TestKeys(t *testing.T) {
- assert.Equal(t, blockKey(1234),
- key{0x1, 0xd2, 0x4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
- assert.Equal(t, certificateKey(1234),
- key{0x2, 0xd2, 0x4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
-}
-
func TestCacheBlocks(t *testing.T) {
ts := testsuite.NewTestSuite(t)
@@ -51,7 +44,7 @@ func TestClearCache(t *testing.T) {
cache.AddBlock(2, b)
- assert.Equal(t, cache.Len(), 2) // block + certificate
+ assert.Equal(t, cache.Len(), 1)
cache.Clear()
assert.Equal(t, cache.Len(), 0)
assert.Nil(t, cache.GetBlock(2))
diff --git a/sync/firewall/firewall.go b/sync/firewall/firewall.go
index 08d1d918a..29cec1095 100644
--- a/sync/firewall/firewall.go
+++ b/sync/firewall/firewall.go
@@ -9,6 +9,7 @@ import (
"github.com/pactus-project/pactus/network"
"github.com/pactus-project/pactus/state"
"github.com/pactus-project/pactus/sync/bundle"
+ "github.com/pactus-project/pactus/sync/bundle/message"
"github.com/pactus-project/pactus/sync/peerset"
"github.com/pactus-project/pactus/util/errors"
"github.com/pactus-project/pactus/util/logger"
@@ -20,11 +21,11 @@ type Firewall struct {
network network.Network
peerSet *peerset.PeerSet
state state.Facade
- logger *logger.Logger
+ logger *logger.SubLogger
}
func NewFirewall(conf *Config, net network.Network, peerSet *peerset.PeerSet, state state.Facade,
- logger *logger.Logger) *Firewall {
+ logger *logger.SubLogger) *Firewall {
return &Firewall{
config: conf,
network: net,
@@ -98,10 +99,11 @@ func (f *Firewall) openBundle(r io.Reader, source peer.ID) (*bundle.Bundle, erro
func (f *Firewall) decodeBundle(r io.Reader, pid peer.ID) (*bundle.Bundle, error) {
bdl := new(bundle.Bundle)
bytesRead, err := bdl.Decode(r)
- f.peerSet.IncreaseReceivedBytesCounter(pid, bytesRead)
if err != nil {
+ f.peerSet.IncreaseReceivedBytesCounter(pid, message.TypeUnspecified, int64(bytesRead))
return nil, errors.Errorf(errors.ErrInvalidMessage, err.Error())
}
+ f.peerSet.IncreaseReceivedBytesCounter(pid, bdl.Message.Type(), int64(bytesRead))
return bdl, nil
}
diff --git a/sync/firewall/firewall_test.go b/sync/firewall/firewall_test.go
index b769ec78c..d414c0e57 100644
--- a/sync/firewall/firewall_test.go
+++ b/sync/firewall/firewall_test.go
@@ -31,7 +31,7 @@ type testData struct {
func setup(t *testing.T) *testData {
ts := testsuite.NewTestSuite(t)
- logger := logger.NewLogger("firewall", nil)
+ logger := logger.NewSubLogger("firewall", nil)
peerSet := peerset.NewPeerSet(3 * time.Second)
state := state.MockingState(ts)
net := network.MockingNetwork(ts, ts.RandomPeerID())
diff --git a/sync/handler_block_announce.go b/sync/handler_block_announce.go
index b460de90e..24422da40 100644
--- a/sync/handler_block_announce.go
+++ b/sync/handler_block_announce.go
@@ -25,7 +25,7 @@ func (handler *blockAnnounceHandler) ParseMessage(m message.Message, initiator p
handler.tryCommitBlocks()
handler.moveConsensusToNewHeight()
- handler.peerSet.UpdateHeight(initiator, msg.Height)
+ handler.peerSet.UpdateHeight(initiator, msg.Height, msg.Block.Hash())
handler.updateBlockchain()
return nil
diff --git a/sync/handler_block_announce_test.go b/sync/handler_block_announce_test.go
index 776881150..0a80ada7a 100644
--- a/sync/handler_block_announce_test.go
+++ b/sync/handler_block_announce_test.go
@@ -26,7 +26,7 @@ func TestParsingBlockAnnounceMessages(t *testing.T) {
t.Run("Receiving new block announce message, without committing previous block", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg2, pid))
- msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.Equal(t, msg1.Message.(*message.BlocksRequestMessage).From, lastBlockHeight+1)
peer := td.sync.peerSet.GetPeer(pid)
@@ -38,8 +38,6 @@ func TestParsingBlockAnnounceMessages(t *testing.T) {
t.Run("Receiving missed block, should commit both blocks", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg1, pid))
- peer := td.sync.peerSet.GetPeer(pid)
- assert.Equal(t, peer.Height, lastBlockHeight+2)
assert.Equal(t, td.sync.state.LastBlockHeight(), lastBlockHeight+2)
assert.Equal(t, td.sync.peerSet.MaxClaimedHeight(), lastBlockHeight+2)
})
@@ -56,7 +54,7 @@ func TestBroadcastingBlockAnnounceMessages(t *testing.T) {
t.Run("Not in the committee, should not broadcast block announce message", func(t *testing.T) {
td.sync.broadcast(msg)
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeBlockAnnounce)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeBlockAnnounce)
})
td.addPeerToCommittee(t, td.sync.SelfID(), td.sync.signers[0].PublicKey())
@@ -64,7 +62,7 @@ func TestBroadcastingBlockAnnounceMessages(t *testing.T) {
t.Run("In the committee, should broadcast block announce message", func(t *testing.T) {
td.sync.broadcast(msg)
- msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlockAnnounce)
+ msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlockAnnounce)
assert.Equal(t, msg1.Message.(*message.BlockAnnounceMessage).Height, msg.Height)
})
}
diff --git a/sync/handler_blocks_request.go b/sync/handler_blocks_request.go
index a7503c868..535b96b63 100644
--- a/sync/handler_blocks_request.go
+++ b/sync/handler_blocks_request.go
@@ -24,7 +24,7 @@ func (handler *blocksRequestHandler) ParseMessage(m message.Message, initiator p
if handler.peerSet.NumberOfOpenSessions() > handler.config.MaxOpenSessions {
handler.logger.Warn("we are busy", "message", msg, "pid", initiator)
- response := message.NewBlocksResponseMessage(message.ResponseCodeBusy,
+ response := message.NewBlocksResponseMessage(message.ResponseCodeRejected, "we are busy",
msg.SessionID, 0, nil, nil)
handler.sendTo(response, initiator, msg.SessionID)
@@ -33,55 +33,46 @@ func (handler *blocksRequestHandler) ParseMessage(m message.Message, initiator p
peer := handler.peerSet.GetPeer(initiator)
if !peer.IsKnownOrTrusty() {
- response := message.NewBlocksResponseMessage(message.ResponseCodeRejected,
+ err := errors.Errorf(errors.ErrInvalidMessage, "peer status is %v", peer.Status)
+ response := message.NewBlocksResponseMessage(message.ResponseCodeRejected, err.Error(),
msg.SessionID, 0, nil, nil)
handler.sendTo(response, initiator, msg.SessionID)
- return errors.Errorf(errors.ErrInvalidMessage, "peer status is %v", peer.Status)
+ return err
}
- // TODO
- // This condition causes some troubles on testnet. Commenting it for further discussion.
- // Connections between the nodes can be interrupted or even manually restarted during sync.
- // When the number of "node networks" are less than of MaxOpenSessions, it can cause the node to never sync.
- // if peer.Height > msg.From {
- // response := message.NewBlocksResponseMessage(message.ResponseCodeRejected,
- // msg.SessionID, 0, nil, nil)
- // handler.sendTo(response, initiator)
-
- // return errors.Errorf(errors.ErrInvalidMessage, "peer request for blocks that already has: %v", msg.From)
- // }
-
if !handler.config.NodeNetwork {
ourHeight := handler.state.LastBlockHeight()
if msg.From < ourHeight-LatestBlockInterval {
- response := message.NewBlocksResponseMessage(message.ResponseCodeRejected,
+ err := errors.Errorf(errors.ErrInvalidMessage, "the request height is not acceptable: %v", msg.From)
+ response := message.NewBlocksResponseMessage(message.ResponseCodeRejected, err.Error(),
msg.SessionID, 0, nil, nil)
handler.sendTo(response, initiator, msg.SessionID)
- return errors.Errorf(errors.ErrInvalidMessage, "the request height is not acceptable: %v", msg.From)
+ return err
}
}
height := msg.From
count := msg.Count
if count > LatestBlockInterval {
- response := message.NewBlocksResponseMessage(message.ResponseCodeRejected,
+ err := errors.Errorf(errors.ErrInvalidMessage, "too many blocks requested: %v-%v", msg.From, msg.Count)
+ response := message.NewBlocksResponseMessage(message.ResponseCodeRejected, err.Error(),
msg.SessionID, 0, nil, nil)
handler.sendTo(response, initiator, msg.SessionID)
- return errors.Errorf(errors.ErrInvalidMessage, "too many blocks requested: %v-%v", msg.From, msg.Count)
+ return err
}
// Help this peer to sync up
for {
- blockToRead := util.MinU32(handler.config.BlockPerMessage, count)
+ blockToRead := util.Min(handler.config.BlockPerMessage, count)
blocksData := handler.prepareBlocks(height, blockToRead)
if len(blocksData) == 0 {
break
}
- response := message.NewBlocksResponseMessage(message.ResponseCodeMoreBlocks,
+ response := message.NewBlocksResponseMessage(message.ResponseCodeMoreBlocks, message.ResponseCodeMoreBlocks.String(),
msg.SessionID, height, blocksData, nil)
handler.sendTo(response, initiator, msg.SessionID)
@@ -94,16 +85,15 @@ func (handler *blocksRequestHandler) ParseMessage(m message.Message, initiator p
// To avoid sending blocks again, we update height for this peer
// Height is always greater than zeo.
peerHeight := height - 1
- handler.peerSet.UpdateHeight(initiator, peerHeight)
if msg.To() >= handler.state.LastBlockHeight() {
lastCertificate := handler.state.LastCertificate()
- response := message.NewBlocksResponseMessage(message.ResponseCodeSynced,
+ response := message.NewBlocksResponseMessage(message.ResponseCodeSynced, message.ResponseCodeSynced.String(),
msg.SessionID, peerHeight, nil, lastCertificate)
handler.sendTo(response, initiator, msg.SessionID)
} else {
response := message.NewBlocksResponseMessage(message.ResponseCodeNoMoreBlocks,
- msg.SessionID, 0, nil, nil)
+ message.ResponseCodeNoMoreBlocks.String(), msg.SessionID, 0, nil, nil)
handler.sendTo(response, initiator, msg.SessionID)
}
diff --git a/sync/handler_blocks_request_test.go b/sync/handler_blocks_request_test.go
index 1e88c1f68..57ac721a6 100644
--- a/sync/handler_blocks_request_test.go
+++ b/sync/handler_blocks_request_test.go
@@ -18,12 +18,13 @@ func TestSessionTimeout(t *testing.T) {
signer := td.RandomSigner()
pid := td.RandomPeerID()
claimedHeight := uint32(6666)
- msg := message.NewHelloMessage(pid, "Oscar", claimedHeight, message.FlagNodeNetwork, td.state.Genesis().Hash())
+ msg := message.NewHelloMessage(pid, "Oscar", claimedHeight, message.FlagNodeNetwork,
+ td.state.LastBlockHash(), td.state.Genesis().Hash())
signer.SignMsg(msg)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.True(t, td.sync.peerSet.HasAnyOpenSession())
time.Sleep(2 * config.SessionTimeout)
@@ -58,7 +59,7 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, curHeight-1, 1)
assert.Error(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeRejected)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).From, uint32(0))
})
@@ -70,7 +71,7 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, 1, 2)
assert.Error(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeRejected)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).From, uint32(0))
})
@@ -79,7 +80,7 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, 0, LatestBlockInterval+1)
assert.Error(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeRejected)
})
@@ -88,66 +89,47 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, curHeight-config.BlockPerMessage, config.BlockPerMessage)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl1 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl1 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeMoreBlocks)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).From, curHeight-config.BlockPerMessage)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).To(), curHeight-1)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).Count(), config.BlockPerMessage)
assert.Zero(t, bdl1.Message.(*message.BlocksResponseMessage).LastCertificateHeight())
- bdl2 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl2 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl2.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeNoMoreBlocks)
assert.Zero(t, bdl2.Message.(*message.BlocksResponseMessage).From)
assert.Zero(t, bdl2.Message.(*message.BlocksResponseMessage).To())
assert.Zero(t, bdl2.Message.(*message.BlocksResponseMessage).Count())
assert.Zero(t, bdl1.Message.(*message.BlocksResponseMessage).LastCertificateHeight())
-
- peer := td.sync.peerSet.GetPeer(pid)
- assert.Equal(t, peer.Height, curHeight-1) // Peer needs one more block
})
t.Run("Peer synced", func(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, curHeight-config.BlockPerMessage+1, config.BlockPerMessage)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl1 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl1 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeMoreBlocks)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).From, curHeight-config.BlockPerMessage+1)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).To(), curHeight)
assert.Equal(t, bdl1.Message.(*message.BlocksResponseMessage).Count(), config.BlockPerMessage)
assert.Zero(t, bdl1.Message.(*message.BlocksResponseMessage).LastCertificateHeight())
- bdl2 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl2 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl2.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeSynced)
assert.Equal(t, bdl2.Message.(*message.BlocksResponseMessage).From, curHeight)
assert.Zero(t, bdl2.Message.(*message.BlocksResponseMessage).To())
assert.Zero(t, bdl2.Message.(*message.BlocksResponseMessage).Count())
assert.Equal(t, bdl2.Message.(*message.BlocksResponseMessage).LastCertificateHeight(), curHeight)
-
- peer := td.sync.peerSet.GetPeer(pid)
- assert.Equal(t, peer.Height, curHeight) // Peer is synced
})
})
- // t.Run("Peer requests to send the blocks again, It should be rejected", func(t *testing.T) {
- // msg := message.NewBlocksRequestMessage(sid, curHeight-1, 1)
- // assert.Error(t, td.testReceivingNewMessage(td.sync, msg, pid))
-
- // bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
- // assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeRejected)
- // assert.Zero(t, bdl.Message.(*message.BlocksResponseMessage).LastCertificateHeight())
-
- // })
-
t.Run("Peer requests blocks that we don't have", func(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, curHeight+100, 1)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeSynced)
-
- peer := td.sync.peerSet.GetPeer(pid)
- assert.Equal(t, peer.Height, curHeight+99)
})
})
@@ -163,14 +145,11 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
msg := message.NewBlocksRequestMessage(sid, 1, 2)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ msg1 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, msg1.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeMoreBlocks)
- msg2 := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
+ msg2 := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
assert.Equal(t, msg2.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeNoMoreBlocks)
-
- peer := td.sync.peerSet.GetPeer(pid)
- assert.Equal(t, peer.Height, uint32(2))
})
t.Run("Peer is busy", func(t *testing.T) {
@@ -184,8 +163,8 @@ func TestLatestBlocksRequestMessages(t *testing.T) {
s := td.sync.peerSet.OpenSession(td.network.SelfID())
msg := message.NewBlocksRequestMessage(s.SessionID(), 100, 105)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksResponse)
- assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeBusy)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksResponse)
+ assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeRejected)
})
})
}
diff --git a/sync/handler_blocks_response_test.go b/sync/handler_blocks_response_test.go
index 5e3716c89..75b2c7e69 100644
--- a/sync/handler_blocks_response_test.go
+++ b/sync/handler_blocks_response_test.go
@@ -19,7 +19,7 @@ func TestInvalidBlockData(t *testing.T) {
pid := td.RandomPeerID()
sid := td.sync.peerSet.OpenSession(pid).SessionID()
- msg := message.NewBlocksResponseMessage(message.ResponseCodeMoreBlocks, sid,
+ msg := message.NewBlocksResponseMessage(message.ResponseCodeMoreBlocks, message.ResponseCodeMoreBlocks.String(), sid,
0, [][]byte{{1, 2, 3}}, nil)
assert.Error(t, td.receivingNewMessage(td.sync, msg, pid))
@@ -40,7 +40,7 @@ func TestOneBlockShorter(t *testing.T) {
t.Run("Peer is busy. Session should be closed", func(t *testing.T) {
sid := td.sync.peerSet.OpenSession(pid).SessionID()
- msg := message.NewBlocksResponseMessage(message.ResponseCodeBusy, sid,
+ msg := message.NewBlocksResponseMessage(message.ResponseCodeRejected, message.ResponseCodeRejected.String(), sid,
0, nil, nil)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
@@ -49,7 +49,7 @@ func TestOneBlockShorter(t *testing.T) {
t.Run("Request is rejected. Session should be closed", func(t *testing.T) {
sid := td.sync.peerSet.OpenSession(pid).SessionID()
- msg := message.NewBlocksResponseMessage(message.ResponseCodeRejected, sid,
+ msg := message.NewBlocksResponseMessage(message.ResponseCodeRejected, message.ResponseCodeRejected.String(), sid,
0, nil, nil)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
@@ -58,7 +58,7 @@ func TestOneBlockShorter(t *testing.T) {
t.Run("Commit one block", func(t *testing.T) {
sid := td.sync.peerSet.OpenSession(pid).SessionID()
- msg := message.NewBlocksResponseMessage(message.ResponseCodeSynced, sid,
+ msg := message.NewBlocksResponseMessage(message.ResponseCodeSynced, message.ResponseCodeRejected.String(), sid,
lastBlockHeight+1, [][]byte{d1}, c1)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
@@ -114,7 +114,7 @@ func TestSyncing(t *testing.T) {
// -------------------------------
// For better logging when testing
overrideLogger := func(sync *synchronizer, name string) {
- sync.logger = logger.NewLogger("_sync", &OverrideFingerprint{
+ sync.logger = logger.NewSubLogger("_sync", &OverrideStringer{
name: fmt.Sprintf("%s - %s: ", name, t.Name()), sync: sync})
}
@@ -126,12 +126,12 @@ func TestSyncing(t *testing.T) {
assert.NoError(t, syncBob.Start())
// Verify that Hello messages are exchanged between Alice and Bob
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeHello)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeHello)
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeHello)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeHello)
// Verify that Hello-ack messages are exchanged between Alice and Bob
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeHello)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeHello)
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeHello)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeHello)
// Ensure peers are connected and block heights are correct
assert.Equal(t, syncAlice.PeerSet().Len(), 1)
@@ -140,34 +140,34 @@ func TestSyncing(t *testing.T) {
assert.Equal(t, syncBob.state.LastBlockHeight(), uint32(100))
// Perform block syncing
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeBlocksRequest)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 1-11
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 12-22
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 23-23
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // NoMoreBlock
-
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeBlocksRequest)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 24-34
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 35-45
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 46-46
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // NoMoreBlock
-
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeBlocksRequest)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 47-57
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 58-68
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 69-69
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // NoMoreBlock
-
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeBlocksRequest)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 70-80
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 81-91
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 92-92
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // NoMoreBlock
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeBlocksRequest)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 1-11
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 12-22
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 23-23
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // NoMoreBlock
+
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeBlocksRequest)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 24-34
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 35-45
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 46-46
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // NoMoreBlock
+
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeBlocksRequest)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 47-57
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 58-68
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 69-69
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // NoMoreBlock
+
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeBlocksRequest)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 70-80
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 81-91
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 92-92
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // NoMoreBlock
// Last block requests
- shouldPublishMessageWithThisType(t, networkAlice, message.MessageTypeBlocksRequest)
- shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // 93-100
- bdl := shouldPublishMessageWithThisType(t, networkBob, message.MessageTypeBlocksResponse) // Synced
+ shouldPublishMessageWithThisType(t, networkAlice, message.TypeBlocksRequest)
+ shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // 93-100
+ bdl := shouldPublishMessageWithThisType(t, networkBob, message.TypeBlocksResponse) // Synced
assert.Equal(t, bdl.Message.(*message.BlocksResponseMessage).ResponseCode, message.ResponseCodeSynced)
// Alice needs more time to process all the bundles,
diff --git a/sync/handler_heart_beat.go b/sync/handler_heart_beat.go
index 1e45008d7..86490a260 100644
--- a/sync/handler_heart_beat.go
+++ b/sync/handler_heart_beat.go
@@ -37,7 +37,7 @@ func (handler *heartBeatHandler) ParseMessage(m message.Message, initiator peer.
}
}
- handler.peerSet.UpdateHeight(initiator, msg.Height)
+ handler.peerSet.UpdateHeight(initiator, msg.Height, msg.PrevBlockHash)
return nil
}
diff --git a/sync/handler_heart_beat_test.go b/sync/handler_heart_beat_test.go
index bd9b9ae7b..25073796d 100644
--- a/sync/handler_heart_beat_test.go
+++ b/sync/handler_heart_beat_test.go
@@ -19,7 +19,7 @@ func TestParsingHeartbeatMessages(t *testing.T) {
t.Run("Not in the committee, but processes heartbeat messages", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
td.addPeerToCommittee(t, td.sync.SelfID(), td.sync.signers[0].PublicKey())
@@ -27,21 +27,21 @@ func TestParsingHeartbeatMessages(t *testing.T) {
t.Run("In the committee, should query for votes", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
t.Run("Should not query for votes for previous round", func(t *testing.T) {
msg := message.NewHeartBeatMessage(h, 0, td.RandomHash())
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
t.Run("Should not query for votes for same round", func(t *testing.T) {
msg := message.NewHeartBeatMessage(h, 1, td.RandomHash())
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
}
@@ -52,8 +52,8 @@ func TestBroadcastingHeartbeatMessages(t *testing.T) {
t.Run("It is not in committee", func(t *testing.T) {
td.sync.broadcastHeartBeat()
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeHeartBeat)
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeVote)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeHeartBeat)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeVote)
})
td.addPeerToCommittee(t, td.sync.SelfID(), td.sync.signers[1].PublicKey())
@@ -64,7 +64,7 @@ func TestBroadcastingHeartbeatMessages(t *testing.T) {
td.consMgr.AddVote(v1)
td.sync.broadcastHeartBeat()
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeHeartBeat)
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeVote)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeHeartBeat)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeVote)
})
}
diff --git a/sync/handler_hello.go b/sync/handler_hello.go
index 86863f0fd..993f234e1 100644
--- a/sync/handler_hello.go
+++ b/sync/handler_hello.go
@@ -48,7 +48,7 @@ func (handler *helloHandler) ParseMessage(m message.Message, initiator peer.ID)
msg.Agent,
msg.PublicKey,
util.IsFlagSet(msg.Flags, message.FlagNodeNetwork))
- handler.peerSet.UpdateHeight(initiator, msg.Height)
+ handler.peerSet.UpdateHeight(initiator, msg.Height, msg.BlockHash)
if !util.IsFlagSet(msg.Flags, message.FlagHelloAck) {
// TODO: Sends response only if there is a direct connection between two peers.
diff --git a/sync/handler_hello_test.go b/sync/handler_hello_test.go
index 4e20dc55c..0e179942f 100644
--- a/sync/handler_hello_test.go
+++ b/sync/handler_hello_test.go
@@ -20,7 +20,8 @@ func TestParsingHelloMessages(t *testing.T) {
signer := td.RandomSigner()
pid := td.RandomPeerID()
initiator := td.RandomPeerID()
- msg := message.NewHelloMessage(pid, "bad-genesis", 0, 0, td.state.Genesis().Hash())
+ msg := message.NewHelloMessage(pid, "bad-genesis", 0, 0,
+ td.state.LastBlockHash(), td.state.Genesis().Hash())
signer.SignMsg(msg)
assert.True(t, msg.PublicKey.EqualsTo(signer.PublicKey()))
@@ -33,12 +34,13 @@ func TestParsingHelloMessages(t *testing.T) {
invGenHash := td.RandomHash()
signer := td.RandomSigner()
pid := td.RandomPeerID()
- msg := message.NewHelloMessage(pid, "bad-genesis", 0, 0, invGenHash)
+ msg := message.NewHelloMessage(pid, "bad-genesis", 0, 0,
+ td.state.LastBlockHash(), invGenHash)
signer.SignMsg(msg)
assert.True(t, msg.PublicKey.EqualsTo(signer.PublicKey()))
assert.Error(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeHello)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeHello)
td.checkPeerStatus(t, pid, peerset.StatusCodeBanned)
})
@@ -47,13 +49,14 @@ func TestParsingHelloMessages(t *testing.T) {
signer := td.RandomSigner()
height := td.RandUint32(td.state.LastBlockHeight())
pid := td.RandomPeerID()
- msg := message.NewHelloMessage(pid, "kitty", height, message.FlagNodeNetwork, td.state.Genesis().Hash())
+ msg := message.NewHelloMessage(pid, "kitty", height, message.FlagNodeNetwork,
+ td.state.LastBlockHash(), td.state.Genesis().Hash())
signer.SignMsg(msg)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeHello) // Alice key 1
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeHello) // Alice key 2
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeHello) // Alice key 1
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeHello) // Alice key 2
// Check if the peer info is updated
p := td.sync.peerSet.GetPeer(pid)
@@ -73,11 +76,12 @@ func TestParsingHelloMessages(t *testing.T) {
signer := td.RandomSigner()
height := td.RandUint32(td.state.LastBlockHeight())
pid := td.RandomPeerID()
- msg := message.NewHelloMessage(pid, "kitty", height, message.FlagHelloAck, td.state.Genesis().Hash())
+ msg := message.NewHelloMessage(pid, "kitty", height, message.FlagHelloAck,
+ td.state.LastBlockHash(), td.state.Genesis().Hash())
signer.SignMsg(msg)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeHello)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeHello)
td.checkPeerStatus(t, pid, peerset.StatusCodeKnown)
// Check if the peer info is updated
@@ -91,11 +95,12 @@ func TestParsingHelloMessages(t *testing.T) {
signer := td.RandomSigner()
claimedHeight := td.state.LastBlockHeight() + 5
pid := td.RandomPeerID()
- msg := message.NewHelloMessage(pid, "kitty", claimedHeight, message.FlagHelloAck, td.state.Genesis().Hash())
+ msg := message.NewHelloMessage(pid, "kitty", claimedHeight, message.FlagHelloAck,
+ td.state.LastBlockHash(), td.state.Genesis().Hash())
signer.SignMsg(msg)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
td.checkPeerStatus(t, pid, peerset.StatusCodeKnown)
assert.Equal(t, td.sync.peerSet.MaxClaimedHeight(), claimedHeight)
})
@@ -106,7 +111,7 @@ func TestBroadcastingHelloMessages(t *testing.T) {
td.sync.sayHello(true)
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeHello)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeHello)
assert.True(t, util.IsFlagSet(bdl.Flags, bundle.BundleFlagHelloMessage))
assert.True(t, util.IsFlagSet(bdl.Message.(*message.HelloMessage).Flags, message.FlagHelloAck))
}
diff --git a/sync/handler_query_proposal_test.go b/sync/handler_query_proposal_test.go
index 6092f50cf..501067e2c 100644
--- a/sync/handler_query_proposal_test.go
+++ b/sync/handler_query_proposal_test.go
@@ -27,13 +27,13 @@ func TestParsingQueryProposalMessages(t *testing.T) {
msg := message.NewQueryProposalMessage(consensusHeight+1, 0)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeProposal)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeProposal)
})
t.Run("In the committee, should respond to the query proposal message", func(t *testing.T) {
msg := message.NewQueryProposalMessage(consensusHeight, 0)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeProposal)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeProposal)
assert.Equal(t, bdl.Message.(*message.ProposalMessage).Proposal.Hash(), prop.Hash())
})
@@ -41,7 +41,7 @@ func TestParsingQueryProposalMessages(t *testing.T) {
msg := message.NewQueryProposalMessage(consensusHeight, 1)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeProposal)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeProposal)
})
}
@@ -54,7 +54,7 @@ func TestBroadcastingQueryProposalMessages(t *testing.T) {
t.Run("Not in the committee, should not send query proposal message", func(t *testing.T) {
td.sync.broadcast(msg)
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeQueryProposal)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeQueryProposal)
})
td.addPeerToCommittee(t, td.sync.SelfID(), td.sync.signers[0].PublicKey())
@@ -62,6 +62,6 @@ func TestBroadcastingQueryProposalMessages(t *testing.T) {
t.Run("In the committee, should send query proposal message", func(t *testing.T) {
td.sync.broadcast(msg)
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeQueryProposal)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeQueryProposal)
})
}
diff --git a/sync/handler_query_votes.go b/sync/handler_query_votes.go
index 3d23a412f..b62ea7c4a 100644
--- a/sync/handler_query_votes.go
+++ b/sync/handler_query_votes.go
@@ -26,7 +26,7 @@ func (handler *queryVotesHandler) ParseMessage(m message.Message, initiator peer
if !handler.peerIsInTheCommittee(initiator) {
return errors.Errorf(errors.ErrInvalidMessage, "peers is not in the committee")
}
- v := handler.consMgr.PickRandomVote()
+ v := handler.consMgr.PickRandomVote(msg.Round)
if v != nil {
response := message.NewVoteMessage(v)
handler.broadcast(response)
diff --git a/sync/handler_query_votes_test.go b/sync/handler_query_votes_test.go
index 0417c4f7a..0226199cb 100644
--- a/sync/handler_query_votes_test.go
+++ b/sync/handler_query_votes_test.go
@@ -32,7 +32,7 @@ func TestParsingQueryVotesMessages(t *testing.T) {
t.Run("In the committee, should respond to the query vote message", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeVote)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeVote)
assert.Equal(t, bdl.Message.(*message.VoteMessage).Vote.Hash(), v1.Hash())
})
@@ -40,7 +40,7 @@ func TestParsingQueryVotesMessages(t *testing.T) {
msg := message.NewQueryVotesMessage(consensusHeight+1, 1)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeVote)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeVote)
})
}
@@ -53,13 +53,13 @@ func TestBroadcastingQueryVotesMessages(t *testing.T) {
t.Run("Not in the committee, should not send query vote message", func(t *testing.T) {
td.sync.broadcast(msg)
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
td.addPeerToCommittee(t, td.sync.SelfID(), td.sync.signers[0].PublicKey())
t.Run("In the committee, should send query vote message", func(t *testing.T) {
td.sync.broadcast(msg)
- td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeQueryVotes)
+ td.shouldPublishMessageWithThisType(t, td.network, message.TypeQueryVotes)
})
}
diff --git a/sync/handler_vote_test.go b/sync/handler_vote_test.go
index fac4e886d..6d2f62c69 100644
--- a/sync/handler_vote_test.go
+++ b/sync/handler_vote_test.go
@@ -15,6 +15,6 @@ func TestParsingVoteMessages(t *testing.T) {
msg := message.NewVoteMessage(v)
assert.NoError(t, td.receivingNewMessage(td.sync, msg, td.RandomPeerID()))
- assert.Equal(t, td.consMgr.PickRandomVote().Hash(), v.Hash())
+ assert.Equal(t, td.consMgr.PickRandomVote(0).Hash(), v.Hash())
})
}
diff --git a/sync/interface.go b/sync/interface.go
index add5fe48a..7bc6c3b0b 100644
--- a/sync/interface.go
+++ b/sync/interface.go
@@ -11,5 +11,4 @@ type Synchronizer interface {
Moniker() string
SelfID() peer.ID
PeerSet() *peerset.PeerSet
- Fingerprint() string
}
diff --git a/sync/mock.go b/sync/mock.go
index f876246c1..4bf4febd8 100644
--- a/sync/mock.go
+++ b/sync/mock.go
@@ -29,7 +29,7 @@ func MockingSync(ts *testsuite.TestSuite) *MockSync {
version.Agent(),
pub1,
true)
- ps.UpdateHeight(pid1, ts.RandUint32(100000))
+ ps.UpdateHeight(pid1, ts.RandUint32(100000), ts.RandomHash())
ps.UpdatePeerInfo(
pid2,
@@ -38,7 +38,7 @@ func MockingSync(ts *testsuite.TestSuite) *MockSync {
version.Agent(),
pub2,
false)
- ps.UpdateHeight(pid1, ts.RandUint32(100000))
+ ps.UpdateHeight(pid1, ts.RandUint32(100000), ts.RandomHash())
return &MockSync{
TestID: ts.RandomPeerID(),
@@ -51,9 +51,6 @@ func (m *MockSync) Start() error {
}
func (m *MockSync) Stop() {
}
-func (m *MockSync) Fingerprint() string {
- return ""
-}
func (m *MockSync) SelfID() peer.ID {
return m.TestID
diff --git a/sync/peerset/peer.go b/sync/peerset/peer.go
index d4e2a1ae9..489c5df89 100644
--- a/sync/peerset/peer.go
+++ b/sync/peerset/peer.go
@@ -5,11 +5,11 @@ import (
"github.com/libp2p/go-libp2p/core/peer"
"github.com/pactus-project/pactus/crypto/bls"
+ "github.com/pactus-project/pactus/crypto/hash"
+ "github.com/pactus-project/pactus/sync/bundle/message"
"github.com/pactus-project/pactus/util"
)
-// TODO: write tests for me
-
const (
PeerFlagNodeNetwork = 0x01
)
@@ -23,10 +23,12 @@ type Peer struct {
Flags int
LastSent time.Time
LastReceived time.Time
+ LastBlockHash hash.Hash
Height uint32
ReceivedBundles int
InvalidBundles int
- ReceivedBytes int
+ ReceivedBytes map[message.Type]int64
+ SentBytes map[message.Type]int64
SendSuccess int
SendFailed int
}
@@ -36,6 +38,8 @@ func NewPeer(peerID peer.ID) *Peer {
ConsensusKeys: make(map[bls.PublicKey]bool),
Status: StatusCodeUnknown,
PeerID: peerID,
+ ReceivedBytes: make(map[message.Type]int64),
+ SentBytes: make(map[message.Type]int64),
}
}
diff --git a/sync/peerset/peer_set.go b/sync/peerset/peer_set.go
index 200bc5dcb..448d89e7c 100644
--- a/sync/peerset/peer_set.go
+++ b/sync/peerset/peer_set.go
@@ -1,11 +1,14 @@
package peerset
import (
+ "fmt"
"sync"
"time"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/pactus-project/pactus/crypto/bls"
+ "github.com/pactus-project/pactus/crypto/hash"
+ "github.com/pactus-project/pactus/sync/bundle/message"
"github.com/pactus-project/pactus/util"
)
@@ -21,8 +24,10 @@ type PeerSet struct {
nextSessionID int
maxClaimedHeight uint32
sessionTimeout time.Duration
- totalSentBytes int
- totalReceivedBytes int
+ totalSentBytes int64
+ totalReceivedBytes int64
+ sentBytes map[message.Type]int64
+ receivedBytes map[message.Type]int64
startedAt time.Time
}
@@ -31,6 +36,8 @@ func NewPeerSet(sessionTimeout time.Duration) *PeerSet {
peers: make(map[peer.ID]*Peer),
sessions: make(map[int]*Session),
sessionTimeout: sessionTimeout,
+ sentBytes: make(map[message.Type]int64),
+ receivedBytes: make(map[message.Type]int64),
startedAt: time.Now(),
}
}
@@ -255,13 +262,14 @@ func (ps *PeerSet) UpdatePeerInfo(
}
}
-func (ps *PeerSet) UpdateHeight(pid peer.ID, height uint32) {
+func (ps *PeerSet) UpdateHeight(pid peer.ID, height uint32, lastBlockHash hash.Hash) {
ps.lk.Lock()
defer ps.lk.Unlock()
p := ps.mustGetPeer(pid)
- p.Height = util.MaxU32(p.Height, height)
- ps.maxClaimedHeight = util.MaxU32(ps.maxClaimedHeight, height)
+ p.Height = height
+ p.LastBlockHash = lastBlockHash
+ ps.maxClaimedHeight = util.Max(ps.maxClaimedHeight, height)
}
func (ps *PeerSet) UpdateStatus(pid peer.ID, status StatusCode) {
@@ -304,20 +312,29 @@ func (ps *PeerSet) IncreaseInvalidBundlesCounter(pid peer.ID) {
p.InvalidBundles++
}
-func (ps *PeerSet) IncreaseReceivedBytesCounter(pid peer.ID, c int) {
+func (ps *PeerSet) IncreaseReceivedBytesCounter(pid peer.ID, msgType message.Type, c int64) {
ps.lk.Lock()
defer ps.lk.Unlock()
p := ps.mustGetPeer(pid)
- p.ReceivedBytes += c
+ fmt.Println(&p)
+ p.ReceivedBytes[msgType] += c
+
ps.totalReceivedBytes += c
+ ps.receivedBytes[msgType] += c
}
-func (ps *PeerSet) IncreaseTotalSentBytesCounter(c int) {
+func (ps *PeerSet) IncreaseSentBytesCounter(msgType message.Type, c int64, pid *peer.ID) {
ps.lk.Lock()
defer ps.lk.Unlock()
ps.totalSentBytes += c
+ ps.sentBytes[msgType] += c
+
+ if pid != nil {
+ p := ps.mustGetPeer(*pid)
+ p.SentBytes[msgType] += c
+ }
}
func (ps *PeerSet) IncreaseSendSuccessCounter(pid peer.ID) {
@@ -336,20 +353,42 @@ func (ps *PeerSet) IncreaseSendFailedCounter(pid peer.ID) {
p.SendFailed++
}
-func (ps *PeerSet) TotalSentBytes() int {
+func (ps *PeerSet) TotalSentBytes() int64 {
ps.lk.RLock()
defer ps.lk.RUnlock()
return ps.totalSentBytes
}
-func (ps *PeerSet) TotalReceivedBytes() int {
+func (ps *PeerSet) TotalReceivedBytes() int64 {
ps.lk.RLock()
defer ps.lk.RUnlock()
return ps.totalReceivedBytes
}
+func (ps *PeerSet) SentBytesMessageType(msgType message.Type) int64 {
+ if sentBytes, ok := ps.sentBytes[msgType]; ok {
+ return sentBytes
+ }
+ return 0
+}
+
+func (ps *PeerSet) ReceivedBytesMessageType(msgType message.Type) int64 {
+ if receivedBytes, ok := ps.receivedBytes[msgType]; ok {
+ return receivedBytes
+ }
+ return 0
+}
+
+func (ps *PeerSet) SentBytes() map[message.Type]int64 {
+ return ps.sentBytes
+}
+
+func (ps *PeerSet) ReceivedBytes() map[message.Type]int64 {
+ return ps.receivedBytes
+}
+
func (ps *PeerSet) StartedAt() time.Time {
ps.lk.RLock()
defer ps.lk.RUnlock()
diff --git a/sync/peerset/peer_set_test.go b/sync/peerset/peer_set_test.go
index 43125f2b5..744e43e59 100644
--- a/sync/peerset/peer_set_test.go
+++ b/sync/peerset/peer_set_test.go
@@ -34,9 +34,9 @@ func TestPeerSet(t *testing.T) {
t.Run("Testing MaxClaimedHeight", func(t *testing.T) {
assert.Equal(t, uint32(0), peerSet.MaxClaimedHeight())
- peerSet.UpdateHeight(pid1, 100)
- peerSet.UpdateHeight(pid2, 200)
- peerSet.UpdateHeight(pid3, 150)
+ peerSet.UpdateHeight(pid1, 100, ts.RandomHash())
+ peerSet.UpdateHeight(pid2, 200, ts.RandomHash())
+ peerSet.UpdateHeight(pid3, 150, ts.RandomHash())
assert.Equal(t, uint32(200), peerSet.MaxClaimedHeight())
})
@@ -72,19 +72,37 @@ func TestPeerSet(t *testing.T) {
t.Run("Testing counters", func(t *testing.T) {
peerSet.IncreaseInvalidBundlesCounter(pid1)
peerSet.IncreaseReceivedBundlesCounter(pid1)
- peerSet.IncreaseReceivedBytesCounter(pid1, 100)
- peerSet.IncreaseTotalSentBytesCounter(200)
+ peerSet.IncreaseReceivedBytesCounter(pid1, message.TypeBlocksResponse, 100)
+ peerSet.IncreaseReceivedBytesCounter(pid1, message.TypeTransactions, 150)
+ peerSet.IncreaseSentBytesCounter(message.TypeBlocksRequest, 200, nil)
+ peerSet.IncreaseSentBytesCounter(message.TypeBlocksRequest, 250, &pid1)
peerSet.IncreaseSendFailedCounter(pid1)
peerSet.IncreaseSendSuccessCounter(pid1)
peer1 := peerSet.getPeer(pid1)
+
+ receivedBytes := make(map[message.Type]int64)
+ receivedBytes[message.TypeBlocksResponse] = 100
+ receivedBytes[message.TypeTransactions] = 150
+
+ sentBytes := make(map[message.Type]int64)
+ sentBytes[message.TypeBlocksRequest] = 450
+
assert.Equal(t, peer1.InvalidBundles, 1)
assert.Equal(t, peer1.ReceivedBundles, 1)
- assert.Equal(t, peer1.ReceivedBytes, 100)
+ assert.Equal(t, peer1.ReceivedBytes[message.TypeBlocksResponse], int64(100))
+ assert.Equal(t, peer1.ReceivedBytes[message.TypeTransactions], int64(150))
assert.Equal(t, peer1.SendFailed, 1)
assert.Equal(t, peer1.SendSuccess, 1)
- assert.Equal(t, peerSet.TotalReceivedBytes(), 100)
- assert.Equal(t, peerSet.TotalSentBytes(), 200)
+ assert.Equal(t, peer1.SentBytes[message.TypeBlocksRequest], int64(250))
+
+ assert.Equal(t, peerSet.TotalReceivedBytes(), int64(250))
+ assert.Equal(t, peerSet.ReceivedBytesMessageType(message.TypeBlocksResponse), int64(100))
+ assert.Equal(t, peerSet.ReceivedBytesMessageType(message.TypeTransactions), int64(150))
+ assert.Equal(t, peerSet.ReceivedBytes(), receivedBytes)
+ assert.Equal(t, peerSet.TotalSentBytes(), int64(450))
+ assert.Equal(t, peerSet.SentBytesMessageType(message.TypeBlocksRequest), int64(450))
+ assert.Equal(t, peerSet.SentBytes(), sentBytes)
})
t.Run("Testing UpdateStatus", func(t *testing.T) {
diff --git a/sync/peerset/peer_test.go b/sync/peerset/peer_test.go
new file mode 100644
index 000000000..40d7e5696
--- /dev/null
+++ b/sync/peerset/peer_test.go
@@ -0,0 +1,46 @@
+package peerset
+
+import (
+ "testing"
+
+ "github.com/libp2p/go-libp2p/core/peer"
+ "github.com/stretchr/testify/assert"
+)
+
+func TestPeer(t *testing.T) {
+ pid1 := peer.ID("peer-1")
+ pid2 := peer.ID("peer-2")
+ pid3 := peer.ID("peer-3")
+
+ p1 := NewPeer(pid1)
+ p2 := NewPeer(pid2)
+ p3 := NewPeer(pid3)
+
+ p2.Status = StatusCodeKnown
+ p3.Status = StatusCodeBanned
+
+ p1.Flags = PeerFlagNodeNetwork
+
+ t.Run("NewPeer", func(t *testing.T) {
+ assert.NotNil(t, p1)
+ assert.Equal(t, p1.Status, StatusCodeUnknown)
+ })
+
+ t.Run("status check", func(t *testing.T) {
+ unknown := p1.IsKnownOrTrusty()
+ known := p2.IsKnownOrTrusty()
+ banned := p3.IsBanned()
+
+ assert.False(t, unknown)
+ assert.True(t, known)
+ assert.True(t, banned)
+ })
+
+ t.Run("is node network", func(t *testing.T) {
+ nodeNetwork := p1.IsNodeNetwork()
+ notNodeNetwork := p2.IsNodeNetwork()
+
+ assert.True(t, nodeNetwork)
+ assert.False(t, notNodeNetwork)
+ })
+}
diff --git a/sync/sync.go b/sync/sync.go
index 9cad14b2b..9c96421aa 100644
--- a/sync/sync.go
+++ b/sync/sync.go
@@ -43,7 +43,7 @@ type synchronizer struct {
networkCh <-chan network.Event
network network.Network
heartBeatTicker *time.Ticker
- logger *logger.Logger
+ logger *logger.SubLogger
}
func NewSynchronizer(
@@ -65,7 +65,7 @@ func NewSynchronizer(
}
peerSet := peerset.NewPeerSet(conf.SessionTimeout)
- logger := logger.NewLogger("_sync", sync)
+ logger := logger.NewSubLogger("_sync", sync)
firewall := firewall.NewFirewall(conf.Firewall, net, peerSet, state, logger)
cache, err := cache.NewCache(conf.CacheSize)
if err != nil {
@@ -79,17 +79,17 @@ func NewSynchronizer(
handlers := make(map[message.Type]messageHandler)
- handlers[message.MessageTypeHello] = newHelloHandler(sync)
- handlers[message.MessageTypeHeartBeat] = newHeartBeatHandler(sync)
- handlers[message.MessageTypeVote] = newVoteHandler(sync)
- handlers[message.MessageTypeProposal] = newProposalHandler(sync)
- handlers[message.MessageTypeTransactions] = newTransactionsHandler(sync)
- handlers[message.MessageTypeHeartBeat] = newHeartBeatHandler(sync)
- handlers[message.MessageTypeQueryVotes] = newQueryVotesHandler(sync)
- handlers[message.MessageTypeQueryProposal] = newQueryProposalHandler(sync)
- handlers[message.MessageTypeBlockAnnounce] = newBlockAnnounceHandler(sync)
- handlers[message.MessageTypeBlocksRequest] = newBlocksRequestHandler(sync)
- handlers[message.MessageTypeBlocksResponse] = newBlocksResponseHandler(sync)
+ handlers[message.TypeHello] = newHelloHandler(sync)
+ handlers[message.TypeHeartBeat] = newHeartBeatHandler(sync)
+ handlers[message.TypeVote] = newVoteHandler(sync)
+ handlers[message.TypeProposal] = newProposalHandler(sync)
+ handlers[message.TypeTransactions] = newTransactionsHandler(sync)
+ handlers[message.TypeHeartBeat] = newHeartBeatHandler(sync)
+ handlers[message.TypeQueryVotes] = newQueryVotesHandler(sync)
+ handlers[message.TypeQueryProposal] = newQueryProposalHandler(sync)
+ handlers[message.TypeBlockAnnounce] = newBlockAnnounceHandler(sync)
+ handlers[message.TypeBlocksRequest] = newBlocksRequestHandler(sync)
+ handlers[message.TypeBlocksResponse] = newBlocksResponseHandler(sync)
sync.handlers = handlers
@@ -144,17 +144,24 @@ func (sync *synchronizer) heartBeatTickerLoop() {
func (sync *synchronizer) broadcastHeartBeat() {
// Broadcast a random vote if we are inside the committee
if sync.weAreInTheCommittee() {
- v := sync.consMgr.PickRandomVote()
+ _, round := sync.consMgr.HeightRound()
+ v := sync.consMgr.PickRandomVote(round)
if v != nil {
msg := message.NewVoteMessage(v)
sync.broadcast(msg)
}
- }
- height, round := sync.consMgr.HeightRound()
- if height > 0 {
- msg := message.NewHeartBeatMessage(height, round, sync.state.LastBlockHash())
- sync.broadcast(msg)
+ height, round := sync.consMgr.HeightRound()
+ if height > 0 {
+ msg := message.NewHeartBeatMessage(height, round, sync.state.LastBlockHash())
+ sync.broadcast(msg)
+ }
+ } else {
+ height := sync.state.LastBlockHeight()
+ if height > 0 {
+ msg := message.NewHeartBeatMessage(height, -1, sync.state.LastBlockHash())
+ sync.broadcast(msg)
+ }
}
}
@@ -170,7 +177,9 @@ func (sync *synchronizer) sayHello(helloAck bool) {
sync.SelfID(),
sync.config.Moniker,
sync.state.LastBlockHeight(),
- flags, sync.state.Genesis().Hash())
+ flags,
+ sync.state.LastBlockHash(),
+ sync.state.Genesis().Hash())
for _, signer := range sync.signers {
signer.SignMsg(msg)
@@ -235,7 +244,7 @@ func (sync *synchronizer) processIncomingBundle(bdl *bundle.Bundle) error {
return h.ParseMessage(bdl.Message, bdl.Initiator)
}
-func (sync *synchronizer) Fingerprint() string {
+func (sync *synchronizer) String() string {
return fmt.Sprintf("{☍ %d ⛃ %d ⇈ %d ↑ %d}",
sync.peerSet.Len(),
sync.cache.Len(),
@@ -318,7 +327,8 @@ func (sync *synchronizer) sendTo(msg message.Message, to peer.ID, sessionID int)
sync.logger.Info("sending bundle to a peer", "bundle", bdl, "to", to)
sync.peerSet.IncreaseSendSuccessCounter(to)
}
- sync.peerSet.IncreaseTotalSentBytesCounter(len(data))
+
+ sync.peerSet.IncreaseSentBytesCounter(msg.Type(), int64(len(data)), &to)
}
}
@@ -334,7 +344,7 @@ func (sync *synchronizer) broadcast(msg message.Message) {
} else {
sync.logger.Info("broadcasting new bundle", "bundle", bdl)
}
- sync.peerSet.IncreaseTotalSentBytesCounter(len(data))
+ sync.peerSet.IncreaseSentBytesCounter(msg.Type(), int64(len(data)), nil)
}
}
@@ -473,11 +483,6 @@ func (sync *synchronizer) updateSession(sessionID int, pid peer.ID, code message
sync.peerSet.IncreaseSendFailedCounter(pid)
sync.updateBlockchain()
- case message.ResponseCodeBusy:
- sync.logger.Debug("peer is busy. close session", "session-id", sessionID)
- sync.peerSet.CloseSession(sessionID)
- sync.updateBlockchain()
-
case message.ResponseCodeMoreBlocks:
sync.logger.Debug("peer responding us. keep session open", "session-id", sessionID)
diff --git a/sync/sync_test.go b/sync/sync_test.go
index 775213a7a..6db2abc83 100644
--- a/sync/sync_test.go
+++ b/sync/sync_test.go
@@ -37,8 +37,8 @@ type testData struct {
broadcastCh chan message.Message
}
-type OverrideFingerprint struct {
- sync Synchronizer
+type OverrideStringer struct {
+ sync *synchronizer
name string
}
@@ -46,8 +46,8 @@ func init() {
LatestBlockInterval = 23
}
-func (o *OverrideFingerprint) Fingerprint() string {
- return o.name + o.sync.Fingerprint()
+func (o *OverrideStringer) String() string {
+ return o.name + o.sync.String()
}
func testConfig() *Config {
@@ -102,8 +102,8 @@ func setup(t *testing.T, config *Config) *testData {
assert.NoError(t, td.sync.Start())
assert.Equal(t, td.sync.Moniker(), config.Moniker)
- td.shouldPublishMessageWithThisType(t, network, message.MessageTypeHello) // Alice key 1
- td.shouldPublishMessageWithThisType(t, network, message.MessageTypeHello) // Alice key 2
+ td.shouldPublishMessageWithThisType(t, network, message.TypeHello) // Alice key 1
+ td.shouldPublishMessageWithThisType(t, network, message.TypeHello) // Alice key 2
logger.Info("setup finished, running the tests", "name", t.Name())
@@ -137,7 +137,7 @@ func shouldPublishMessageWithThisType(t *testing.T, net *network.MockNetwork, ms
require.False(t, util.IsFlagSet(bdl.Flags, bundle.BundleFlagBroadcasted), "invalid flag: %v", bdl)
}
- if bdl.Message.Type() == message.MessageTypeHello {
+ if bdl.Message.Type() == message.TypeHello {
require.True(t, util.IsFlagSet(bdl.Flags, bundle.BundleFlagHelloMessage), "invalid flag: %v", bdl)
} else {
require.False(t, util.IsFlagSet(bdl.Flags, bundle.BundleFlagHelloMessage), "invalid flag: %v", bdl)
@@ -202,7 +202,7 @@ func (td *testData) addPeerToCommittee(t *testing.T, pid peer.ID, pub crypto.Pub
td.addPeer(t, pub, pid, true)
val := validator.NewValidator(pub.(*bls.PublicKey), td.RandInt32(1000))
// Note: This may not be completely accurate, but it poses no harm for testing purposes.
- val.UpdateLastJoinedHeight(td.state.TestCommittee.Proposer(0).LastJoinedHeight() + 1)
+ val.UpdateLastSortitionHeight(td.state.TestCommittee.Proposer(0).LastSortitionHeight() + 1)
td.state.TestStore.UpdateValidator(val)
td.state.TestCommittee.Update(0, []*validator.Validator{val})
require.True(t, td.state.TestCommittee.Contains(pub.Address()))
@@ -244,13 +244,13 @@ func TestDownload(t *testing.T) {
t.Run("try to query latest blocks, but the peer is not known", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
})
t.Run("try to download blocks, but the peer is not known", func(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
})
t.Run("try to download blocks, but the peer is not a network node", func(t *testing.T) {
@@ -259,7 +259,7 @@ func TestDownload(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendSuccess, 0)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendFailed, 0)
})
@@ -270,7 +270,7 @@ func TestDownload(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendSuccess, 1)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendFailed, 0)
@@ -280,9 +280,10 @@ func TestDownload(t *testing.T) {
t.Run("download request is rejected", func(t *testing.T) {
session := td.sync.peerSet.OpenSession(pid)
- msg2 := message.NewBlocksResponseMessage(message.ResponseCodeRejected, session.SessionID(), 1, nil, nil)
+ msg2 := message.NewBlocksResponseMessage(message.ResponseCodeRejected, message.ResponseCodeRejected.String(),
+ session.SessionID(), 1, nil, nil)
assert.NoError(t, td.receivingNewMessage(td.sync, msg2, pid))
- bdl := td.shouldPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ bdl := td.shouldPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendSuccess, 2)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendFailed, 1)
@@ -296,7 +297,7 @@ func TestDownload(t *testing.T) {
assert.NoError(t, td.receivingNewMessage(td.sync, msg, pid))
- td.shouldNotPublishMessageWithThisType(t, td.network, message.MessageTypeBlocksRequest)
+ td.shouldNotPublishMessageWithThisType(t, td.network, message.TypeBlocksRequest)
assert.Equal(t, td.sync.peerSet.GetPeer(pid).SendSuccess, 2)
// Since the test pid is the only peer in the peerSet list, it always tries to connect to it.
// After the second attempt, the requested height is higher than that of the test peer.
diff --git a/txpool/interface.go b/txpool/interface.go
index a1d33a1b4..ddb0505a1 100644
--- a/txpool/interface.go
+++ b/txpool/interface.go
@@ -11,7 +11,6 @@ type Reader interface {
PendingTx(id tx.ID) *tx.Tx
HasTx(id tx.ID) bool
Size() int
- Fingerprint() string
}
type TxPool interface {
diff --git a/txpool/mock.go b/txpool/mock.go
index 696776d2e..4664cf0f7 100644
--- a/txpool/mock.go
+++ b/txpool/mock.go
@@ -46,7 +46,7 @@ func (m *MockTxPool) Size() int {
return len(m.Txs)
}
-func (m *MockTxPool) Fingerprint() string {
+func (m *MockTxPool) String() string {
return ""
}
diff --git a/txpool/pool.go b/txpool/pool.go
index b12e32d67..080d14ea6 100644
--- a/txpool/pool.go
+++ b/txpool/pool.go
@@ -22,7 +22,7 @@ type txPool struct {
sandbox sandbox.Sandbox
pools map[payload.Type]*linkedmap.LinkedMap[tx.ID, *tx.Tx]
broadcastCh chan message.Message
- logger *logger.Logger
+ logger *logger.SubLogger
}
func NewTxPool(conf *Config, broadcastCh chan message.Message) TxPool {
@@ -41,7 +41,7 @@ func NewTxPool(conf *Config, broadcastCh chan message.Message) TxPool {
broadcastCh: broadcastCh,
}
- pool.logger = logger.NewLogger("_pool", pool)
+ pool.logger = logger.NewSubLogger("_pool", pool)
return pool
}
@@ -207,7 +207,7 @@ func (p *txPool) Size() int {
return size
}
-func (p *txPool) Fingerprint() string {
+func (p *txPool) String() string {
return fmt.Sprintf("{💸 %v 🔐 %v 🔓 %v 🎯 %v 🧾 %v}",
p.pools[payload.PayloadTypeTransfer].Size(),
p.pools[payload.PayloadTypeBond].Size(),
diff --git a/txpool/pool_test.go b/txpool/pool_test.go
index 2f414f30a..c03d3177d 100644
--- a/txpool/pool_test.go
+++ b/txpool/pool_test.go
@@ -59,7 +59,7 @@ func (td *testData) shouldPublishTransaction(t *testing.T, id tx.ID) {
case msg := <-td.ch:
logger.Info("shouldPublishTransaction", "message", msg)
- if msg.Type() == message.MessageTypeTransactions {
+ if msg.Type() == message.TypeTransactions {
m := msg.(*message.TransactionsMessage)
assert.Equal(t, m.Transactions[0].ID(), id)
return
diff --git a/types/block/block.go b/types/block/block.go
index 3d08e89e3..f3a60e33f 100644
--- a/types/block/block.go
+++ b/types/block/block.go
@@ -117,11 +117,11 @@ func (b *Block) Stamp() hash.Stamp {
return b.Hash().Stamp()
}
-func (b *Block) Fingerprint() string {
+func (b *Block) String() string {
return fmt.Sprintf("{⌘ %v 👤 %v 💻 %v 📨 %d}",
- b.Hash().Fingerprint(),
- b.data.Header.ProposerAddress().Fingerprint(),
- b.data.Header.StateRoot().Fingerprint(),
+ b.Hash().ShortString(),
+ b.data.Header.ProposerAddress().ShortString(),
+ b.data.Header.StateRoot().ShortString(),
b.data.Txs.Len(),
)
}
diff --git a/types/block/block_test.go b/types/block/block_test.go
index 9a8438532..0f3e681f0 100644
--- a/types/block/block_test.go
+++ b/types/block/block_test.go
@@ -180,11 +180,8 @@ func TestBlockHash(t *testing.T) {
headerSize := b.Header().SerializeSize()
headerData := d[:headerSize]
- // TODO: uncomment this comment later
- // TODO: make HashBytes unexported
- // certSize := b.PrevCertificate().SerializeSize()
- // certData := d[headerSize : headerSize+certSize]
- certData := b.PrevCertificate().HashBytes()
+ certSize := b.PrevCertificate().SerializeSize()
+ certData := d[headerSize : headerSize+certSize]
certHash := hash.CalcHash(certData)
txHashes := make([]hash.Hash, 0)
@@ -199,10 +196,10 @@ func TestBlockHash(t *testing.T) {
hashData = append(hashData, util.Int32ToSlice(int32(b.Transactions().Len()))...)
expected1 := hash.CalcHash(hashData)
- expected2, _ := hash.FromString("aa0244a7464e2d7318d0f0bf40218fcd5cc0a0d8746e29348666160e6b58a20c")
+ expected2, _ := hash.FromString("285ed60d44c0650e27fb25d5adc4b2cc5e35a2ba61f9c2f9d10f2de0251aee45")
assert.Equal(t, b.Hash(), expected1)
assert.Equal(t, b.Hash(), expected2)
- assert.Equal(t, b.Stamp(), hash.Stamp{0xaa, 0x02, 0x44, 0xa7})
+ assert.Equal(t, b.Stamp(), hash.Stamp{0x28, 0x5e, 0xd6, 0x0d})
}
func TestMakeBlock(t *testing.T) {
diff --git a/types/block/certificate.go b/types/block/certificate.go
index 6404a8d46..3abdf2245 100644
--- a/types/block/certificate.go
+++ b/types/block/certificate.go
@@ -35,10 +35,21 @@ func NewCertificate(round int16, committers, absentees []int32, signature *bls.S
return cert
}
-func (cert *Certificate) Round() int16 { return cert.data.Round }
-func (cert *Certificate) Committers() []int32 { return cert.data.Committers }
-func (cert *Certificate) Absentees() []int32 { return cert.data.Absentees }
-func (cert *Certificate) Signature() *bls.Signature { return cert.data.Signature }
+func (cert *Certificate) Round() int16 {
+ return cert.data.Round
+}
+
+func (cert *Certificate) Committers() []int32 {
+ return cert.data.Committers
+}
+
+func (cert *Certificate) Absentees() []int32 {
+ return cert.data.Absentees
+}
+
+func (cert *Certificate) Signature() *bls.Signature {
+ return cert.data.Signature
+}
func (cert *Certificate) SanityCheck() error {
if cert.Round() < 0 {
@@ -61,35 +72,13 @@ func (cert *Certificate) SanityCheck() error {
return nil
}
-// Remove this function later
-// read below comment
-func (cert *Certificate) HashBytes() []byte {
+func (cert *Certificate) Hash() hash.Hash {
w := bytes.NewBuffer(make([]byte, 0, cert.SerializeSize()))
- if err := encoding.WriteVarInt(w, uint64(cert.Round())); err != nil {
- return nil
+ if err := cert.Encode(w); err != nil {
+ return hash.UndefHash
}
- if err := encoding.WriteVarInt(w, uint64(len(cert.data.Absentees))); err != nil {
- return nil
- }
- for _, n := range cert.data.Absentees {
- if err := encoding.WriteVarInt(w, uint64(n)); err != nil {
- return nil
- }
- }
- if err := cert.data.Signature.Encode(w); err != nil {
- return nil
- }
- return w.Bytes()
-}
-
-func (cert *Certificate) Hash() hash.Hash {
- // TODO: Add a comment on certificate hash
- // Technically, we don't need to include the committers list inside the certificate.
- // At each height, the committers are the same as the committee members.
- // As a possible enhancement in the future, we can remove the committers from the certificate.
- // In this case, increasing the committee size won't increase the size of the certificate.
- return hash.CalcHash(cert.HashBytes())
+ return hash.CalcHash(w.Bytes())
}
// SerializeSize returns the number of bytes it would take to serialize the block.
diff --git a/types/block/certificate_test.go b/types/block/certificate_test.go
index 0030c4029..2f0fde365 100644
--- a/types/block/certificate_test.go
+++ b/types/block/certificate_test.go
@@ -109,16 +109,3 @@ func TestCertificateHash(t *testing.T) {
assert.Equal(t, cert3.Absentees(), []int32{18})
assert.NoError(t, cert3.SanityCheck())
}
-
-// This test ensures that committers are not part of the certificate hash
-// We can remove this tests if we remove the committers from the certificate
-// This test is not logical, since we have two certificate for the same block
-func TestCertificateHashWithoutCommitters(t *testing.T) {
- ts := testsuite.NewTestSuite(t)
-
- temp := ts.GenerateTestCertificate(ts.RandomHash())
- cert1 := block.NewCertificate(temp.Round(), []int32{1, 2, 3, 4}, []int32{2}, temp.Signature())
- cert2 := block.NewCertificate(temp.Round(), []int32{1, 2, 3, 4, 5}, []int32{2}, temp.Signature())
-
- assert.Equal(t, cert1.Hash(), cert2.Hash())
-}
diff --git a/types/proposal/proposal.go b/types/proposal/proposal.go
index 5f2bffa7d..84046ae5d 100644
--- a/types/proposal/proposal.go
+++ b/types/proposal/proposal.go
@@ -95,7 +95,7 @@ func (p *Proposal) IsForBlock(hash hash.Hash) bool {
return p.Block().Hash().EqualsTo(hash)
}
-func (p Proposal) Fingerprint() string {
+func (p Proposal) String() string {
b := p.Block()
- return fmt.Sprintf("{%v/%v 🗃 %v}", p.data.Height, p.data.Round, b.Fingerprint())
+ return fmt.Sprintf("{%v/%v 🗃 %v}", p.data.Height, p.data.Round, b.String())
}
diff --git a/types/tx/payload/bond.go b/types/tx/payload/bond.go
index 4c0090ddc..854467faa 100644
--- a/types/tx/payload/bond.go
+++ b/types/tx/payload/bond.go
@@ -103,9 +103,9 @@ func (p *BondPayload) Decode(r io.Reader) error {
return nil
}
-func (p *BondPayload) Fingerprint() string {
+func (p *BondPayload) String() string {
return fmt.Sprintf("{Bond 🔐 %v->%v %v",
- p.Sender.Fingerprint(),
- p.Receiver.Fingerprint(),
+ p.Sender.ShortString(),
+ p.Receiver.ShortString(),
p.Stake)
}
diff --git a/types/tx/payload/payload.go b/types/tx/payload/payload.go
index 51f6912fe..0051e106e 100644
--- a/types/tx/payload/payload.go
+++ b/types/tx/payload/payload.go
@@ -41,5 +41,5 @@ type Payload interface {
Encode(io.Writer) error
Decode(io.Reader) error
SanityCheck() error
- Fingerprint() string
+ String() string
}
diff --git a/types/tx/payload/sortition.go b/types/tx/payload/sortition.go
index 021444a9d..8f4442a5f 100644
--- a/types/tx/payload/sortition.go
+++ b/types/tx/payload/sortition.go
@@ -47,7 +47,7 @@ func (p *SortitionPayload) Decode(r io.Reader) error {
return encoding.ReadElements(r, &p.Address, &p.Proof)
}
-func (p *SortitionPayload) Fingerprint() string {
+func (p *SortitionPayload) String() string {
return fmt.Sprintf("{Sortition 🎯 %v",
- p.Address.Fingerprint())
+ p.Address.ShortString())
}
diff --git a/types/tx/payload/transfer.go b/types/tx/payload/transfer.go
index 8c4a3e04b..f60938219 100644
--- a/types/tx/payload/transfer.go
+++ b/types/tx/payload/transfer.go
@@ -92,9 +92,9 @@ func (p *TransferPayload) Decode(r io.Reader) error {
return nil
}
-func (p *TransferPayload) Fingerprint() string {
+func (p *TransferPayload) String() string {
return fmt.Sprintf("{Send 💸 %v->%v %v",
- p.Sender.Fingerprint(),
- p.Receiver.Fingerprint(),
+ p.Sender.ShortString(),
+ p.Receiver.ShortString(),
p.Amount)
}
diff --git a/types/tx/payload/unbond.go b/types/tx/payload/unbond.go
index 121dc6777..d2df55c13 100644
--- a/types/tx/payload/unbond.go
+++ b/types/tx/payload/unbond.go
@@ -46,8 +46,8 @@ func (p *UnbondPayload) Decode(r io.Reader) error {
return encoding.ReadElements(r, &p.Validator)
}
-func (p *UnbondPayload) Fingerprint() string {
+func (p *UnbondPayload) String() string {
return fmt.Sprintf("{Unbond 🔓 %v",
- p.Validator.Fingerprint(),
+ p.Validator.ShortString(),
)
}
diff --git a/types/tx/payload/withdraw.go b/types/tx/payload/withdraw.go
index 299d42cc6..ac8e6f443 100644
--- a/types/tx/payload/withdraw.go
+++ b/types/tx/payload/withdraw.go
@@ -64,9 +64,9 @@ func (p *WithdrawPayload) Decode(r io.Reader) error {
return nil
}
-func (p *WithdrawPayload) Fingerprint() string {
+func (p *WithdrawPayload) String() string {
return fmt.Sprintf("{WithdrawPayload 🧾 %v->%v %v",
- p.From.Fingerprint(),
- p.To.Fingerprint(),
+ p.From.ShortString(),
+ p.To.ShortString(),
p.Amount)
}
diff --git a/types/tx/tx.go b/types/tx/tx.go
index e02cfbd75..f781931a9 100644
--- a/types/tx/tx.go
+++ b/types/tx/tx.go
@@ -381,11 +381,11 @@ func (tx *Tx) Decode(r io.Reader) error {
return nil
}
-func (tx *Tx) Fingerprint() string {
+func (tx *Tx) String() string {
return fmt.Sprintf("{⌘ %v 🏵 %v %v}",
- tx.ID().Fingerprint(),
+ tx.ID().ShortString(),
tx.data.Stamp.String(),
- tx.data.Payload.Fingerprint())
+ tx.data.Payload.String())
}
func (tx *Tx) SignBytes() []byte {
diff --git a/types/validator/validator.go b/types/validator/validator.go
index a5d36b1b3..fa8396618 100644
--- a/types/validator/validator.go
+++ b/types/validator/validator.go
@@ -17,13 +17,13 @@ type Validator struct {
// validatorData contains the data associated with a validator.
type validatorData struct {
- PublicKey *bls.PublicKey
- Number int32
- Sequence int32
- Stake int64
- LastBondingHeight uint32
- UnbondingHeight uint32
- LastJoinedHeight uint32
+ PublicKey *bls.PublicKey
+ Number int32
+ Sequence int32
+ Stake int64
+ LastBondingHeight uint32
+ UnbondingHeight uint32
+ LastSortitionHeight uint32
}
// NewValidator constructs a new validator from the given public key and number.
@@ -53,7 +53,7 @@ func FromBytes(data []byte) (*Validator, error) {
&acc.data.Stake,
&acc.data.LastBondingHeight,
&acc.data.UnbondingHeight,
- &acc.data.LastJoinedHeight,
+ &acc.data.LastSortitionHeight,
)
if err != nil {
@@ -98,9 +98,9 @@ func (val *Validator) UnbondingHeight() uint32 {
return val.data.UnbondingHeight
}
-// LastJoinedHeight returns the last height in which the validator joined the committee.
-func (val *Validator) LastJoinedHeight() uint32 {
- return val.data.LastJoinedHeight
+// LastSortitionHeight returns the last height in which the validator evaluated sortition.
+func (val *Validator) LastSortitionHeight() uint32 {
+ return val.data.LastSortitionHeight
}
// Power returns the power of the validator.
@@ -131,8 +131,8 @@ func (val *Validator) IncSequence() {
}
// UpdateLastJoinedHeight updates the last height at which the validator joined the committee.
-func (val *Validator) UpdateLastJoinedHeight(height uint32) {
- val.data.LastJoinedHeight = height
+func (val *Validator) UpdateLastSortitionHeight(height uint32) {
+ val.data.LastSortitionHeight = height
}
// UpdateLastBondingHeight updates the last height at which the validator bonded some stakes.
@@ -173,7 +173,7 @@ func (val *Validator) Bytes() ([]byte, error) {
val.data.Stake,
val.data.LastBondingHeight,
val.data.UnbondingHeight,
- val.data.LastJoinedHeight)
+ val.data.LastSortitionHeight)
if err != nil {
return nil, err
}
diff --git a/types/validator/validator_test.go b/types/validator/validator_test.go
index a60d76f2c..9fd08293e 100644
--- a/types/validator/validator_test.go
+++ b/types/validator/validator_test.go
@@ -2,7 +2,6 @@ package validator_test
import (
"encoding/hex"
- "fmt"
"testing"
"github.com/pactus-project/pactus/crypto/bls"
@@ -17,9 +16,8 @@ func TestFromBytes(t *testing.T) {
ts := testsuite.NewTestSuite(t)
val, _ := ts.GenerateTestValidator(ts.RandInt32(1000000))
- fmt.Println(val.PublicKey().Address().String())
val.UpdateLastBondingHeight(ts.RandUint32(1000000))
- val.UpdateLastJoinedHeight(ts.RandUint32(1000000))
+ val.UpdateLastSortitionHeight(ts.RandUint32(1000000))
val.UpdateUnbondingHeight(ts.RandUint32(1000000))
bs, err := val.Bytes()
require.NoError(t, err)
@@ -31,7 +29,7 @@ func TestFromBytes(t *testing.T) {
assert.Equal(t, val.Number(), val2.Number())
assert.Equal(t, val.Stake(), val2.Stake())
assert.Equal(t, val.LastBondingHeight(), val2.LastBondingHeight())
- assert.Equal(t, val.LastJoinedHeight(), val2.LastJoinedHeight())
+ assert.Equal(t, val.LastSortitionHeight(), val2.LastSortitionHeight())
assert.Equal(t, val.UnbondingHeight(), val2.UnbondingHeight())
_, err = validator.FromBytes([]byte("asdfghjkl"))
diff --git a/types/vote/vote.go b/types/vote/vote.go
index 4dbe0bdcb..080cf6782 100644
--- a/types/vote/vote.go
+++ b/types/vote/vote.go
@@ -107,12 +107,12 @@ func (v *Vote) SanityCheck() error {
return nil
}
-func (v *Vote) Fingerprint() string {
+func (v *Vote) String() string {
return fmt.Sprintf("{%v/%d/%s ⌘ %v 👤 %s}",
v.Height(),
v.Round(),
v.Type(),
- v.BlockHash().Fingerprint(),
- v.Signer().Fingerprint(),
+ v.BlockHash().ShortString(),
+ v.Signer().ShortString(),
)
}
diff --git a/util/logger/logger.go b/util/logger/logger.go
index 45bf8800e..9ea823121 100644
--- a/util/logger/logger.go
+++ b/util/logger/logger.go
@@ -3,33 +3,30 @@ package logger
import (
"encoding/hex"
"fmt"
- "reflect"
+ "os"
- "github.com/sirupsen/logrus"
+ "github.com/rs/zerolog"
+ "github.com/rs/zerolog/log"
)
-type fingerprintable interface {
- Fingerprint() string
-}
-
-type loggers struct {
- config *Config
- loggers map[string]*Logger
+type logger struct {
+ config *Config
+ subs map[string]*SubLogger
}
var (
- loggersInst *loggers
+ globalInst *logger
)
-type Logger struct {
- logger *logrus.Logger
+type SubLogger struct {
+ logger zerolog.Logger
name string
- obj interface{}
+ obj fmt.Stringer
}
-func getLoggersInst() *loggers {
- if loggersInst == nil {
- // Only during tests the loggersInst is nil
+func getLoggersInst() *logger {
+ if globalInst == nil {
+ // Only during tests the globalInst is nil
conf := &Config{
Levels: make(map[string]string),
@@ -43,184 +40,139 @@ func getLoggersInst() *loggers {
conf.Levels["_pool"] = "debug"
conf.Levels["_http"] = "debug"
conf.Levels["_grpc"] = "debug"
- loggersInst = &loggers{
- config: conf,
- loggers: make(map[string]*Logger),
+ globalInst = &logger{
+ config: conf,
+ subs: make(map[string]*SubLogger),
}
}
- return loggersInst
+ return globalInst
}
-func InitLogger(conf *Config) {
- if loggersInst == nil {
- loggersInst = &loggers{
- config: conf,
- loggers: make(map[string]*Logger),
+func InitGlobalLogger(conf *Config) {
+ if globalInst == nil {
+ globalInst = &logger{
+ config: conf,
+ subs: make(map[string]*SubLogger),
}
if conf.Colorful {
- logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true})
- } else {
- logrus.SetFormatter(&logrus.TextFormatter{DisableColors: true})
+ log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
}
- lvl, err := logrus.ParseLevel(conf.Levels["default"])
+ lvl, err := zerolog.ParseLevel(conf.Levels["default"])
if err == nil {
- logrus.SetLevel(lvl)
+ zerolog.SetGlobalLevel(lvl)
}
}
}
-func NewLogger(name string, obj interface{}) *Logger {
- l := &Logger{
- logger: logrus.New(),
- name: name,
- obj: obj,
- }
- if getLoggersInst().config.Colorful {
- l.logger.SetFormatter(&logrus.TextFormatter{ForceColors: true})
- } else {
- l.logger.SetFormatter(&logrus.TextFormatter{DisableColors: true})
- }
-
- lvl := getLoggersInst().config.Levels[name]
- if lvl == "" {
- lvl = getLoggersInst().config.Levels["default"]
- }
-
- level, err := logrus.ParseLevel(lvl)
- if err == nil {
- l.SetLevel(level)
- }
-
- getLoggersInst().loggers[name] = l
- return l
-}
-
-func isNil(i interface{}) bool {
- if i == nil {
- return true
- }
- switch reflect.TypeOf(i).Kind() {
- case reflect.Ptr:
- return reflect.ValueOf(i).IsNil()
- }
- return false
-}
-
-func keyvalsToFields(keyvals ...interface{}) logrus.Fields {
+func addFields(event *zerolog.Event, keyvals ...interface{}) *zerolog.Event {
if len(keyvals)%2 != 0 {
- keyvals = append(keyvals, "")
+ keyvals = append(keyvals, "!MISSING-VALUE!")
}
- fields := make(logrus.Fields)
for i := 0; i < len(keyvals); i += 2 {
key, ok := keyvals[i].(string)
if !ok {
- key = "invalid-key"
+ key = "!INVALID-KEY!"
}
///
- val := "nil"
switch v := keyvals[i+1].(type) {
- case fingerprintable:
- if !isNil(v) {
- val = fmt.Sprintf("%v", v.Fingerprint())
- }
+ case fmt.Stringer:
+ event.Stringer(key, v)
case []byte:
- {
- val = fmt.Sprintf("%v", hex.EncodeToString(v))
- }
+ event.Str(key, fmt.Sprintf("%v", hex.EncodeToString(v)))
default:
- val = fmt.Sprintf("%v", keyvals[i+1])
+ event.Any(key, v)
}
- fields[key] = val
}
-
- return fields
+ return event
}
-func (l *Logger) SetLevel(level logrus.Level) {
- l.logger.SetLevel(level)
-}
+func NewSubLogger(name string, obj fmt.Stringer) *SubLogger {
+ sl := &SubLogger{
+ logger: zerolog.New(os.Stderr).With().Timestamp().Logger(),
+ name: name,
+ obj: obj,
+ }
-func (l *Logger) withDefaultFields() *logrus.Entry {
- var fields logrus.Fields
- if f, ok := l.obj.(fingerprintable); ok {
- fields = keyvalsToFields(l.name, f.Fingerprint())
- } else {
- fields = keyvalsToFields("module", l.name)
+ if getLoggersInst().config.Colorful {
+ sl.logger = sl.logger.Output(zerolog.ConsoleWriter{Out: os.Stderr})
}
- return l.logger.WithFields(fields)
-}
-func (l *Logger) log(level logrus.Level, msg string, keyvals ...interface{}) {
- if l.logger.IsLevelEnabled(level) {
- l.withDefaultFields().WithFields(keyvalsToFields(keyvals...)).Log(level, msg)
+ lvlStr := getLoggersInst().config.Levels[name]
+ if lvlStr == "" {
+ lvlStr = getLoggersInst().config.Levels["default"]
+ }
+
+ lvl, err := zerolog.ParseLevel(lvlStr)
+ if err == nil {
+ sl.logger.Level(lvl)
}
-}
-func (l *Logger) With(keyvals ...interface{}) *logrus.Entry {
- fields := keyvalsToFields(keyvals...)
- return l.logger.WithFields(fields)
+ getLoggersInst().subs[name] = sl
+ return sl
}
-func (l *Logger) Trace(msg string, keyvals ...interface{}) {
- l.log(logrus.TraceLevel, msg, keyvals...)
+func (sl *SubLogger) logObj(event *zerolog.Event, msg string, keyvals ...interface{}) {
+ if sl.obj != nil {
+ addFields(event.Str(sl.name, sl.obj.String()), keyvals...).Msg(msg)
+ } else {
+ addFields(event, keyvals...).Msg(msg)
+ }
}
-func (l *Logger) Debug(msg string, keyvals ...interface{}) {
- l.log(logrus.DebugLevel, msg, keyvals...)
+func (sl *SubLogger) Trace(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Trace(), msg, keyvals...)
}
-func (l *Logger) Info(msg string, keyvals ...interface{}) {
- l.log(logrus.InfoLevel, msg, keyvals...)
+func (sl *SubLogger) Debug(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Debug(), msg, keyvals...)
}
-func (l *Logger) Warn(msg string, keyvals ...interface{}) {
- l.log(logrus.WarnLevel, msg, keyvals...)
+func (sl *SubLogger) Info(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Info(), msg, keyvals...)
}
-func (l *Logger) Error(msg string, keyvals ...interface{}) {
- l.log(logrus.ErrorLevel, msg, keyvals...)
+func (sl *SubLogger) Warn(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Warn(), msg, keyvals...)
}
-func (l *Logger) Fatal(msg string, keyvals ...interface{}) {
- l.log(logrus.FatalLevel, msg, keyvals...)
+func (sl *SubLogger) Error(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Error(), msg, keyvals...)
}
-func (l *Logger) Panic(msg string, keyvals ...interface{}) {
- l.log(logrus.PanicLevel, msg, keyvals...)
+func (sl *SubLogger) Fatal(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Fatal(), msg, keyvals...)
}
-func log(level logrus.Level, msg string, keyvals ...interface{}) {
- if logrus.IsLevelEnabled(level) {
- logrus.WithFields(keyvalsToFields(keyvals...)).Log(level, msg)
- }
+func (sl *SubLogger) Panic(msg string, keyvals ...interface{}) {
+ sl.logObj(sl.logger.Panic(), msg, keyvals...)
}
func Trace(msg string, keyvals ...interface{}) {
- log(logrus.TraceLevel, msg, keyvals...)
+ addFields(log.Trace(), keyvals...).Msg(msg)
}
func Debug(msg string, keyvals ...interface{}) {
- log(logrus.DebugLevel, msg, keyvals...)
+ addFields(log.Debug(), keyvals...).Msg(msg)
}
func Info(msg string, keyvals ...interface{}) {
- log(logrus.InfoLevel, msg, keyvals...)
+ addFields(log.Info(), keyvals...).Msg(msg)
}
func Warn(msg string, keyvals ...interface{}) {
- log(logrus.WarnLevel, msg, keyvals...)
+ addFields(log.Warn(), keyvals...).Msg(msg)
}
func Error(msg string, keyvals ...interface{}) {
- log(logrus.ErrorLevel, msg, keyvals...)
+ addFields(log.Error(), keyvals...).Msg(msg)
}
func Fatal(msg string, keyvals ...interface{}) {
- log(logrus.FatalLevel, msg, keyvals...)
+ addFields(log.Fatal(), keyvals...).Msg(msg)
}
func Panic(msg string, keyvals ...interface{}) {
- log(logrus.PanicLevel, msg, keyvals...)
+ addFields(log.Panic(), keyvals...).Msg(msg)
}
diff --git a/util/logger/logger_test.go b/util/logger/logger_test.go
index 6cb3945e1..7c63025b2 100644
--- a/util/logger/logger_test.go
+++ b/util/logger/logger_test.go
@@ -5,64 +5,34 @@ import (
"fmt"
"testing"
- "github.com/sirupsen/logrus"
+ "github.com/rs/zerolog/log"
"github.com/stretchr/testify/assert"
)
type Foo struct{}
-func (f Foo) Fingerprint() string {
+func (f Foo) String() string {
return "foo"
}
-type Bar struct{}
-
-func (b *Bar) Fingerprint() string {
- return "bar"
-}
-func TestFingerprint(t *testing.T) {
- f1 := Foo{}
- f2 := &Foo{}
- b1 := Bar{}
- b2 := &Bar{}
-
- assert.Equal(t, keyvalsToFields("key", f1)["key"], "foo")
- assert.Equal(t, keyvalsToFields("key", &f1)["key"], "foo")
- assert.Equal(t, keyvalsToFields("key", f2)["key"], "foo")
- assert.Equal(t, keyvalsToFields("key", b1)["key"], "{}")
- assert.Equal(t, keyvalsToFields("key", &b1)["key"], "bar")
- assert.Equal(t, keyvalsToFields("key", b2)["key"], "bar")
- assert.Nil(t, keyvalsToFields(1)["key"])
- assert.Nil(t, keyvalsToFields(nil, 1)["key"])
- assert.Nil(t, keyvalsToFields(1, nil)["key"])
-}
+func TestNilObjLogger(t *testing.T) {
+ l := NewSubLogger("test", nil)
+ var buf bytes.Buffer
+ l.logger = l.logger.Output(&buf)
-func TestNilFingerprint(t *testing.T) {
- var f1 Foo
- var f2 *Foo
- var b1 Bar
- var b2 *Bar
-
- assert.Equal(t, keyvalsToFields("key", f1)["key"], "foo")
- assert.Equal(t, keyvalsToFields("key", &f1)["key"], "foo")
- assert.Equal(t, keyvalsToFields("key", f2)["key"], "nil")
- assert.Equal(t, keyvalsToFields("key", b1)["key"], "{}")
- assert.Equal(t, keyvalsToFields("key", &b1)["key"], "bar")
- assert.Equal(t, keyvalsToFields("key", b2)["key"], "nil")
- assert.Nil(t, keyvalsToFields(1)["key"])
- assert.Nil(t, keyvalsToFields(nil, 1)["key"])
- assert.Nil(t, keyvalsToFields(1, nil)["key"])
+ l.Info("hello")
+ assert.Contains(t, buf.String(), "hello")
}
func TestObjLogger(t *testing.T) {
- loggersInst = nil
+ globalInst = nil
c := DefaultConfig()
c.Colorful = false
- InitLogger(c)
+ InitGlobalLogger(c)
- l := NewLogger("test", Foo{})
+ l := NewSubLogger("test", Foo{})
var buf bytes.Buffer
- l.logger.SetOutput(&buf)
+ l.logger = l.logger.Output(&buf)
l.Trace("a")
l.Debug("b")
@@ -81,16 +51,17 @@ func TestObjLogger(t *testing.T) {
}
func TestLogger(t *testing.T) {
- loggersInst = nil
+ globalInst = nil
c := DefaultConfig()
c.Colorful = true
- InitLogger(c)
+ InitGlobalLogger(c)
var buf bytes.Buffer
- logrus.SetOutput(&buf)
+ log.Logger = log.Output(&buf)
Trace("a")
- Debug("b", "a", nil)
+ Info("b", nil)
+ Info("b", "a", nil)
Info("c", "b", []byte{1, 2, 3})
Warn("d", "x")
Error("e", "y", Foo{})
@@ -100,10 +71,12 @@ func TestLogger(t *testing.T) {
fmt.Println(out)
assert.Contains(t, out, "foo")
assert.Contains(t, out, "010203")
- assert.Contains(t, out, "")
- assert.NotContains(t, out, "TRACE")
- assert.NotContains(t, out, "DEBU")
- assert.Contains(t, out, "INFO")
- assert.Contains(t, out, "WARN")
- assert.Contains(t, out, "ERR")
+ assert.Contains(t, out, "!INVALID-KEY!")
+ assert.Contains(t, out, "!MISSING-VALUE!")
+ assert.Contains(t, out, "null")
+ assert.NotContains(t, out, "trace")
+ assert.NotContains(t, out, "debug")
+ assert.Contains(t, out, "info")
+ assert.Contains(t, out, "warn")
+ assert.Contains(t, out, "error")
}
diff --git a/util/testsuite/testsuite.go b/util/testsuite/testsuite.go
index 4516091ce..4d96af36c 100644
--- a/util/testsuite/testsuite.go
+++ b/util/testsuite/testsuite.go
@@ -287,7 +287,7 @@ func (ts *TestSuite) GenerateTestCertificate(blockHash hash.Hash) *block.Certifi
priv3.Sign(blockHash.Bytes()).(*bls.Signature),
priv4.Sign(blockHash.Bytes()).(*bls.Signature),
}
- sig := bls.Aggregate(sigs)
+ sig := bls.SignatureAggregate(sigs)
c1 := ts.RandInt32(10)
c2 := ts.RandInt32(10) + 10
@@ -405,14 +405,13 @@ func (ts *TestSuite) GenerateTestChangeProposerVote(height uint32, round int16)
func (ts *TestSuite) GenerateTestCommittee(num int) (committee.Committee, []crypto.Signer) {
signers := make([]crypto.Signer, num)
vals := make([]*validator.Validator, num)
- h1 := ts.RandUint32(100000)
for i := int32(0); i < int32(num); i++ {
val, s := ts.GenerateTestValidator(i)
signers[i] = s
vals[i] = val
- val.UpdateLastBondingHeight(h1 + uint32(i))
- val.UpdateLastJoinedHeight(h1 + 100 + uint32(i))
+ val.UpdateLastBondingHeight(1 + uint32(i))
+ val.UpdateLastSortitionHeight(1 + uint32(i))
val.SubtractFromStake(val.Stake())
val.AddToStake(10 * 1e9)
}
diff --git a/util/utils.go b/util/utils.go
index e80bccb1f..b64dd5b45 100644
--- a/util/utils.go
+++ b/util/utils.go
@@ -6,6 +6,8 @@ import (
"math/big"
"os"
"strconv"
+
+ "golang.org/x/exp/constraints"
)
const MaxUint16 = ^uint16(0)
@@ -23,54 +25,22 @@ const MinUint64 = 0
const MaxInt64 = int64(MaxUint64 >> 1)
const MinInt64 = -MaxInt64 - 1
-// Max32 returns the biggest of two 32-bits numbers.
-func Max32(a, b int32) int32 {
- if a < b {
- return b
- }
- return a
-}
-
-// Min32 returns the smallest of two 32-bits numbers.
-func Min32(a, b int32) int32 {
- if a < b {
- return a
- }
- return b
-}
-
-// MaxU32 returns the biggest of two 32-bits unsigned numbers.
-func MaxU32(a, b uint32) uint32 {
- if a < b {
- return b
- }
- return a
-}
-
-// MinU32 returns the smallest of two 32-bits unsigned numbers.
-func MinU32(a, b uint32) uint32 {
- if a < b {
+// Max returns the biggest of two integer numbers.
+func Max[T constraints.Integer](a, b T) T {
+ if a > b {
return a
}
return b
}
-// Min64 returns the smallest of two 64-bits numbers.
-func Min64(a, b int64) int64 {
+// Min returns the smallest of two integer numbers.
+func Min[T constraints.Integer](a, b T) T {
if a < b {
return a
}
return b
}
-// Max64 returns the biggest of two 64-bits numbers.
-func Max64(a, b int64) int64 {
- if a < b {
- return b
- }
- return a
-}
-
// RandInt32 returns a random int16 in between 0 and max.
// If max set to zero or negative, the max will set to MaxInt16.
func RandInt16(max int16) int16 {
diff --git a/util/utils_test.go b/util/utils_test.go
index a711556e2..f06756e88 100644
--- a/util/utils_test.go
+++ b/util/utils_test.go
@@ -9,28 +9,28 @@ import (
)
func TestUtils(t *testing.T) {
- assert.Equal(t, Min32(1, 1), int32(1))
- assert.Equal(t, Min32(1, 2), int32(1))
- assert.Equal(t, Min32(2, 1), int32(1))
- assert.Equal(t, Max32(2, 2), int32(2))
- assert.Equal(t, Max32(1, 2), int32(2))
- assert.Equal(t, Max32(2, 1), int32(2))
-
- assert.Equal(t, MinU32(1, 1), uint32(1))
- assert.Equal(t, MinU32(1, 2), uint32(1))
- assert.Equal(t, MinU32(2, 1), uint32(1))
- assert.Equal(t, MaxU32(2, 2), uint32(2))
- assert.Equal(t, MaxU32(1, 2), uint32(2))
- assert.Equal(t, MaxU32(2, 1), uint32(2))
+ assert.Equal(t, Min(int32(1), 1), int32(1))
+ assert.Equal(t, Min(int32(1), 2), int32(1))
+ assert.Equal(t, Min(2, int32(1)), int32(1))
+ assert.Equal(t, Max(int32(2), 2), int32(2))
+ assert.Equal(t, Max(1, int32(2)), int32(2))
+ assert.Equal(t, Max(int32(2), 1), int32(2))
+
+ assert.Equal(t, Min(uint32(1), 1), uint32(1))
+ assert.Equal(t, Min(uint32(1), 2), uint32(1))
+ assert.Equal(t, Min(2, uint32(1)), uint32(1))
+ assert.Equal(t, Max(uint32(2), 2), uint32(2))
+ assert.Equal(t, Max(1, uint32(2)), uint32(2))
+ assert.Equal(t, Max(uint32(2), 1), uint32(2))
assert.Equal(t, MaxUint32, uint32(0xffffffff))
assert.Equal(t, MaxUint64, uint64(0xffffffffffffffff))
assert.Equal(t, MaxInt32, int32(0x7fffffff))
assert.Equal(t, MaxInt64, int64(0x7fffffffffffffff))
- assert.Equal(t, Max64(MaxInt64, 1), MaxInt64)
- assert.Equal(t, Max64(MinInt64, MaxInt64), MaxInt64)
- assert.Equal(t, Min64(MaxInt64, 1), int64(1))
- assert.Equal(t, Min64(MinInt64, MaxInt64), MinInt64)
+ assert.Equal(t, Max(MaxInt64, 1), MaxInt64)
+ assert.Equal(t, Max(MinInt64, MaxInt64), MaxInt64)
+ assert.Equal(t, Min(MaxInt64, 1), int64(1))
+ assert.Equal(t, Min(MinInt64, MaxInt64), MinInt64)
}
func TestSetFlags(t *testing.T) {
diff --git a/wallet/client.go b/wallet/client.go
index 6623b0ad9..67684fdc8 100644
--- a/wallet/client.go
+++ b/wallet/client.go
@@ -6,6 +6,7 @@ import (
"github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/crypto/hash"
"github.com/pactus-project/pactus/types/tx"
+ "github.com/pactus-project/pactus/types/tx/payload"
pactus "github.com/pactus-project/pactus/www/grpc/gen/go"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
@@ -73,6 +74,7 @@ func (c *grpcClient) sendTx(tx *tx.Tx) (tx.ID, error) {
return hash.FromBytes(res.Id)
}
+// TODO: check the return value type
func (c *grpcClient) getTransaction(id tx.ID) (*pactus.GetTransactionResponse, error) {
res, err := c.transactionClient.GetTransaction(context.Background(), &pactus.GetTransactionRequest{
Id: id.Bytes(),
@@ -84,3 +86,12 @@ func (c *grpcClient) getTransaction(id tx.ID) (*pactus.GetTransactionResponse, e
return res, nil
}
+
+func (c *grpcClient) getFee(amount int64, payloadType payload.Type) (int64, error) {
+ res, err := c.transactionClient.CalculateFee(context.Background(), &pactus.CalculateFeeRequest{
+ Amount: amount, PayloadType: pactus.PayloadType(payloadType)})
+ if err != nil {
+ return 0, err
+ }
+ return res.Fee, nil
+}
diff --git a/wallet/client_test.go b/wallet/client_test.go
index b5c3cf18f..db743dd40 100644
--- a/wallet/client_test.go
+++ b/wallet/client_test.go
@@ -72,16 +72,16 @@ func (s *blockchainServer) GetValidator(_ context.Context,
return nil, fmt.Errorf("unknown request")
}
-func (s *blockchainServer) GetValidators(_ context.Context,
- _ *pactus.GetValidatorsRequest) (*pactus.GetValidatorsResponse, error) {
- return nil, nil
-}
-
func (s *transactionServer) GetTransaction(_ context.Context,
_ *pactus.GetTransactionRequest) (*pactus.GetTransactionResponse, error) {
return nil, nil
}
+func (s *transactionServer) CalculateFee(_ context.Context,
+ _ *pactus.CalculateFeeRequest) (*pactus.CalculateFeeResponse, error) {
+ return &pactus.CalculateFeeResponse{Fee: 0}, nil
+}
+
func (s *transactionServer) SendRawTransaction(_ context.Context,
req *pactus.SendRawTransactionRequest) (*pactus.SendRawTransactionResponse, error) {
trx, _ := tx.FromBytes(req.Data)
diff --git a/wallet/tx_builder.go b/wallet/tx_builder.go
index 502595e8b..2af6f90dc 100644
--- a/wallet/tx_builder.go
+++ b/wallet/tx_builder.go
@@ -97,7 +97,10 @@ func (m *txBuilder) build() (*tx.Tx, error) {
return nil, err
}
- m.setFee()
+ err = m.setFee()
+ if err != nil {
+ return nil, err
+ }
var trx *tx.Tx
switch m.typ {
@@ -169,20 +172,16 @@ func (m *txBuilder) setSequence() error {
return nil
}
-func (m *txBuilder) setFee() {
+func (m *txBuilder) setFee() error {
if m.fee == 0 {
- switch m.typ {
- case payload.PayloadTypeTransfer,
- payload.PayloadTypeBond,
- payload.PayloadTypeWithdraw:
- {
- m.fee = calcFee(m.amount)
- }
-
- case payload.PayloadTypeUnbond:
- {
- m.fee = 0
- }
+ if m.client == nil {
+ return ErrOffline
}
+ fee, err := m.client.getFee(m.amount, m.typ)
+ if err != nil {
+ return err
+ }
+ m.fee = fee
}
+ return nil
}
diff --git a/wallet/wallet.go b/wallet/wallet.go
index dc05a8fff..69b13a501 100644
--- a/wallet/wallet.go
+++ b/wallet/wallet.go
@@ -11,7 +11,6 @@ import (
"github.com/pactus-project/pactus/crypto"
"github.com/pactus-project/pactus/crypto/bls"
"github.com/pactus-project/pactus/genesis"
- "github.com/pactus-project/pactus/types/param"
"github.com/pactus-project/pactus/types/tx"
"github.com/pactus-project/pactus/types/tx/payload"
"github.com/pactus-project/pactus/util"
@@ -406,17 +405,8 @@ func (w *Wallet) BroadcastTransaction(trx *tx.Tx) (string, error) {
return id.String(), nil
}
-func calcFee(amount int64) int64 {
- params := param.DefaultParams() // TODO: Get parameter from the node
- fee := int64(float64(amount) * params.FeeFraction)
- fee = util.Max64(fee, params.MinimumFee)
- fee = util.Min64(fee, params.MaximumFee)
- return fee
-}
-
-// TODO: query fee from grpc client
-func (w *Wallet) CalculateFee(amount int64) int64 {
- return calcFee(amount)
+func (w *Wallet) CalculateFee(amount int64, payloadType payload.Type) (int64, error) {
+ return w.client.getFee(amount, payloadType)
}
func (w *Wallet) UpdatePassword(oldPassword, newPassword string) error {
diff --git a/wallet/wallet_test.go b/wallet/wallet_test.go
index 3a5cc8a80..3728c4b4f 100644
--- a/wallet/wallet_test.go
+++ b/wallet/wallet_test.go
@@ -305,7 +305,9 @@ func TestMakeTransferTx(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, trx.Sequence(), seq+1)
assert.Equal(t, trx.Payload().Value(), amount)
- assert.Equal(t, trx.Fee(), td.wallet.CalculateFee(amount))
+ fee, err := td.wallet.CalculateFee(amount, payload.PayloadTypeTransfer)
+ assert.NoError(t, err)
+ assert.Equal(t, trx.Fee(), fee)
assert.Equal(t, trx.Stamp(), lastBlockHash.Stamp())
})
@@ -363,7 +365,9 @@ func TestMakeBondTx(t *testing.T) {
assert.Equal(t, trx.Sequence(), seq+1)
assert.True(t, trx.Payload().(*payload.BondPayload).PublicKey.EqualsTo(receiver.PublicKey()))
assert.Equal(t, trx.Payload().Value(), amount)
- assert.Equal(t, trx.Fee(), td.wallet.CalculateFee(amount))
+ fee, err := td.wallet.CalculateFee(amount, payload.PayloadTypeBond)
+ assert.NoError(t, err)
+ assert.Equal(t, trx.Fee(), fee)
assert.Equal(t, trx.Stamp(), lastBlockHash.Stamp())
})
@@ -533,7 +537,9 @@ func TestMakeWithdrawTx(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, trx.Sequence(), seq+1)
assert.Equal(t, trx.Payload().Value(), amount)
- assert.Equal(t, trx.Fee(), td.wallet.CalculateFee(amount))
+ fee, err := td.wallet.CalculateFee(amount, payload.PayloadTypeWithdraw)
+ assert.NoError(t, err)
+ assert.Equal(t, trx.Fee(), fee)
assert.Equal(t, trx.Stamp(), lastBlockHash.Stamp())
})
diff --git a/www/grpc/blockchain.go b/www/grpc/blockchain.go
index 57bf1ac23..0c18f038a 100644
--- a/www/grpc/blockchain.go
+++ b/www/grpc/blockchain.go
@@ -19,7 +19,7 @@ import (
type blockchainServer struct {
state state.Facade
consMgr consensus.ManagerReader
- logger *logger.Logger
+ logger *logger.SubLogger
}
func (s *blockchainServer) GetBlockchainInfo(_ context.Context,
@@ -212,16 +212,6 @@ func (s *blockchainServer) GetValidator(_ context.Context,
}, nil
}
-func (s *blockchainServer) GetValidators(_ context.Context,
- _ *pactus.GetValidatorsRequest) (*pactus.GetValidatorsResponse, error) {
- validators := s.state.CommitteeValidators()
- validatorsInfo := make([]*pactus.ValidatorInfo, 0, len(validators))
- for _, val := range validators {
- validatorsInfo = append(validatorsInfo, validatorToProto(val))
- }
- return &pactus.GetValidatorsResponse{Validators: validatorsInfo}, nil
-}
-
func (s *blockchainServer) GetValidatorAddresses(_ context.Context,
_ *pactus.GetValidatorAddressesRequest) (*pactus.GetValidatorAddressesResponse, error) {
addresses := s.state.ValidatorAddresses()
@@ -235,16 +225,16 @@ func (s *blockchainServer) GetValidatorAddresses(_ context.Context,
func validatorToProto(val *validator.Validator) *pactus.ValidatorInfo {
data, _ := val.Bytes()
return &pactus.ValidatorInfo{
- Hash: val.Hash().Bytes(),
- Data: data,
- PublicKey: val.PublicKey().String(),
- Address: val.Address().String(),
- Number: val.Number(),
- Sequence: val.Sequence(),
- Stake: val.Stake(),
- LastBondingHeight: val.LastBondingHeight(),
- LastJoinedHeight: val.LastJoinedHeight(),
- UnbondingHeight: val.UnbondingHeight(),
+ Hash: val.Hash().Bytes(),
+ Data: data,
+ PublicKey: val.PublicKey().String(),
+ Address: val.Address().String(),
+ Number: val.Number(),
+ Sequence: val.Sequence(),
+ Stake: val.Stake(),
+ LastBondingHeight: val.LastBondingHeight(),
+ LastSortitionHeight: val.LastSortitionHeight(),
+ UnbondingHeight: val.UnbondingHeight(),
}
}
diff --git a/www/grpc/blockchain_test.go b/www/grpc/blockchain_test.go
index a7624c13f..d1ac1bbe5 100644
--- a/www/grpc/blockchain_test.go
+++ b/www/grpc/blockchain_test.go
@@ -285,21 +285,6 @@ func TestGetValidatorByNumber(t *testing.T) {
assert.Nil(t, conn.Close(), "Error closing connection")
}
-func TestGetValidators(t *testing.T) {
- conn, client := testBlockchainClient(t)
-
- t.Run("should return list of validators", func(t *testing.T) {
- res, err := client.GetValidators(tCtx,
- &pactus.GetValidatorsRequest{})
-
- assert.NoError(t, err)
- assert.NotNil(t, res)
- assert.Equal(t, 21, len(res.GetValidators()))
- })
-
- assert.Nil(t, conn.Close(), "Error closing connection")
-}
-
func TestGetValidatorAddresses(t *testing.T) {
conn, client := testBlockchainClient(t)
diff --git a/www/grpc/buf.gen.yaml b/www/grpc/buf.gen.yaml
index 09ea3b7d4..c5d5587e8 100644
--- a/www/grpc/buf.gen.yaml
+++ b/www/grpc/buf.gen.yaml
@@ -15,22 +15,22 @@ plugins:
out: swagger-ui
opt:
- grpc_api_configuration=grpc-gateway.config.yaml
- - remote: buf.build/protocolbuffers/plugins/js:v3.20.1-1
+ - plugin: buf.build/protocolbuffers/js:v3.21.2
out: gen/js
opt:
- import_style=commonjs
- binary
- - remote: buf.build/grpc/plugins/node:v1.11.2-1
+ - plugin: buf.build/grpc/node:v1.11.3
out: gen/js
opt:
- import_style=commonjs
- - remote: buf.build/protocolbuffers/plugins/dart:v20.0.1-1
+ - plugin: buf.build/protocolbuffers/dart:v20.0.1
out: gen/dart
- - remote: buf.build/protocolbuffers/plugins/java:v21.8.0-1
+ - plugin: buf.build/protocolbuffers/java:v21.8
out: gen/java
- - remote: buf.build/grpc/plugins/java:v1.50.2-1
+ - plugin: buf.build/grpc/java:v1.50.2
out: gen/java
- - remote: buf.build/protocolbuffers/plugins/python:v21.8.0-1
- out: gen/python
- - remote: buf.build/grpc/plugins/python:v1.50.0-1
+ - plugin: buf.build/protocolbuffers/python:v21.8
out: gen/python
+ - plugin: buf.build/grpc/python:v1.50.0
+ out: gen/python
\ No newline at end of file
diff --git a/www/grpc/gen/dart/blockchain.pb.dart b/www/grpc/gen/dart/blockchain.pb.dart
index 7f945f590..aa20011f9 100644
--- a/www/grpc/gen/dart/blockchain.pb.dart
+++ b/www/grpc/gen/dart/blockchain.pb.dart
@@ -160,35 +160,6 @@ class GetAccountResponse extends $pb.GeneratedMessage {
AccountInfo ensureAccount() => $_ensure(0);
}
-class GetValidatorsRequest extends $pb.GeneratedMessage {
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorsRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
- ..hasRequiredFields = false
- ;
-
- GetValidatorsRequest._() : super();
- factory GetValidatorsRequest() => create();
- factory GetValidatorsRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
- factory GetValidatorsRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
- @$core.Deprecated(
- 'Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
- GetValidatorsRequest clone() => GetValidatorsRequest()..mergeFromMessage(this);
- @$core.Deprecated(
- 'Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- GetValidatorsRequest copyWith(void Function(GetValidatorsRequest) updates) => super.copyWith((message) => updates(message as GetValidatorsRequest)) as GetValidatorsRequest; // ignore: deprecated_member_use
- $pb.BuilderInfo get info_ => _i;
- @$core.pragma('dart2js:noInline')
- static GetValidatorsRequest create() => GetValidatorsRequest._();
- GetValidatorsRequest createEmptyInstance() => create();
- static $pb.PbList createRepeated() => $pb.PbList();
- @$core.pragma('dart2js:noInline')
- static GetValidatorsRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create);
- static GetValidatorsRequest? _defaultInstance;
-}
-
class GetValidatorAddressesRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorAddressesRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..hasRequiredFields = false
@@ -353,47 +324,6 @@ class GetValidatorByNumberRequest extends $pb.GeneratedMessage {
void clearNumber() => clearField(1);
}
-class GetValidatorsResponse extends $pb.GeneratedMessage {
- static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorsResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
- ..pc(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'validators', $pb.PbFieldType.PM, subBuilder: ValidatorInfo.create)
- ..hasRequiredFields = false
- ;
-
- GetValidatorsResponse._() : super();
- factory GetValidatorsResponse({
- $core.Iterable? validators,
- }) {
- final _result = create();
- if (validators != null) {
- _result.validators.addAll(validators);
- }
- return _result;
- }
- factory GetValidatorsResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
- factory GetValidatorsResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
- @$core.Deprecated(
- 'Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
- 'Will be removed in next major version')
- GetValidatorsResponse clone() => GetValidatorsResponse()..mergeFromMessage(this);
- @$core.Deprecated(
- 'Using this can add significant overhead to your binary. '
- 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
- 'Will be removed in next major version')
- GetValidatorsResponse copyWith(void Function(GetValidatorsResponse) updates) => super.copyWith((message) => updates(message as GetValidatorsResponse)) as GetValidatorsResponse; // ignore: deprecated_member_use
- $pb.BuilderInfo get info_ => _i;
- @$core.pragma('dart2js:noInline')
- static GetValidatorsResponse create() => GetValidatorsResponse._();
- GetValidatorsResponse createEmptyInstance() => create();
- static $pb.PbList createRepeated() => $pb.PbList();
- @$core.pragma('dart2js:noInline')
- static GetValidatorsResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create);
- static GetValidatorsResponse? _defaultInstance;
-
- @$pb.TagNumber(1)
- $core.List get validators => $_getList(0);
-}
-
class GetValidatorResponse extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetValidatorResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..aOM(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'validator', subBuilder: ValidatorInfo.create)
@@ -1054,7 +984,7 @@ class ValidatorInfo extends $pb.GeneratedMessage {
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sequence', $pb.PbFieldType.O3)
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'stake')
..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastBondingHeight', $pb.PbFieldType.OU3)
- ..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastJoinedHeight', $pb.PbFieldType.OU3)
+ ..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastSortitionHeight', $pb.PbFieldType.OU3)
..a<$core.int>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unbondingHeight', $pb.PbFieldType.OU3)
..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'address')
..hasRequiredFields = false
@@ -1069,7 +999,7 @@ class ValidatorInfo extends $pb.GeneratedMessage {
$core.int? sequence,
$fixnum.Int64? stake,
$core.int? lastBondingHeight,
- $core.int? lastJoinedHeight,
+ $core.int? lastSortitionHeight,
$core.int? unbondingHeight,
$core.String? address,
}) {
@@ -1095,8 +1025,8 @@ class ValidatorInfo extends $pb.GeneratedMessage {
if (lastBondingHeight != null) {
_result.lastBondingHeight = lastBondingHeight;
}
- if (lastJoinedHeight != null) {
- _result.lastJoinedHeight = lastJoinedHeight;
+ if (lastSortitionHeight != null) {
+ _result.lastSortitionHeight = lastSortitionHeight;
}
if (unbondingHeight != null) {
_result.unbondingHeight = unbondingHeight;
@@ -1191,13 +1121,13 @@ class ValidatorInfo extends $pb.GeneratedMessage {
void clearLastBondingHeight() => clearField(7);
@$pb.TagNumber(8)
- $core.int get lastJoinedHeight => $_getIZ(7);
+ $core.int get lastSortitionHeight => $_getIZ(7);
@$pb.TagNumber(8)
- set lastJoinedHeight($core.int v) { $_setUnsignedInt32(7, v); }
+ set lastSortitionHeight($core.int v) { $_setUnsignedInt32(7, v); }
@$pb.TagNumber(8)
- $core.bool hasLastJoinedHeight() => $_has(7);
+ $core.bool hasLastSortitionHeight() => $_has(7);
@$pb.TagNumber(8)
- void clearLastJoinedHeight() => clearField(8);
+ void clearLastSortitionHeight() => clearField(8);
@$pb.TagNumber(9)
$core.int get unbondingHeight => $_getIZ(8);
@@ -1745,9 +1675,5 @@ class BlockchainApi {
var emptyResponse = GetValidatorAddressesResponse();
return _client.invoke(ctx, 'Blockchain', 'GetValidatorAddresses', request, emptyResponse);
}
- $async.Future getValidators($pb.ClientContext? ctx, GetValidatorsRequest request) {
- var emptyResponse = GetValidatorsResponse();
- return _client.invoke(ctx, 'Blockchain', 'GetValidators', request, emptyResponse);
- }
}
diff --git a/www/grpc/gen/dart/blockchain.pbjson.dart b/www/grpc/gen/dart/blockchain.pbjson.dart
index 509281943..f207b1d54 100644
--- a/www/grpc/gen/dart/blockchain.pbjson.dart
+++ b/www/grpc/gen/dart/blockchain.pbjson.dart
@@ -65,13 +65,6 @@ const GetAccountResponse$json = const {
/// Descriptor for `GetAccountResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getAccountResponseDescriptor = $convert.base64Decode('ChJHZXRBY2NvdW50UmVzcG9uc2USLQoHYWNjb3VudBgBIAEoCzITLnBhY3R1cy5BY2NvdW50SW5mb1IHYWNjb3VudA==');
-@$core.Deprecated('Use getValidatorsRequestDescriptor instead')
-const GetValidatorsRequest$json = const {
- '1': 'GetValidatorsRequest',
-};
-
-/// Descriptor for `GetValidatorsRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List getValidatorsRequestDescriptor = $convert.base64Decode('ChRHZXRWYWxpZGF0b3JzUmVxdWVzdA==');
@$core.Deprecated('Use getValidatorAddressesRequestDescriptor instead')
const GetValidatorAddressesRequest$json = const {
'1': 'GetValidatorAddressesRequest',
@@ -109,16 +102,6 @@ const GetValidatorByNumberRequest$json = const {
/// Descriptor for `GetValidatorByNumberRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getValidatorByNumberRequestDescriptor = $convert.base64Decode('ChtHZXRWYWxpZGF0b3JCeU51bWJlclJlcXVlc3QSFgoGbnVtYmVyGAEgASgFUgZudW1iZXI=');
-@$core.Deprecated('Use getValidatorsResponseDescriptor instead')
-const GetValidatorsResponse$json = const {
- '1': 'GetValidatorsResponse',
- '2': const [
- const {'1': 'validators', '3': 1, '4': 3, '5': 11, '6': '.pactus.ValidatorInfo', '10': 'validators'},
- ],
-};
-
-/// Descriptor for `GetValidatorsResponse`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List getValidatorsResponseDescriptor = $convert.base64Decode('ChVHZXRWYWxpZGF0b3JzUmVzcG9uc2USNQoKdmFsaWRhdG9ycxgBIAMoCzIVLnBhY3R1cy5WYWxpZGF0b3JJbmZvUgp2YWxpZGF0b3Jz');
@$core.Deprecated('Use getValidatorResponseDescriptor instead')
const GetValidatorResponse$json = const {
'1': 'GetValidatorResponse',
@@ -247,14 +230,14 @@ const ValidatorInfo$json = const {
const {'1': 'sequence', '3': 5, '4': 1, '5': 5, '10': 'sequence'},
const {'1': 'stake', '3': 6, '4': 1, '5': 3, '10': 'stake'},
const {'1': 'last_bonding_height', '3': 7, '4': 1, '5': 13, '10': 'lastBondingHeight'},
- const {'1': 'last_joined_height', '3': 8, '4': 1, '5': 13, '10': 'lastJoinedHeight'},
+ const {'1': 'last_sortition_height', '3': 8, '4': 1, '5': 13, '10': 'lastSortitionHeight'},
const {'1': 'unbonding_height', '3': 9, '4': 1, '5': 13, '10': 'unbondingHeight'},
const {'1': 'address', '3': 10, '4': 1, '5': 9, '10': 'address'},
],
};
/// Descriptor for `ValidatorInfo`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List validatorInfoDescriptor = $convert.base64Decode('Cg1WYWxpZGF0b3JJbmZvEhIKBGhhc2gYASABKAxSBGhhc2gSEgoEZGF0YRgCIAEoDFIEZGF0YRIdCgpwdWJsaWNfa2V5GAMgASgJUglwdWJsaWNLZXkSFgoGbnVtYmVyGAQgASgFUgZudW1iZXISGgoIc2VxdWVuY2UYBSABKAVSCHNlcXVlbmNlEhQKBXN0YWtlGAYgASgDUgVzdGFrZRIuChNsYXN0X2JvbmRpbmdfaGVpZ2h0GAcgASgNUhFsYXN0Qm9uZGluZ0hlaWdodBIsChJsYXN0X2pvaW5lZF9oZWlnaHQYCCABKA1SEGxhc3RKb2luZWRIZWlnaHQSKQoQdW5ib25kaW5nX2hlaWdodBgJIAEoDVIPdW5ib25kaW5nSGVpZ2h0EhgKB2FkZHJlc3MYCiABKAlSB2FkZHJlc3M=');
+final $typed_data.Uint8List validatorInfoDescriptor = $convert.base64Decode('Cg1WYWxpZGF0b3JJbmZvEhIKBGhhc2gYASABKAxSBGhhc2gSEgoEZGF0YRgCIAEoDFIEZGF0YRIdCgpwdWJsaWNfa2V5GAMgASgJUglwdWJsaWNLZXkSFgoGbnVtYmVyGAQgASgFUgZudW1iZXISGgoIc2VxdWVuY2UYBSABKAVSCHNlcXVlbmNlEhQKBXN0YWtlGAYgASgDUgVzdGFrZRIuChNsYXN0X2JvbmRpbmdfaGVpZ2h0GAcgASgNUhFsYXN0Qm9uZGluZ0hlaWdodBIyChVsYXN0X3NvcnRpdGlvbl9oZWlnaHQYCCABKA1SE2xhc3RTb3J0aXRpb25IZWlnaHQSKQoQdW5ib25kaW5nX2hlaWdodBgJIAEoDVIPdW5ib25kaW5nSGVpZ2h0EhgKB2FkZHJlc3MYCiABKAlSB2FkZHJlc3M=');
@$core.Deprecated('Use accountInfoDescriptor instead')
const AccountInfo$json = const {
'1': 'AccountInfo',
@@ -337,7 +320,6 @@ const $core.Map<$core.String, $core.dynamic> BlockchainServiceBase$json = const
const {'1': 'GetValidator', '2': '.pactus.GetValidatorRequest', '3': '.pactus.GetValidatorResponse'},
const {'1': 'GetValidatorByNumber', '2': '.pactus.GetValidatorByNumberRequest', '3': '.pactus.GetValidatorResponse'},
const {'1': 'GetValidatorAddresses', '2': '.pactus.GetValidatorAddressesRequest', '3': '.pactus.GetValidatorAddressesResponse'},
- const {'1': 'GetValidators', '2': '.pactus.GetValidatorsRequest', '3': '.pactus.GetValidatorsResponse'},
],
};
@@ -373,9 +355,7 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> Blockchain
'.pactus.GetValidatorByNumberRequest': GetValidatorByNumberRequest$json,
'.pactus.GetValidatorAddressesRequest': GetValidatorAddressesRequest$json,
'.pactus.GetValidatorAddressesResponse': GetValidatorAddressesResponse$json,
- '.pactus.GetValidatorsRequest': GetValidatorsRequest$json,
- '.pactus.GetValidatorsResponse': GetValidatorsResponse$json,
};
/// Descriptor for `Blockchain`. Decode as a `google.protobuf.ServiceDescriptorProto`.
-final $typed_data.Uint8List blockchainServiceDescriptor = $convert.base64Decode('CgpCbG9ja2NoYWluEj0KCEdldEJsb2NrEhcucGFjdHVzLkdldEJsb2NrUmVxdWVzdBoYLnBhY3R1cy5HZXRCbG9ja1Jlc3BvbnNlEkkKDEdldEJsb2NrSGFzaBIbLnBhY3R1cy5HZXRCbG9ja0hhc2hSZXF1ZXN0GhwucGFjdHVzLkdldEJsb2NrSGFzaFJlc3BvbnNlEk8KDkdldEJsb2NrSGVpZ2h0Eh0ucGFjdHVzLkdldEJsb2NrSGVpZ2h0UmVxdWVzdBoeLnBhY3R1cy5HZXRCbG9ja0hlaWdodFJlc3BvbnNlElgKEUdldEJsb2NrY2hhaW5JbmZvEiAucGFjdHVzLkdldEJsb2NrY2hhaW5JbmZvUmVxdWVzdBohLnBhY3R1cy5HZXRCbG9ja2NoYWluSW5mb1Jlc3BvbnNlElUKEEdldENvbnNlbnN1c0luZm8SHy5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1JlcXVlc3QaIC5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1Jlc3BvbnNlEkMKCkdldEFjY291bnQSGS5wYWN0dXMuR2V0QWNjb3VudFJlcXVlc3QaGi5wYWN0dXMuR2V0QWNjb3VudFJlc3BvbnNlElMKEkdldEFjY291bnRCeU51bWJlchIhLnBhY3R1cy5HZXRBY2NvdW50QnlOdW1iZXJSZXF1ZXN0GhoucGFjdHVzLkdldEFjY291bnRSZXNwb25zZRJJCgxHZXRWYWxpZGF0b3ISGy5wYWN0dXMuR2V0VmFsaWRhdG9yUmVxdWVzdBocLnBhY3R1cy5HZXRWYWxpZGF0b3JSZXNwb25zZRJZChRHZXRWYWxpZGF0b3JCeU51bWJlchIjLnBhY3R1cy5HZXRWYWxpZGF0b3JCeU51bWJlclJlcXVlc3QaHC5wYWN0dXMuR2V0VmFsaWRhdG9yUmVzcG9uc2USZAoVR2V0VmFsaWRhdG9yQWRkcmVzc2VzEiQucGFjdHVzLkdldFZhbGlkYXRvckFkZHJlc3Nlc1JlcXVlc3QaJS5wYWN0dXMuR2V0VmFsaWRhdG9yQWRkcmVzc2VzUmVzcG9uc2USTAoNR2V0VmFsaWRhdG9ycxIcLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVxdWVzdBodLnBhY3R1cy5HZXRWYWxpZGF0b3JzUmVzcG9uc2U=');
+final $typed_data.Uint8List blockchainServiceDescriptor = $convert.base64Decode('CgpCbG9ja2NoYWluEj0KCEdldEJsb2NrEhcucGFjdHVzLkdldEJsb2NrUmVxdWVzdBoYLnBhY3R1cy5HZXRCbG9ja1Jlc3BvbnNlEkkKDEdldEJsb2NrSGFzaBIbLnBhY3R1cy5HZXRCbG9ja0hhc2hSZXF1ZXN0GhwucGFjdHVzLkdldEJsb2NrSGFzaFJlc3BvbnNlEk8KDkdldEJsb2NrSGVpZ2h0Eh0ucGFjdHVzLkdldEJsb2NrSGVpZ2h0UmVxdWVzdBoeLnBhY3R1cy5HZXRCbG9ja0hlaWdodFJlc3BvbnNlElgKEUdldEJsb2NrY2hhaW5JbmZvEiAucGFjdHVzLkdldEJsb2NrY2hhaW5JbmZvUmVxdWVzdBohLnBhY3R1cy5HZXRCbG9ja2NoYWluSW5mb1Jlc3BvbnNlElUKEEdldENvbnNlbnN1c0luZm8SHy5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1JlcXVlc3QaIC5wYWN0dXMuR2V0Q29uc2Vuc3VzSW5mb1Jlc3BvbnNlEkMKCkdldEFjY291bnQSGS5wYWN0dXMuR2V0QWNjb3VudFJlcXVlc3QaGi5wYWN0dXMuR2V0QWNjb3VudFJlc3BvbnNlElMKEkdldEFjY291bnRCeU51bWJlchIhLnBhY3R1cy5HZXRBY2NvdW50QnlOdW1iZXJSZXF1ZXN0GhoucGFjdHVzLkdldEFjY291bnRSZXNwb25zZRJJCgxHZXRWYWxpZGF0b3ISGy5wYWN0dXMuR2V0VmFsaWRhdG9yUmVxdWVzdBocLnBhY3R1cy5HZXRWYWxpZGF0b3JSZXNwb25zZRJZChRHZXRWYWxpZGF0b3JCeU51bWJlchIjLnBhY3R1cy5HZXRWYWxpZGF0b3JCeU51bWJlclJlcXVlc3QaHC5wYWN0dXMuR2V0VmFsaWRhdG9yUmVzcG9uc2USZAoVR2V0VmFsaWRhdG9yQWRkcmVzc2VzEiQucGFjdHVzLkdldFZhbGlkYXRvckFkZHJlc3Nlc1JlcXVlc3QaJS5wYWN0dXMuR2V0VmFsaWRhdG9yQWRkcmVzc2VzUmVzcG9uc2U=');
diff --git a/www/grpc/gen/dart/blockchain.pbserver.dart b/www/grpc/gen/dart/blockchain.pbserver.dart
index 7be953ad4..3b6653423 100644
--- a/www/grpc/gen/dart/blockchain.pbserver.dart
+++ b/www/grpc/gen/dart/blockchain.pbserver.dart
@@ -26,7 +26,6 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
$async.Future<$1.GetValidatorResponse> getValidator($pb.ServerContext ctx, $1.GetValidatorRequest request);
$async.Future<$1.GetValidatorResponse> getValidatorByNumber($pb.ServerContext ctx, $1.GetValidatorByNumberRequest request);
$async.Future<$1.GetValidatorAddressesResponse> getValidatorAddresses($pb.ServerContext ctx, $1.GetValidatorAddressesRequest request);
- $async.Future<$1.GetValidatorsResponse> getValidators($pb.ServerContext ctx, $1.GetValidatorsRequest request);
$pb.GeneratedMessage createRequest($core.String method) {
switch (method) {
@@ -40,7 +39,6 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
case 'GetValidator': return $1.GetValidatorRequest();
case 'GetValidatorByNumber': return $1.GetValidatorByNumberRequest();
case 'GetValidatorAddresses': return $1.GetValidatorAddressesRequest();
- case 'GetValidators': return $1.GetValidatorsRequest();
default: throw $core.ArgumentError('Unknown method: $method');
}
}
@@ -57,7 +55,6 @@ abstract class BlockchainServiceBase extends $pb.GeneratedService {
case 'GetValidator': return this.getValidator(ctx, request as $1.GetValidatorRequest);
case 'GetValidatorByNumber': return this.getValidatorByNumber(ctx, request as $1.GetValidatorByNumberRequest);
case 'GetValidatorAddresses': return this.getValidatorAddresses(ctx, request as $1.GetValidatorAddressesRequest);
- case 'GetValidators': return this.getValidators(ctx, request as $1.GetValidatorsRequest);
default: throw $core.ArgumentError('Unknown method: $method');
}
}
diff --git a/www/grpc/gen/dart/network.pb.dart b/www/grpc/gen/dart/network.pb.dart
index d8cd50ac4..6c8ddb2b5 100644
--- a/www/grpc/gen/dart/network.pb.dart
+++ b/www/grpc/gen/dart/network.pb.dart
@@ -46,6 +46,8 @@ class GetNetworkInfoResponse extends $pb.GeneratedMessage {
..a<$core.int>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'totalReceivedBytes', $pb.PbFieldType.O3)
..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'startedAt')
..pc(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'peers', $pb.PbFieldType.PM, subBuilder: PeerInfo.create)
+ ..m<$core.int, $fixnum.Int64>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sentBytes', entryClassName: 'GetNetworkInfoResponse.SentBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus'))
+ ..m<$core.int, $fixnum.Int64>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBytes', entryClassName: 'GetNetworkInfoResponse.ReceivedBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus'))
..hasRequiredFields = false
;
@@ -55,6 +57,8 @@ class GetNetworkInfoResponse extends $pb.GeneratedMessage {
$core.int? totalReceivedBytes,
$fixnum.Int64? startedAt,
$core.Iterable? peers,
+ $core.Map<$core.int, $fixnum.Int64>? sentBytes,
+ $core.Map<$core.int, $fixnum.Int64>? receivedBytes,
}) {
final _result = create();
if (totalSentBytes != null) {
@@ -69,6 +73,12 @@ class GetNetworkInfoResponse extends $pb.GeneratedMessage {
if (peers != null) {
_result.peers.addAll(peers);
}
+ if (sentBytes != null) {
+ _result.sentBytes.addAll(sentBytes);
+ }
+ if (receivedBytes != null) {
+ _result.receivedBytes.addAll(receivedBytes);
+ }
return _result;
}
factory GetNetworkInfoResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
@@ -121,6 +131,12 @@ class GetNetworkInfoResponse extends $pb.GeneratedMessage {
@$pb.TagNumber(4)
$core.List get peers => $_getList(3);
+
+ @$pb.TagNumber(5)
+ $core.Map<$core.int, $fixnum.Int64> get sentBytes => $_getMap(4);
+
+ @$pb.TagNumber(6)
+ $core.Map<$core.int, $fixnum.Int64> get receivedBytes => $_getMap(5);
}
class GetNodeInfoRequest extends $pb.GeneratedMessage {
@@ -237,12 +253,14 @@ class PeerInfo extends $pb.GeneratedMessage {
..a<$core.int>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'height', $pb.PbFieldType.OU3)
..a<$core.int>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedMessages', $pb.PbFieldType.O3)
..a<$core.int>(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'invalidMessages', $pb.PbFieldType.O3)
- ..a<$core.int>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBytes', $pb.PbFieldType.O3)
- ..a<$core.int>(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'status', $pb.PbFieldType.O3)
- ..aInt64(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastSent')
- ..aInt64(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastReceived')
- ..a<$core.int>(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sendSuccess', $pb.PbFieldType.O3)
- ..a<$core.int>(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sendFailed', $pb.PbFieldType.O3)
+ ..m<$core.int, $fixnum.Int64>(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sentBytes', entryClassName: 'PeerInfo.SentBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus'))
+ ..m<$core.int, $fixnum.Int64>(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'receivedBytes', entryClassName: 'PeerInfo.ReceivedBytesEntry', keyFieldType: $pb.PbFieldType.O3, valueFieldType: $pb.PbFieldType.O6, packageName: const $pb.PackageName('pactus'))
+ ..a<$core.int>(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'status', $pb.PbFieldType.O3)
+ ..aInt64(12, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastSent')
+ ..aInt64(13, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastReceived')
+ ..a<$core.int>(14, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sendSuccess', $pb.PbFieldType.O3)
+ ..a<$core.int>(15, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sendFailed', $pb.PbFieldType.O3)
+ ..a<$core.List<$core.int>>(16, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lastBlockHash', $pb.PbFieldType.OY)
..hasRequiredFields = false
;
@@ -256,12 +274,14 @@ class PeerInfo extends $pb.GeneratedMessage {
$core.int? height,
$core.int? receivedMessages,
$core.int? invalidMessages,
- $core.int? receivedBytes,
+ $core.Map<$core.int, $fixnum.Int64>? sentBytes,
+ $core.Map<$core.int, $fixnum.Int64>? receivedBytes,
$core.int? status,
$fixnum.Int64? lastSent,
$fixnum.Int64? lastReceived,
$core.int? sendSuccess,
$core.int? sendFailed,
+ $core.List<$core.int>? lastBlockHash,
}) {
final _result = create();
if (moniker != null) {
@@ -288,8 +308,11 @@ class PeerInfo extends $pb.GeneratedMessage {
if (invalidMessages != null) {
_result.invalidMessages = invalidMessages;
}
+ if (sentBytes != null) {
+ _result.sentBytes.addAll(sentBytes);
+ }
if (receivedBytes != null) {
- _result.receivedBytes = receivedBytes;
+ _result.receivedBytes.addAll(receivedBytes);
}
if (status != null) {
_result.status = status;
@@ -306,6 +329,9 @@ class PeerInfo extends $pb.GeneratedMessage {
if (sendFailed != null) {
_result.sendFailed = sendFailed;
}
+ if (lastBlockHash != null) {
+ _result.lastBlockHash = lastBlockHash;
+ }
return _result;
}
factory PeerInfo.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
@@ -396,58 +422,64 @@ class PeerInfo extends $pb.GeneratedMessage {
void clearInvalidMessages() => clearField(8);
@$pb.TagNumber(9)
- $core.int get receivedBytes => $_getIZ(8);
- @$pb.TagNumber(9)
- set receivedBytes($core.int v) { $_setSignedInt32(8, v); }
- @$pb.TagNumber(9)
- $core.bool hasReceivedBytes() => $_has(8);
- @$pb.TagNumber(9)
- void clearReceivedBytes() => clearField(9);
+ $core.Map<$core.int, $fixnum.Int64> get sentBytes => $_getMap(8);
@$pb.TagNumber(10)
- $core.int get status => $_getIZ(9);
- @$pb.TagNumber(10)
- set status($core.int v) { $_setSignedInt32(9, v); }
- @$pb.TagNumber(10)
- $core.bool hasStatus() => $_has(9);
- @$pb.TagNumber(10)
- void clearStatus() => clearField(10);
+ $core.Map<$core.int, $fixnum.Int64> get receivedBytes => $_getMap(9);
@$pb.TagNumber(11)
- $fixnum.Int64 get lastSent => $_getI64(10);
+ $core.int get status => $_getIZ(10);
@$pb.TagNumber(11)
- set lastSent($fixnum.Int64 v) { $_setInt64(10, v); }
+ set status($core.int v) { $_setSignedInt32(10, v); }
@$pb.TagNumber(11)
- $core.bool hasLastSent() => $_has(10);
+ $core.bool hasStatus() => $_has(10);
@$pb.TagNumber(11)
- void clearLastSent() => clearField(11);
+ void clearStatus() => clearField(11);
@$pb.TagNumber(12)
- $fixnum.Int64 get lastReceived => $_getI64(11);
+ $fixnum.Int64 get lastSent => $_getI64(11);
@$pb.TagNumber(12)
- set lastReceived($fixnum.Int64 v) { $_setInt64(11, v); }
+ set lastSent($fixnum.Int64 v) { $_setInt64(11, v); }
@$pb.TagNumber(12)
- $core.bool hasLastReceived() => $_has(11);
+ $core.bool hasLastSent() => $_has(11);
@$pb.TagNumber(12)
- void clearLastReceived() => clearField(12);
+ void clearLastSent() => clearField(12);
@$pb.TagNumber(13)
- $core.int get sendSuccess => $_getIZ(12);
+ $fixnum.Int64 get lastReceived => $_getI64(12);
@$pb.TagNumber(13)
- set sendSuccess($core.int v) { $_setSignedInt32(12, v); }
+ set lastReceived($fixnum.Int64 v) { $_setInt64(12, v); }
@$pb.TagNumber(13)
- $core.bool hasSendSuccess() => $_has(12);
+ $core.bool hasLastReceived() => $_has(12);
@$pb.TagNumber(13)
- void clearSendSuccess() => clearField(13);
+ void clearLastReceived() => clearField(13);
@$pb.TagNumber(14)
- $core.int get sendFailed => $_getIZ(13);
+ $core.int get sendSuccess => $_getIZ(13);
@$pb.TagNumber(14)
- set sendFailed($core.int v) { $_setSignedInt32(13, v); }
+ set sendSuccess($core.int v) { $_setSignedInt32(13, v); }
@$pb.TagNumber(14)
- $core.bool hasSendFailed() => $_has(13);
+ $core.bool hasSendSuccess() => $_has(13);
@$pb.TagNumber(14)
- void clearSendFailed() => clearField(14);
+ void clearSendSuccess() => clearField(14);
+
+ @$pb.TagNumber(15)
+ $core.int get sendFailed => $_getIZ(14);
+ @$pb.TagNumber(15)
+ set sendFailed($core.int v) { $_setSignedInt32(14, v); }
+ @$pb.TagNumber(15)
+ $core.bool hasSendFailed() => $_has(14);
+ @$pb.TagNumber(15)
+ void clearSendFailed() => clearField(15);
+
+ @$pb.TagNumber(16)
+ $core.List<$core.int> get lastBlockHash => $_getN(15);
+ @$pb.TagNumber(16)
+ set lastBlockHash($core.List<$core.int> v) { $_setBytes(15, v); }
+ @$pb.TagNumber(16)
+ $core.bool hasLastBlockHash() => $_has(15);
+ @$pb.TagNumber(16)
+ void clearLastBlockHash() => clearField(16);
}
class NetworkApi {
diff --git a/www/grpc/gen/dart/network.pbjson.dart b/www/grpc/gen/dart/network.pbjson.dart
index 4c622260a..c4bfd2937 100644
--- a/www/grpc/gen/dart/network.pbjson.dart
+++ b/www/grpc/gen/dart/network.pbjson.dart
@@ -23,11 +23,34 @@ const GetNetworkInfoResponse$json = const {
const {'1': 'total_received_bytes', '3': 2, '4': 1, '5': 5, '10': 'totalReceivedBytes'},
const {'1': 'started_at', '3': 3, '4': 1, '5': 3, '10': 'startedAt'},
const {'1': 'peers', '3': 4, '4': 3, '5': 11, '6': '.pactus.PeerInfo', '10': 'peers'},
+ const {'1': 'sent_bytes', '3': 5, '4': 3, '5': 11, '6': '.pactus.GetNetworkInfoResponse.SentBytesEntry', '10': 'sentBytes'},
+ const {'1': 'received_bytes', '3': 6, '4': 3, '5': 11, '6': '.pactus.GetNetworkInfoResponse.ReceivedBytesEntry', '10': 'receivedBytes'},
],
+ '3': const [GetNetworkInfoResponse_SentBytesEntry$json, GetNetworkInfoResponse_ReceivedBytesEntry$json],
+};
+
+@$core.Deprecated('Use getNetworkInfoResponseDescriptor instead')
+const GetNetworkInfoResponse_SentBytesEntry$json = const {
+ '1': 'SentBytesEntry',
+ '2': const [
+ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
+ const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'},
+ ],
+ '7': const {'7': true},
+};
+
+@$core.Deprecated('Use getNetworkInfoResponseDescriptor instead')
+const GetNetworkInfoResponse_ReceivedBytesEntry$json = const {
+ '1': 'ReceivedBytesEntry',
+ '2': const [
+ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
+ const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'},
+ ],
+ '7': const {'7': true},
};
/// Descriptor for `GetNetworkInfoResponse`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List getNetworkInfoResponseDescriptor = $convert.base64Decode('ChZHZXROZXR3b3JrSW5mb1Jlc3BvbnNlEigKEHRvdGFsX3NlbnRfYnl0ZXMYASABKAVSDnRvdGFsU2VudEJ5dGVzEjAKFHRvdGFsX3JlY2VpdmVkX2J5dGVzGAIgASgFUhJ0b3RhbFJlY2VpdmVkQnl0ZXMSHQoKc3RhcnRlZF9hdBgDIAEoA1IJc3RhcnRlZEF0EiYKBXBlZXJzGAQgAygLMhAucGFjdHVzLlBlZXJJbmZvUgVwZWVycw==');
+final $typed_data.Uint8List getNetworkInfoResponseDescriptor = $convert.base64Decode('ChZHZXROZXR3b3JrSW5mb1Jlc3BvbnNlEigKEHRvdGFsX3NlbnRfYnl0ZXMYASABKAVSDnRvdGFsU2VudEJ5dGVzEjAKFHRvdGFsX3JlY2VpdmVkX2J5dGVzGAIgASgFUhJ0b3RhbFJlY2VpdmVkQnl0ZXMSHQoKc3RhcnRlZF9hdBgDIAEoA1IJc3RhcnRlZEF0EiYKBXBlZXJzGAQgAygLMhAucGFjdHVzLlBlZXJJbmZvUgVwZWVycxJMCgpzZW50X2J5dGVzGAUgAygLMi0ucGFjdHVzLkdldE5ldHdvcmtJbmZvUmVzcG9uc2UuU2VudEJ5dGVzRW50cnlSCXNlbnRCeXRlcxJYCg5yZWNlaXZlZF9ieXRlcxgGIAMoCzIxLnBhY3R1cy5HZXROZXR3b3JrSW5mb1Jlc3BvbnNlLlJlY2VpdmVkQnl0ZXNFbnRyeVINcmVjZWl2ZWRCeXRlcxo8Cg5TZW50Qnl0ZXNFbnRyeRIQCgNrZXkYASABKAVSA2tleRIUCgV2YWx1ZRgCIAEoA1IFdmFsdWU6AjgBGkAKElJlY2VpdmVkQnl0ZXNFbnRyeRIQCgNrZXkYASABKAVSA2tleRIUCgV2YWx1ZRgCIAEoA1IFdmFsdWU6AjgB');
@$core.Deprecated('Use getNodeInfoRequestDescriptor instead')
const GetNodeInfoRequest$json = const {
'1': 'GetNodeInfoRequest',
@@ -59,17 +82,40 @@ const PeerInfo$json = const {
const {'1': 'height', '3': 6, '4': 1, '5': 13, '10': 'height'},
const {'1': 'received_messages', '3': 7, '4': 1, '5': 5, '10': 'receivedMessages'},
const {'1': 'invalid_messages', '3': 8, '4': 1, '5': 5, '10': 'invalidMessages'},
- const {'1': 'received_bytes', '3': 9, '4': 1, '5': 5, '10': 'receivedBytes'},
- const {'1': 'status', '3': 10, '4': 1, '5': 5, '10': 'status'},
- const {'1': 'last_sent', '3': 11, '4': 1, '5': 3, '10': 'lastSent'},
- const {'1': 'last_received', '3': 12, '4': 1, '5': 3, '10': 'lastReceived'},
- const {'1': 'send_success', '3': 13, '4': 1, '5': 5, '10': 'sendSuccess'},
- const {'1': 'send_failed', '3': 14, '4': 1, '5': 5, '10': 'sendFailed'},
+ const {'1': 'sent_bytes', '3': 9, '4': 3, '5': 11, '6': '.pactus.PeerInfo.SentBytesEntry', '10': 'sentBytes'},
+ const {'1': 'received_bytes', '3': 10, '4': 3, '5': 11, '6': '.pactus.PeerInfo.ReceivedBytesEntry', '10': 'receivedBytes'},
+ const {'1': 'status', '3': 11, '4': 1, '5': 5, '10': 'status'},
+ const {'1': 'last_sent', '3': 12, '4': 1, '5': 3, '10': 'lastSent'},
+ const {'1': 'last_received', '3': 13, '4': 1, '5': 3, '10': 'lastReceived'},
+ const {'1': 'send_success', '3': 14, '4': 1, '5': 5, '10': 'sendSuccess'},
+ const {'1': 'send_failed', '3': 15, '4': 1, '5': 5, '10': 'sendFailed'},
+ const {'1': 'last_block_hash', '3': 16, '4': 1, '5': 12, '10': 'lastBlockHash'},
+ ],
+ '3': const [PeerInfo_SentBytesEntry$json, PeerInfo_ReceivedBytesEntry$json],
+};
+
+@$core.Deprecated('Use peerInfoDescriptor instead')
+const PeerInfo_SentBytesEntry$json = const {
+ '1': 'SentBytesEntry',
+ '2': const [
+ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
+ const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'},
+ ],
+ '7': const {'7': true},
+};
+
+@$core.Deprecated('Use peerInfoDescriptor instead')
+const PeerInfo_ReceivedBytesEntry$json = const {
+ '1': 'ReceivedBytesEntry',
+ '2': const [
+ const {'1': 'key', '3': 1, '4': 1, '5': 5, '10': 'key'},
+ const {'1': 'value', '3': 2, '4': 1, '5': 3, '10': 'value'},
],
+ '7': const {'7': true},
};
/// Descriptor for `PeerInfo`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List peerInfoDescriptor = $convert.base64Decode('CghQZWVySW5mbxIYCgdtb25pa2VyGAEgASgJUgdtb25pa2VyEhQKBWFnZW50GAIgASgJUgVhZ2VudBIXCgdwZWVyX2lkGAMgASgMUgZwZWVySWQSJQoOY29uc2Vuc3VzX2tleXMYBCADKAlSDWNvbnNlbnN1c0tleXMSFAoFZmxhZ3MYBSABKAVSBWZsYWdzEhYKBmhlaWdodBgGIAEoDVIGaGVpZ2h0EisKEXJlY2VpdmVkX21lc3NhZ2VzGAcgASgFUhByZWNlaXZlZE1lc3NhZ2VzEikKEGludmFsaWRfbWVzc2FnZXMYCCABKAVSD2ludmFsaWRNZXNzYWdlcxIlCg5yZWNlaXZlZF9ieXRlcxgJIAEoBVINcmVjZWl2ZWRCeXRlcxIWCgZzdGF0dXMYCiABKAVSBnN0YXR1cxIbCglsYXN0X3NlbnQYCyABKANSCGxhc3RTZW50EiMKDWxhc3RfcmVjZWl2ZWQYDCABKANSDGxhc3RSZWNlaXZlZBIhCgxzZW5kX3N1Y2Nlc3MYDSABKAVSC3NlbmRTdWNjZXNzEh8KC3NlbmRfZmFpbGVkGA4gASgFUgpzZW5kRmFpbGVk');
+final $typed_data.Uint8List peerInfoDescriptor = $convert.base64Decode('CghQZWVySW5mbxIYCgdtb25pa2VyGAEgASgJUgdtb25pa2VyEhQKBWFnZW50GAIgASgJUgVhZ2VudBIXCgdwZWVyX2lkGAMgASgMUgZwZWVySWQSJQoOY29uc2Vuc3VzX2tleXMYBCADKAlSDWNvbnNlbnN1c0tleXMSFAoFZmxhZ3MYBSABKAVSBWZsYWdzEhYKBmhlaWdodBgGIAEoDVIGaGVpZ2h0EisKEXJlY2VpdmVkX21lc3NhZ2VzGAcgASgFUhByZWNlaXZlZE1lc3NhZ2VzEikKEGludmFsaWRfbWVzc2FnZXMYCCABKAVSD2ludmFsaWRNZXNzYWdlcxI+CgpzZW50X2J5dGVzGAkgAygLMh8ucGFjdHVzLlBlZXJJbmZvLlNlbnRCeXRlc0VudHJ5UglzZW50Qnl0ZXMSSgoOcmVjZWl2ZWRfYnl0ZXMYCiADKAsyIy5wYWN0dXMuUGVlckluZm8uUmVjZWl2ZWRCeXRlc0VudHJ5Ug1yZWNlaXZlZEJ5dGVzEhYKBnN0YXR1cxgLIAEoBVIGc3RhdHVzEhsKCWxhc3Rfc2VudBgMIAEoA1IIbGFzdFNlbnQSIwoNbGFzdF9yZWNlaXZlZBgNIAEoA1IMbGFzdFJlY2VpdmVkEiEKDHNlbmRfc3VjY2VzcxgOIAEoBVILc2VuZFN1Y2Nlc3MSHwoLc2VuZF9mYWlsZWQYDyABKAVSCnNlbmRGYWlsZWQSJgoPbGFzdF9ibG9ja19oYXNoGBAgASgMUg1sYXN0QmxvY2tIYXNoGjwKDlNlbnRCeXRlc0VudHJ5EhAKA2tleRgBIAEoBVIDa2V5EhQKBXZhbHVlGAIgASgDUgV2YWx1ZToCOAEaQAoSUmVjZWl2ZWRCeXRlc0VudHJ5EhAKA2tleRgBIAEoBVIDa2V5EhQKBXZhbHVlGAIgASgDUgV2YWx1ZToCOAE=');
const $core.Map<$core.String, $core.dynamic> NetworkServiceBase$json = const {
'1': 'Network',
'2': const [
@@ -83,6 +129,10 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> NetworkSer
'.pactus.GetNetworkInfoRequest': GetNetworkInfoRequest$json,
'.pactus.GetNetworkInfoResponse': GetNetworkInfoResponse$json,
'.pactus.PeerInfo': PeerInfo$json,
+ '.pactus.PeerInfo.SentBytesEntry': PeerInfo_SentBytesEntry$json,
+ '.pactus.PeerInfo.ReceivedBytesEntry': PeerInfo_ReceivedBytesEntry$json,
+ '.pactus.GetNetworkInfoResponse.SentBytesEntry': GetNetworkInfoResponse_SentBytesEntry$json,
+ '.pactus.GetNetworkInfoResponse.ReceivedBytesEntry': GetNetworkInfoResponse_ReceivedBytesEntry$json,
'.pactus.GetNodeInfoRequest': GetNodeInfoRequest$json,
'.pactus.GetNodeInfoResponse': GetNodeInfoResponse$json,
};
diff --git a/www/grpc/gen/dart/transaction.pb.dart b/www/grpc/gen/dart/transaction.pb.dart
index 5c221eaec..367c181d7 100644
--- a/www/grpc/gen/dart/transaction.pb.dart
+++ b/www/grpc/gen/dart/transaction.pb.dart
@@ -153,6 +153,114 @@ class GetTransactionResponse extends $pb.GeneratedMessage {
void clearBlockTime() => clearField(13);
}
+class CalculateFeeRequest extends $pb.GeneratedMessage {
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CalculateFeeRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
+ ..aInt64(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'amount')
+ ..e(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payloadType', $pb.PbFieldType.OE, protoName: 'payloadType', defaultOrMaker: PayloadType.UNKNOWN, valueOf: PayloadType.valueOf, enumValues: PayloadType.values)
+ ..hasRequiredFields = false
+ ;
+
+ CalculateFeeRequest._() : super();
+ factory CalculateFeeRequest({
+ $fixnum.Int64? amount,
+ PayloadType? payloadType,
+ }) {
+ final _result = create();
+ if (amount != null) {
+ _result.amount = amount;
+ }
+ if (payloadType != null) {
+ _result.payloadType = payloadType;
+ }
+ return _result;
+ }
+ factory CalculateFeeRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory CalculateFeeRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ CalculateFeeRequest clone() => CalculateFeeRequest()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ CalculateFeeRequest copyWith(void Function(CalculateFeeRequest) updates) => super.copyWith((message) => updates(message as CalculateFeeRequest)) as CalculateFeeRequest; // ignore: deprecated_member_use
+ $pb.BuilderInfo get info_ => _i;
+ @$core.pragma('dart2js:noInline')
+ static CalculateFeeRequest create() => CalculateFeeRequest._();
+ CalculateFeeRequest createEmptyInstance() => create();
+ static $pb.PbList createRepeated() => $pb.PbList();
+ @$core.pragma('dart2js:noInline')
+ static CalculateFeeRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create);
+ static CalculateFeeRequest? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ $fixnum.Int64 get amount => $_getI64(0);
+ @$pb.TagNumber(1)
+ set amount($fixnum.Int64 v) { $_setInt64(0, v); }
+ @$pb.TagNumber(1)
+ $core.bool hasAmount() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearAmount() => clearField(1);
+
+ @$pb.TagNumber(2)
+ PayloadType get payloadType => $_getN(1);
+ @$pb.TagNumber(2)
+ set payloadType(PayloadType v) { setField(2, v); }
+ @$pb.TagNumber(2)
+ $core.bool hasPayloadType() => $_has(1);
+ @$pb.TagNumber(2)
+ void clearPayloadType() => clearField(2);
+}
+
+class CalculateFeeResponse extends $pb.GeneratedMessage {
+ static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CalculateFeeResponse', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
+ ..aInt64(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fee')
+ ..hasRequiredFields = false
+ ;
+
+ CalculateFeeResponse._() : super();
+ factory CalculateFeeResponse({
+ $fixnum.Int64? fee,
+ }) {
+ final _result = create();
+ if (fee != null) {
+ _result.fee = fee;
+ }
+ return _result;
+ }
+ factory CalculateFeeResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+ factory CalculateFeeResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
+ 'Will be removed in next major version')
+ CalculateFeeResponse clone() => CalculateFeeResponse()..mergeFromMessage(this);
+ @$core.Deprecated(
+ 'Using this can add significant overhead to your binary. '
+ 'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
+ 'Will be removed in next major version')
+ CalculateFeeResponse copyWith(void Function(CalculateFeeResponse) updates) => super.copyWith((message) => updates(message as CalculateFeeResponse)) as CalculateFeeResponse; // ignore: deprecated_member_use
+ $pb.BuilderInfo get info_ => _i;
+ @$core.pragma('dart2js:noInline')
+ static CalculateFeeResponse create() => CalculateFeeResponse._();
+ CalculateFeeResponse createEmptyInstance() => create();
+ static $pb.PbList createRepeated() => $pb.PbList();
+ @$core.pragma('dart2js:noInline')
+ static CalculateFeeResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create);
+ static CalculateFeeResponse? _defaultInstance;
+
+ @$pb.TagNumber(1)
+ $fixnum.Int64 get fee => $_getI64(0);
+ @$pb.TagNumber(1)
+ set fee($fixnum.Int64 v) { $_setInt64(0, v); }
+ @$pb.TagNumber(1)
+ $core.bool hasFee() => $_has(0);
+ @$pb.TagNumber(1)
+ void clearFee() => clearField(1);
+}
+
class SendRawTransactionRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SendRawTransactionRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..a<$core.List<$core.int>>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'data', $pb.PbFieldType.OY)
@@ -607,7 +715,7 @@ class TransactionInfo extends $pb.GeneratedMessage {
..a<$core.int>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'sequence', $pb.PbFieldType.O3)
..aInt64(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
..aInt64(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fee')
- ..e(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'PayloadType', $pb.PbFieldType.OE, protoName: 'PayloadType', defaultOrMaker: PayloadType.UNKNOWN, valueOf: PayloadType.valueOf, enumValues: PayloadType.values)
+ ..e(8, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'payloadType', $pb.PbFieldType.OE, protoName: 'payloadType', defaultOrMaker: PayloadType.UNKNOWN, valueOf: PayloadType.valueOf, enumValues: PayloadType.values)
..aOS(9, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'memo')
..aOS(10, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'publicKey')
..a<$core.List<$core.int>>(11, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'signature', $pb.PbFieldType.OY)
@@ -876,6 +984,10 @@ class TransactionApi {
var emptyResponse = GetTransactionResponse();
return _client.invoke(ctx, 'Transaction', 'GetTransaction', request, emptyResponse);
}
+ $async.Future calculateFee($pb.ClientContext? ctx, CalculateFeeRequest request) {
+ var emptyResponse = CalculateFeeResponse();
+ return _client.invoke(ctx, 'Transaction', 'CalculateFee', request, emptyResponse);
+ }
$async.Future sendRawTransaction($pb.ClientContext? ctx, SendRawTransactionRequest request) {
var emptyResponse = SendRawTransactionResponse();
return _client.invoke(ctx, 'Transaction', 'SendRawTransaction', request, emptyResponse);
diff --git a/www/grpc/gen/dart/transaction.pbjson.dart b/www/grpc/gen/dart/transaction.pbjson.dart
index 69cfbd549..e3170dbc4 100644
--- a/www/grpc/gen/dart/transaction.pbjson.dart
+++ b/www/grpc/gen/dart/transaction.pbjson.dart
@@ -57,6 +57,27 @@ const GetTransactionResponse$json = const {
/// Descriptor for `GetTransactionResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getTransactionResponseDescriptor = $convert.base64Decode('ChZHZXRUcmFuc2FjdGlvblJlc3BvbnNlEiEKDGJsb2NrX2hlaWdodBgMIAEoDVILYmxvY2tIZWlnaHQSHQoKYmxvY2tfdGltZRgNIAEoDVIJYmxvY2tUaW1lEjkKC3RyYW5zYWN0aW9uGAMgASgLMhcucGFjdHVzLlRyYW5zYWN0aW9uSW5mb1ILdHJhbnNhY3Rpb24=');
+@$core.Deprecated('Use calculateFeeRequestDescriptor instead')
+const CalculateFeeRequest$json = const {
+ '1': 'CalculateFeeRequest',
+ '2': const [
+ const {'1': 'amount', '3': 1, '4': 1, '5': 3, '10': 'amount'},
+ const {'1': 'payloadType', '3': 2, '4': 1, '5': 14, '6': '.pactus.PayloadType', '10': 'payloadType'},
+ ],
+};
+
+/// Descriptor for `CalculateFeeRequest`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List calculateFeeRequestDescriptor = $convert.base64Decode('ChNDYWxjdWxhdGVGZWVSZXF1ZXN0EhYKBmFtb3VudBgBIAEoA1IGYW1vdW50EjUKC3BheWxvYWRUeXBlGAIgASgOMhMucGFjdHVzLlBheWxvYWRUeXBlUgtwYXlsb2FkVHlwZQ==');
+@$core.Deprecated('Use calculateFeeResponseDescriptor instead')
+const CalculateFeeResponse$json = const {
+ '1': 'CalculateFeeResponse',
+ '2': const [
+ const {'1': 'fee', '3': 1, '4': 1, '5': 3, '10': 'fee'},
+ ],
+};
+
+/// Descriptor for `CalculateFeeResponse`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List calculateFeeResponseDescriptor = $convert.base64Decode('ChRDYWxjdWxhdGVGZWVSZXNwb25zZRIQCgNmZWUYASABKANSA2ZlZQ==');
@$core.Deprecated('Use sendRawTransactionRequestDescriptor instead')
const SendRawTransactionRequest$json = const {
'1': 'SendRawTransactionRequest',
@@ -145,7 +166,7 @@ const TransactionInfo$json = const {
const {'1': 'sequence', '3': 5, '4': 1, '5': 5, '10': 'sequence'},
const {'1': 'value', '3': 6, '4': 1, '5': 3, '10': 'value'},
const {'1': 'fee', '3': 7, '4': 1, '5': 3, '10': 'fee'},
- const {'1': 'PayloadType', '3': 8, '4': 1, '5': 14, '6': '.pactus.PayloadType', '10': 'PayloadType'},
+ const {'1': 'payloadType', '3': 8, '4': 1, '5': 14, '6': '.pactus.PayloadType', '10': 'payloadType'},
const {'1': 'transfer', '3': 30, '4': 1, '5': 11, '6': '.pactus.PayloadTransfer', '9': 0, '10': 'transfer'},
const {'1': 'bond', '3': 31, '4': 1, '5': 11, '6': '.pactus.PayloadBond', '9': 0, '10': 'bond'},
const {'1': 'sortition', '3': 32, '4': 1, '5': 11, '6': '.pactus.PayloadSortition', '9': 0, '10': 'sortition'},
@@ -156,16 +177,17 @@ const TransactionInfo$json = const {
const {'1': 'signature', '3': 11, '4': 1, '5': 12, '10': 'signature'},
],
'8': const [
- const {'1': 'Payload'},
+ const {'1': 'payload'},
],
};
/// Descriptor for `TransactionInfo`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List transactionInfoDescriptor = $convert.base64Decode('Cg9UcmFuc2FjdGlvbkluZm8SDgoCaWQYASABKAxSAmlkEhIKBGRhdGEYAiABKAxSBGRhdGESGAoHdmVyc2lvbhgDIAEoBVIHdmVyc2lvbhIUCgVzdGFtcBgEIAEoDFIFc3RhbXASGgoIc2VxdWVuY2UYBSABKAVSCHNlcXVlbmNlEhQKBXZhbHVlGAYgASgDUgV2YWx1ZRIQCgNmZWUYByABKANSA2ZlZRI1CgtQYXlsb2FkVHlwZRgIIAEoDjITLnBhY3R1cy5QYXlsb2FkVHlwZVILUGF5bG9hZFR5cGUSNQoIdHJhbnNmZXIYHiABKAsyFy5wYWN0dXMuUGF5bG9hZFRyYW5zZmVySABSCHRyYW5zZmVyEikKBGJvbmQYHyABKAsyEy5wYWN0dXMuUGF5bG9hZEJvbmRIAFIEYm9uZBI4Cglzb3J0aXRpb24YICABKAsyGC5wYWN0dXMuUGF5bG9hZFNvcnRpdGlvbkgAUglzb3J0aXRpb24SLwoGdW5ib25kGCEgASgLMhUucGFjdHVzLlBheWxvYWRVbmJvbmRIAFIGdW5ib25kEjUKCHdpdGhkcmF3GCIgASgLMhcucGFjdHVzLlBheWxvYWRXaXRoZHJhd0gAUgh3aXRoZHJhdxISCgRtZW1vGAkgASgJUgRtZW1vEh0KCnB1YmxpY19rZXkYCiABKAlSCXB1YmxpY0tleRIcCglzaWduYXR1cmUYCyABKAxSCXNpZ25hdHVyZUIJCgdQYXlsb2Fk');
+final $typed_data.Uint8List transactionInfoDescriptor = $convert.base64Decode('Cg9UcmFuc2FjdGlvbkluZm8SDgoCaWQYASABKAxSAmlkEhIKBGRhdGEYAiABKAxSBGRhdGESGAoHdmVyc2lvbhgDIAEoBVIHdmVyc2lvbhIUCgVzdGFtcBgEIAEoDFIFc3RhbXASGgoIc2VxdWVuY2UYBSABKAVSCHNlcXVlbmNlEhQKBXZhbHVlGAYgASgDUgV2YWx1ZRIQCgNmZWUYByABKANSA2ZlZRI1CgtwYXlsb2FkVHlwZRgIIAEoDjITLnBhY3R1cy5QYXlsb2FkVHlwZVILcGF5bG9hZFR5cGUSNQoIdHJhbnNmZXIYHiABKAsyFy5wYWN0dXMuUGF5bG9hZFRyYW5zZmVySABSCHRyYW5zZmVyEikKBGJvbmQYHyABKAsyEy5wYWN0dXMuUGF5bG9hZEJvbmRIAFIEYm9uZBI4Cglzb3J0aXRpb24YICABKAsyGC5wYWN0dXMuUGF5bG9hZFNvcnRpdGlvbkgAUglzb3J0aXRpb24SLwoGdW5ib25kGCEgASgLMhUucGFjdHVzLlBheWxvYWRVbmJvbmRIAFIGdW5ib25kEjUKCHdpdGhkcmF3GCIgASgLMhcucGFjdHVzLlBheWxvYWRXaXRoZHJhd0gAUgh3aXRoZHJhdxISCgRtZW1vGAkgASgJUgRtZW1vEh0KCnB1YmxpY19rZXkYCiABKAlSCXB1YmxpY0tleRIcCglzaWduYXR1cmUYCyABKAxSCXNpZ25hdHVyZUIJCgdwYXlsb2Fk');
const $core.Map<$core.String, $core.dynamic> TransactionServiceBase$json = const {
'1': 'Transaction',
'2': const [
const {'1': 'GetTransaction', '2': '.pactus.GetTransactionRequest', '3': '.pactus.GetTransactionResponse'},
+ const {'1': 'CalculateFee', '2': '.pactus.CalculateFeeRequest', '3': '.pactus.CalculateFeeResponse'},
const {'1': 'SendRawTransaction', '2': '.pactus.SendRawTransactionRequest', '3': '.pactus.SendRawTransactionResponse'},
],
};
@@ -180,9 +202,11 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> Transactio
'.pactus.PayloadSortition': PayloadSortition$json,
'.pactus.PayloadUnbond': PayloadUnbond$json,
'.pactus.PayloadWithdraw': PayloadWithdraw$json,
+ '.pactus.CalculateFeeRequest': CalculateFeeRequest$json,
+ '.pactus.CalculateFeeResponse': CalculateFeeResponse$json,
'.pactus.SendRawTransactionRequest': SendRawTransactionRequest$json,
'.pactus.SendRawTransactionResponse': SendRawTransactionResponse$json,
};
/// Descriptor for `Transaction`. Decode as a `google.protobuf.ServiceDescriptorProto`.
-final $typed_data.Uint8List transactionServiceDescriptor = $convert.base64Decode('CgtUcmFuc2FjdGlvbhJPCg5HZXRUcmFuc2FjdGlvbhIdLnBhY3R1cy5HZXRUcmFuc2FjdGlvblJlcXVlc3QaHi5wYWN0dXMuR2V0VHJhbnNhY3Rpb25SZXNwb25zZRJbChJTZW5kUmF3VHJhbnNhY3Rpb24SIS5wYWN0dXMuU2VuZFJhd1RyYW5zYWN0aW9uUmVxdWVzdBoiLnBhY3R1cy5TZW5kUmF3VHJhbnNhY3Rpb25SZXNwb25zZQ==');
+final $typed_data.Uint8List transactionServiceDescriptor = $convert.base64Decode('CgtUcmFuc2FjdGlvbhJPCg5HZXRUcmFuc2FjdGlvbhIdLnBhY3R1cy5HZXRUcmFuc2FjdGlvblJlcXVlc3QaHi5wYWN0dXMuR2V0VHJhbnNhY3Rpb25SZXNwb25zZRJJCgxDYWxjdWxhdGVGZWUSGy5wYWN0dXMuQ2FsY3VsYXRlRmVlUmVxdWVzdBocLnBhY3R1cy5DYWxjdWxhdGVGZWVSZXNwb25zZRJbChJTZW5kUmF3VHJhbnNhY3Rpb24SIS5wYWN0dXMuU2VuZFJhd1RyYW5zYWN0aW9uUmVxdWVzdBoiLnBhY3R1cy5TZW5kUmF3VHJhbnNhY3Rpb25SZXNwb25zZQ==');
diff --git a/www/grpc/gen/dart/transaction.pbserver.dart b/www/grpc/gen/dart/transaction.pbserver.dart
index 78a8901db..f5b474081 100644
--- a/www/grpc/gen/dart/transaction.pbserver.dart
+++ b/www/grpc/gen/dart/transaction.pbserver.dart
@@ -17,11 +17,13 @@ export 'transaction.pb.dart';
abstract class TransactionServiceBase extends $pb.GeneratedService {
$async.Future<$0.GetTransactionResponse> getTransaction($pb.ServerContext ctx, $0.GetTransactionRequest request);
+ $async.Future<$0.CalculateFeeResponse> calculateFee($pb.ServerContext ctx, $0.CalculateFeeRequest request);
$async.Future<$0.SendRawTransactionResponse> sendRawTransaction($pb.ServerContext ctx, $0.SendRawTransactionRequest request);
$pb.GeneratedMessage createRequest($core.String method) {
switch (method) {
case 'GetTransaction': return $0.GetTransactionRequest();
+ case 'CalculateFee': return $0.CalculateFeeRequest();
case 'SendRawTransaction': return $0.SendRawTransactionRequest();
default: throw $core.ArgumentError('Unknown method: $method');
}
@@ -30,6 +32,7 @@ abstract class TransactionServiceBase extends $pb.GeneratedService {
$async.Future<$pb.GeneratedMessage> handleCall($pb.ServerContext ctx, $core.String method, $pb.GeneratedMessage request) {
switch (method) {
case 'GetTransaction': return this.getTransaction(ctx, request as $0.GetTransactionRequest);
+ case 'CalculateFee': return this.calculateFee(ctx, request as $0.CalculateFeeRequest);
case 'SendRawTransaction': return this.sendRawTransaction(ctx, request as $0.SendRawTransactionRequest);
default: throw $core.ArgumentError('Unknown method: $method');
}
diff --git a/www/grpc/gen/go/blockchain.pb.go b/www/grpc/gen/go/blockchain.pb.go
index d7db7a146..44fcf0c0f 100644
--- a/www/grpc/gen/go/blockchain.pb.go
+++ b/www/grpc/gen/go/blockchain.pb.go
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.28.1
+// protoc-gen-go v1.26.0
// protoc (unknown)
// source: blockchain.proto
@@ -262,44 +262,6 @@ func (x *GetAccountResponse) GetAccount() *AccountInfo {
return nil
}
-type GetValidatorsRequest struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-}
-
-func (x *GetValidatorsRequest) Reset() {
- *x = GetValidatorsRequest{}
- if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[3]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetValidatorsRequest) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetValidatorsRequest) ProtoMessage() {}
-
-func (x *GetValidatorsRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[3]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetValidatorsRequest.ProtoReflect.Descriptor instead.
-func (*GetValidatorsRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{3}
-}
-
type GetValidatorAddressesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -309,7 +271,7 @@ type GetValidatorAddressesRequest struct {
func (x *GetValidatorAddressesRequest) Reset() {
*x = GetValidatorAddressesRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[4]
+ mi := &file_blockchain_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -322,7 +284,7 @@ func (x *GetValidatorAddressesRequest) String() string {
func (*GetValidatorAddressesRequest) ProtoMessage() {}
func (x *GetValidatorAddressesRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[4]
+ mi := &file_blockchain_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -335,7 +297,7 @@ func (x *GetValidatorAddressesRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetValidatorAddressesRequest.ProtoReflect.Descriptor instead.
func (*GetValidatorAddressesRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{4}
+ return file_blockchain_proto_rawDescGZIP(), []int{3}
}
type GetValidatorAddressesResponse struct {
@@ -349,7 +311,7 @@ type GetValidatorAddressesResponse struct {
func (x *GetValidatorAddressesResponse) Reset() {
*x = GetValidatorAddressesResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[5]
+ mi := &file_blockchain_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -362,7 +324,7 @@ func (x *GetValidatorAddressesResponse) String() string {
func (*GetValidatorAddressesResponse) ProtoMessage() {}
func (x *GetValidatorAddressesResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[5]
+ mi := &file_blockchain_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -375,7 +337,7 @@ func (x *GetValidatorAddressesResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetValidatorAddressesResponse.ProtoReflect.Descriptor instead.
func (*GetValidatorAddressesResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{5}
+ return file_blockchain_proto_rawDescGZIP(), []int{4}
}
func (x *GetValidatorAddressesResponse) GetAddresses() []string {
@@ -396,7 +358,7 @@ type GetValidatorRequest struct {
func (x *GetValidatorRequest) Reset() {
*x = GetValidatorRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[6]
+ mi := &file_blockchain_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -409,7 +371,7 @@ func (x *GetValidatorRequest) String() string {
func (*GetValidatorRequest) ProtoMessage() {}
func (x *GetValidatorRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[6]
+ mi := &file_blockchain_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -422,7 +384,7 @@ func (x *GetValidatorRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetValidatorRequest.ProtoReflect.Descriptor instead.
func (*GetValidatorRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{6}
+ return file_blockchain_proto_rawDescGZIP(), []int{5}
}
func (x *GetValidatorRequest) GetAddress() string {
@@ -443,7 +405,7 @@ type GetValidatorByNumberRequest struct {
func (x *GetValidatorByNumberRequest) Reset() {
*x = GetValidatorByNumberRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[7]
+ mi := &file_blockchain_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -456,7 +418,7 @@ func (x *GetValidatorByNumberRequest) String() string {
func (*GetValidatorByNumberRequest) ProtoMessage() {}
func (x *GetValidatorByNumberRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[7]
+ mi := &file_blockchain_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -469,7 +431,7 @@ func (x *GetValidatorByNumberRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetValidatorByNumberRequest.ProtoReflect.Descriptor instead.
func (*GetValidatorByNumberRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{7}
+ return file_blockchain_proto_rawDescGZIP(), []int{6}
}
func (x *GetValidatorByNumberRequest) GetNumber() int32 {
@@ -479,53 +441,6 @@ func (x *GetValidatorByNumberRequest) GetNumber() int32 {
return 0
}
-type GetValidatorsResponse struct {
- state protoimpl.MessageState
- sizeCache protoimpl.SizeCache
- unknownFields protoimpl.UnknownFields
-
- Validators []*ValidatorInfo `protobuf:"bytes,1,rep,name=validators,proto3" json:"validators,omitempty"`
-}
-
-func (x *GetValidatorsResponse) Reset() {
- *x = GetValidatorsResponse{}
- if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[8]
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- ms.StoreMessageInfo(mi)
- }
-}
-
-func (x *GetValidatorsResponse) String() string {
- return protoimpl.X.MessageStringOf(x)
-}
-
-func (*GetValidatorsResponse) ProtoMessage() {}
-
-func (x *GetValidatorsResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[8]
- if protoimpl.UnsafeEnabled && x != nil {
- ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
- if ms.LoadMessageInfo() == nil {
- ms.StoreMessageInfo(mi)
- }
- return ms
- }
- return mi.MessageOf(x)
-}
-
-// Deprecated: Use GetValidatorsResponse.ProtoReflect.Descriptor instead.
-func (*GetValidatorsResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{8}
-}
-
-func (x *GetValidatorsResponse) GetValidators() []*ValidatorInfo {
- if x != nil {
- return x.Validators
- }
- return nil
-}
-
type GetValidatorResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -537,7 +452,7 @@ type GetValidatorResponse struct {
func (x *GetValidatorResponse) Reset() {
*x = GetValidatorResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[9]
+ mi := &file_blockchain_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -550,7 +465,7 @@ func (x *GetValidatorResponse) String() string {
func (*GetValidatorResponse) ProtoMessage() {}
func (x *GetValidatorResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[9]
+ mi := &file_blockchain_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -563,7 +478,7 @@ func (x *GetValidatorResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetValidatorResponse.ProtoReflect.Descriptor instead.
func (*GetValidatorResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{9}
+ return file_blockchain_proto_rawDescGZIP(), []int{7}
}
func (x *GetValidatorResponse) GetValidator() *ValidatorInfo {
@@ -585,7 +500,7 @@ type GetBlockRequest struct {
func (x *GetBlockRequest) Reset() {
*x = GetBlockRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[10]
+ mi := &file_blockchain_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -598,7 +513,7 @@ func (x *GetBlockRequest) String() string {
func (*GetBlockRequest) ProtoMessage() {}
func (x *GetBlockRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[10]
+ mi := &file_blockchain_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -611,7 +526,7 @@ func (x *GetBlockRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockRequest.ProtoReflect.Descriptor instead.
func (*GetBlockRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{10}
+ return file_blockchain_proto_rawDescGZIP(), []int{8}
}
func (x *GetBlockRequest) GetHeight() uint32 {
@@ -645,7 +560,7 @@ type GetBlockResponse struct {
func (x *GetBlockResponse) Reset() {
*x = GetBlockResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[11]
+ mi := &file_blockchain_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -658,7 +573,7 @@ func (x *GetBlockResponse) String() string {
func (*GetBlockResponse) ProtoMessage() {}
func (x *GetBlockResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[11]
+ mi := &file_blockchain_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -671,7 +586,7 @@ func (x *GetBlockResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockResponse.ProtoReflect.Descriptor instead.
func (*GetBlockResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{11}
+ return file_blockchain_proto_rawDescGZIP(), []int{9}
}
func (x *GetBlockResponse) GetHeight() uint32 {
@@ -734,7 +649,7 @@ type GetBlockHashRequest struct {
func (x *GetBlockHashRequest) Reset() {
*x = GetBlockHashRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[12]
+ mi := &file_blockchain_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -747,7 +662,7 @@ func (x *GetBlockHashRequest) String() string {
func (*GetBlockHashRequest) ProtoMessage() {}
func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[12]
+ mi := &file_blockchain_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -760,7 +675,7 @@ func (x *GetBlockHashRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockHashRequest.ProtoReflect.Descriptor instead.
func (*GetBlockHashRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{12}
+ return file_blockchain_proto_rawDescGZIP(), []int{10}
}
func (x *GetBlockHashRequest) GetHeight() uint32 {
@@ -781,7 +696,7 @@ type GetBlockHashResponse struct {
func (x *GetBlockHashResponse) Reset() {
*x = GetBlockHashResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[13]
+ mi := &file_blockchain_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -794,7 +709,7 @@ func (x *GetBlockHashResponse) String() string {
func (*GetBlockHashResponse) ProtoMessage() {}
func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[13]
+ mi := &file_blockchain_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -807,7 +722,7 @@ func (x *GetBlockHashResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockHashResponse.ProtoReflect.Descriptor instead.
func (*GetBlockHashResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{13}
+ return file_blockchain_proto_rawDescGZIP(), []int{11}
}
func (x *GetBlockHashResponse) GetHash() []byte {
@@ -828,7 +743,7 @@ type GetBlockHeightRequest struct {
func (x *GetBlockHeightRequest) Reset() {
*x = GetBlockHeightRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[14]
+ mi := &file_blockchain_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -841,7 +756,7 @@ func (x *GetBlockHeightRequest) String() string {
func (*GetBlockHeightRequest) ProtoMessage() {}
func (x *GetBlockHeightRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[14]
+ mi := &file_blockchain_proto_msgTypes[12]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -854,7 +769,7 @@ func (x *GetBlockHeightRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockHeightRequest.ProtoReflect.Descriptor instead.
func (*GetBlockHeightRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{14}
+ return file_blockchain_proto_rawDescGZIP(), []int{12}
}
func (x *GetBlockHeightRequest) GetHash() []byte {
@@ -875,7 +790,7 @@ type GetBlockHeightResponse struct {
func (x *GetBlockHeightResponse) Reset() {
*x = GetBlockHeightResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[15]
+ mi := &file_blockchain_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -888,7 +803,7 @@ func (x *GetBlockHeightResponse) String() string {
func (*GetBlockHeightResponse) ProtoMessage() {}
func (x *GetBlockHeightResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[15]
+ mi := &file_blockchain_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -901,7 +816,7 @@ func (x *GetBlockHeightResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockHeightResponse.ProtoReflect.Descriptor instead.
func (*GetBlockHeightResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{15}
+ return file_blockchain_proto_rawDescGZIP(), []int{13}
}
func (x *GetBlockHeightResponse) GetHeight() uint32 {
@@ -920,7 +835,7 @@ type GetBlockchainInfoRequest struct {
func (x *GetBlockchainInfoRequest) Reset() {
*x = GetBlockchainInfoRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[16]
+ mi := &file_blockchain_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -933,7 +848,7 @@ func (x *GetBlockchainInfoRequest) String() string {
func (*GetBlockchainInfoRequest) ProtoMessage() {}
func (x *GetBlockchainInfoRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[16]
+ mi := &file_blockchain_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -946,7 +861,7 @@ func (x *GetBlockchainInfoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockchainInfoRequest.ProtoReflect.Descriptor instead.
func (*GetBlockchainInfoRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{16}
+ return file_blockchain_proto_rawDescGZIP(), []int{14}
}
type GetBlockchainInfoResponse struct {
@@ -966,7 +881,7 @@ type GetBlockchainInfoResponse struct {
func (x *GetBlockchainInfoResponse) Reset() {
*x = GetBlockchainInfoResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[17]
+ mi := &file_blockchain_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -979,7 +894,7 @@ func (x *GetBlockchainInfoResponse) String() string {
func (*GetBlockchainInfoResponse) ProtoMessage() {}
func (x *GetBlockchainInfoResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[17]
+ mi := &file_blockchain_proto_msgTypes[15]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -992,7 +907,7 @@ func (x *GetBlockchainInfoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetBlockchainInfoResponse.ProtoReflect.Descriptor instead.
func (*GetBlockchainInfoResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{17}
+ return file_blockchain_proto_rawDescGZIP(), []int{15}
}
func (x *GetBlockchainInfoResponse) GetLastBlockHeight() uint32 {
@@ -1053,7 +968,7 @@ type GetConsensusInfoRequest struct {
func (x *GetConsensusInfoRequest) Reset() {
*x = GetConsensusInfoRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[18]
+ mi := &file_blockchain_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1066,7 +981,7 @@ func (x *GetConsensusInfoRequest) String() string {
func (*GetConsensusInfoRequest) ProtoMessage() {}
func (x *GetConsensusInfoRequest) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[18]
+ mi := &file_blockchain_proto_msgTypes[16]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1079,7 +994,7 @@ func (x *GetConsensusInfoRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetConsensusInfoRequest.ProtoReflect.Descriptor instead.
func (*GetConsensusInfoRequest) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{18}
+ return file_blockchain_proto_rawDescGZIP(), []int{16}
}
type GetConsensusInfoResponse struct {
@@ -1093,7 +1008,7 @@ type GetConsensusInfoResponse struct {
func (x *GetConsensusInfoResponse) Reset() {
*x = GetConsensusInfoResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[19]
+ mi := &file_blockchain_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1106,7 +1021,7 @@ func (x *GetConsensusInfoResponse) String() string {
func (*GetConsensusInfoResponse) ProtoMessage() {}
func (x *GetConsensusInfoResponse) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[19]
+ mi := &file_blockchain_proto_msgTypes[17]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1119,7 +1034,7 @@ func (x *GetConsensusInfoResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetConsensusInfoResponse.ProtoReflect.Descriptor instead.
func (*GetConsensusInfoResponse) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{19}
+ return file_blockchain_proto_rawDescGZIP(), []int{17}
}
func (x *GetConsensusInfoResponse) GetInstances() []*ConsensusInfo {
@@ -1134,22 +1049,22 @@ type ValidatorInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
- Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
- PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
- Number int32 `protobuf:"varint,4,opt,name=number,proto3" json:"number,omitempty"`
- Sequence int32 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
- Stake int64 `protobuf:"varint,6,opt,name=stake,proto3" json:"stake,omitempty"`
- LastBondingHeight uint32 `protobuf:"varint,7,opt,name=last_bonding_height,json=lastBondingHeight,proto3" json:"last_bonding_height,omitempty"`
- LastJoinedHeight uint32 `protobuf:"varint,8,opt,name=last_joined_height,json=lastJoinedHeight,proto3" json:"last_joined_height,omitempty"`
- UnbondingHeight uint32 `protobuf:"varint,9,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"`
- Address string `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"`
+ Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
+ Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
+ PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
+ Number int32 `protobuf:"varint,4,opt,name=number,proto3" json:"number,omitempty"`
+ Sequence int32 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
+ Stake int64 `protobuf:"varint,6,opt,name=stake,proto3" json:"stake,omitempty"`
+ LastBondingHeight uint32 `protobuf:"varint,7,opt,name=last_bonding_height,json=lastBondingHeight,proto3" json:"last_bonding_height,omitempty"`
+ LastSortitionHeight uint32 `protobuf:"varint,8,opt,name=last_sortition_height,json=lastSortitionHeight,proto3" json:"last_sortition_height,omitempty"`
+ UnbondingHeight uint32 `protobuf:"varint,9,opt,name=unbonding_height,json=unbondingHeight,proto3" json:"unbonding_height,omitempty"`
+ Address string `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"`
}
func (x *ValidatorInfo) Reset() {
*x = ValidatorInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[20]
+ mi := &file_blockchain_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1162,7 +1077,7 @@ func (x *ValidatorInfo) String() string {
func (*ValidatorInfo) ProtoMessage() {}
func (x *ValidatorInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[20]
+ mi := &file_blockchain_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1175,7 +1090,7 @@ func (x *ValidatorInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ValidatorInfo.ProtoReflect.Descriptor instead.
func (*ValidatorInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{20}
+ return file_blockchain_proto_rawDescGZIP(), []int{18}
}
func (x *ValidatorInfo) GetHash() []byte {
@@ -1227,9 +1142,9 @@ func (x *ValidatorInfo) GetLastBondingHeight() uint32 {
return 0
}
-func (x *ValidatorInfo) GetLastJoinedHeight() uint32 {
+func (x *ValidatorInfo) GetLastSortitionHeight() uint32 {
if x != nil {
- return x.LastJoinedHeight
+ return x.LastSortitionHeight
}
return 0
}
@@ -1263,7 +1178,7 @@ type AccountInfo struct {
func (x *AccountInfo) Reset() {
*x = AccountInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[21]
+ mi := &file_blockchain_proto_msgTypes[19]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1276,7 +1191,7 @@ func (x *AccountInfo) String() string {
func (*AccountInfo) ProtoMessage() {}
func (x *AccountInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[21]
+ mi := &file_blockchain_proto_msgTypes[19]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1289,7 +1204,7 @@ func (x *AccountInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use AccountInfo.ProtoReflect.Descriptor instead.
func (*AccountInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{21}
+ return file_blockchain_proto_rawDescGZIP(), []int{19}
}
func (x *AccountInfo) GetHash() []byte {
@@ -1342,7 +1257,7 @@ type BlockHeaderInfo struct {
func (x *BlockHeaderInfo) Reset() {
*x = BlockHeaderInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[22]
+ mi := &file_blockchain_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1355,7 +1270,7 @@ func (x *BlockHeaderInfo) String() string {
func (*BlockHeaderInfo) ProtoMessage() {}
func (x *BlockHeaderInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[22]
+ mi := &file_blockchain_proto_msgTypes[20]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1368,7 +1283,7 @@ func (x *BlockHeaderInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use BlockHeaderInfo.ProtoReflect.Descriptor instead.
func (*BlockHeaderInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{22}
+ return file_blockchain_proto_rawDescGZIP(), []int{20}
}
func (x *BlockHeaderInfo) GetVersion() int32 {
@@ -1421,7 +1336,7 @@ type CertificateInfo struct {
func (x *CertificateInfo) Reset() {
*x = CertificateInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[23]
+ mi := &file_blockchain_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1434,7 +1349,7 @@ func (x *CertificateInfo) String() string {
func (*CertificateInfo) ProtoMessage() {}
func (x *CertificateInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[23]
+ mi := &file_blockchain_proto_msgTypes[21]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1447,7 +1362,7 @@ func (x *CertificateInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use CertificateInfo.ProtoReflect.Descriptor instead.
func (*CertificateInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{23}
+ return file_blockchain_proto_rawDescGZIP(), []int{21}
}
func (x *CertificateInfo) GetHash() []byte {
@@ -1499,7 +1414,7 @@ type VoteInfo struct {
func (x *VoteInfo) Reset() {
*x = VoteInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[24]
+ mi := &file_blockchain_proto_msgTypes[22]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1512,7 +1427,7 @@ func (x *VoteInfo) String() string {
func (*VoteInfo) ProtoMessage() {}
func (x *VoteInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[24]
+ mi := &file_blockchain_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1525,7 +1440,7 @@ func (x *VoteInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use VoteInfo.ProtoReflect.Descriptor instead.
func (*VoteInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{24}
+ return file_blockchain_proto_rawDescGZIP(), []int{22}
}
func (x *VoteInfo) GetType() VoteType {
@@ -1571,7 +1486,7 @@ type ConsensusInfo struct {
func (x *ConsensusInfo) Reset() {
*x = ConsensusInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_blockchain_proto_msgTypes[25]
+ mi := &file_blockchain_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1584,7 +1499,7 @@ func (x *ConsensusInfo) String() string {
func (*ConsensusInfo) ProtoMessage() {}
func (x *ConsensusInfo) ProtoReflect() protoreflect.Message {
- mi := &file_blockchain_proto_msgTypes[25]
+ mi := &file_blockchain_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1597,7 +1512,7 @@ func (x *ConsensusInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use ConsensusInfo.ProtoReflect.Descriptor instead.
func (*ConsensusInfo) Descriptor() ([]byte, []int) {
- return file_blockchain_proto_rawDescGZIP(), []int{25}
+ return file_blockchain_proto_rawDescGZIP(), []int{23}
}
func (x *ConsensusInfo) GetAddress() string {
@@ -1651,230 +1566,219 @@ var file_blockchain_proto_rawDesc = []byte{
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x07, 0x61,
- 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x16, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c,
- 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x1e,
- 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64,
- 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d,
- 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64,
- 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x2f, 0x0a,
- 0x13, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x35,
- 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x79,
- 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
- 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e,
- 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x4e, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35,
- 0x0a, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03,
- 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x4b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a,
- 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61,
- 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x6f, 0x72, 0x22, 0x5f, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18,
- 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x34, 0x0a,
- 0x09, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
- 0x32, 0x16, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56,
- 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x52, 0x09, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73,
- 0x69, 0x74, 0x79, 0x22, 0x83, 0x02, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67,
- 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
- 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04,
- 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63,
- 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c,
- 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65,
- 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
- 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f,
- 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x34, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x76,
- 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61,
- 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65,
- 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x72, 0x65, 0x76, 0x43, 0x65, 0x72, 0x74, 0x12, 0x29,
- 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61,
- 0x63, 0x74, 0x75, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
- 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x74, 0x78, 0x73, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x65, 0x74,
- 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
+ 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x1e, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x3d, 0x0a, 0x1d, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65,
+ 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72,
+ 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x2f, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07,
+ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61,
+ 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x35, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x79, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x4b, 0x0a,
+ 0x14, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
+ 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52,
+ 0x09, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x5f, 0x0a, 0x0f, 0x47, 0x65,
+ 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a,
+ 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x34, 0x0a, 0x09, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69,
+ 0x74, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79,
+ 0x52, 0x09, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x22, 0x83, 0x02, 0x0a, 0x10,
+ 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
- 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x2a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42,
- 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04,
- 0x68, 0x61, 0x73, 0x68, 0x22, 0x2b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
- 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a,
+ 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04,
+ 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61,
+ 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x12,
+ 0x2f, 0x0a, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65,
+ 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x06, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72,
+ 0x12, 0x34, 0x0a, 0x09, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x63, 0x65, 0x72, 0x74, 0x18, 0x06, 0x20,
+ 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x65, 0x72,
+ 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x72,
+ 0x65, 0x76, 0x43, 0x65, 0x72, 0x74, 0x12, 0x29, 0x0a, 0x03, 0x74, 0x78, 0x73, 0x18, 0x07, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x54, 0x72, 0x61,
+ 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x03, 0x74, 0x78,
+ 0x73, 0x22, 0x2d, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
+ 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x22, 0x2a, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x2b, 0x0a, 0x15,
+ 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, 0x74,
+ 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x47,
+ 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xd5, 0x02, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x42,
+ 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d,
+ 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68,
+ 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f,
+ 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74,
+ 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74,
+ 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28,
+ 0x05, 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73,
+ 0x12, 0x29, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
+ 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61,
+ 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74,
+ 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+ 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f,
+ 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18,
+ 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65,
+ 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x48, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74,
+ 0x65, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x07, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x61, 0x6c,
+ 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d,
+ 0x69, 0x74, 0x74, 0x65, 0x65, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22,
+ 0x19, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49,
+ 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x18, 0x47, 0x65,
+ 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
+ 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74,
+ 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f,
+ 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x22, 0xc9, 0x02, 0x0a, 0x0d,
+ 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a,
0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73,
- 0x68, 0x22, 0x30, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69,
- 0x67, 0x68, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68,
- 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69,
- 0x67, 0x68, 0x74, 0x22, 0x1a, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63,
- 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
- 0xd5, 0x02, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69,
- 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a,
- 0x11, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67,
- 0x68, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c,
- 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73,
- 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x0c, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
- 0x68, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75,
- 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c,
- 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x74, 0x6f, 0x74, 0x61,
- 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x04, 0x20, 0x01,
- 0x28, 0x05, 0x52, 0x0f, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x6f, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x77,
- 0x65, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50,
- 0x6f, 0x77, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65,
- 0x65, 0x5f, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x63,
- 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x48, 0x0a,
- 0x14, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x6f, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61,
- 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e,
- 0x66, 0x6f, 0x52, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x65, 0x56, 0x61, 0x6c,
- 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x43, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x22, 0x4f, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73,
- 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33,
- 0x0a, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x6f, 0x6e, 0x73, 0x65,
- 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x73, 0x22, 0xc3, 0x02, 0x0a, 0x0d, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f,
- 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74,
- 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a,
- 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06,
- 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75,
- 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65,
- 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
- 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x2e, 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62,
- 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20,
- 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67,
- 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2c, 0x0a, 0x12, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6a,
- 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01,
- 0x28, 0x0d, 0x52, 0x10, 0x6c, 0x61, 0x73, 0x74, 0x4a, 0x6f, 0x69, 0x6e, 0x65, 0x64, 0x48, 0x65,
- 0x69, 0x67, 0x68, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e,
- 0x67, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f,
- 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12,
- 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x41, 0x63,
- 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73,
- 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a,
- 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74,
- 0x61, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71,
- 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71,
- 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
- 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22,
- 0xc4, 0x01, 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49,
- 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a,
- 0x0f, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, 0x6c, 0x6f, 0x63,
- 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72,
- 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65,
- 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f,
- 0x6e, 0x5f, 0x73, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x6f,
- 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70,
- 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41,
- 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x0f, 0x43, 0x65, 0x72, 0x74, 0x69,
- 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61,
- 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x14,
- 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72,
- 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65,
- 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74,
- 0x74, 0x65, 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x65,
- 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x65,
- 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18,
- 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
- 0x22, 0x7b, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x04,
- 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x61, 0x63,
- 0x74, 0x75, 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79,
- 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
- 0x09, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63,
- 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c,
- 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64,
- 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x97, 0x01,
- 0x0a, 0x0d, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12,
- 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x63, 0x74,
- 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76,
- 0x65, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
- 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75,
- 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12,
- 0x26, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10,
- 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f,
- 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x2a, 0x48, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
- 0x56, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f,
- 0x43, 0x4b, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f,
- 0x43, 0x4b, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x4c, 0x4f,
- 0x43, 0x4b, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10,
- 0x02, 0x2a, 0x5c, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a,
- 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12,
- 0x10, 0x0a, 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, 0x10,
- 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4d,
- 0x4d, 0x49, 0x54, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x43, 0x48,
- 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x45, 0x52, 0x10, 0x03, 0x32,
- 0x8c, 0x07, 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x3d,
- 0x0a, 0x08, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x63,
- 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74,
- 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a,
- 0x0c, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1b, 0x2e,
- 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48,
- 0x61, 0x73, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x63,
- 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68,
- 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42,
- 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63,
- 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67,
- 0x68, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74,
- 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68,
- 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74,
- 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20,
+ 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52,
+ 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f,
+ 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69,
+ 0x63, 0x4b, 0x65, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08,
+ 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
+ 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x6b,
+ 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x74, 0x61, 0x6b, 0x65, 0x12, 0x2e,
+ 0x0a, 0x13, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x68,
+ 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x11, 0x6c, 0x61, 0x73,
+ 0x74, 0x42, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x32,
+ 0x0a, 0x15, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e,
+ 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x6c,
+ 0x61, 0x73, 0x74, 0x53, 0x6f, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x65, 0x69, 0x67,
+ 0x68, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x75, 0x6e, 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f,
+ 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0f, 0x75, 0x6e,
+ 0x62, 0x6f, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x18, 0x0a,
+ 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x83, 0x01, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f,
+ 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x64,
+ 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12,
+ 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52,
+ 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65,
+ 0x6e, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65,
+ 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x05,
+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xc4, 0x01,
+ 0x0a, 0x0f, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x66,
+ 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x26, 0x0a, 0x0f, 0x70,
+ 0x72, 0x65, 0x76, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x76, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48,
+ 0x61, 0x73, 0x68, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f,
+ 0x6f, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
+ 0x73, 0x65, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x73, 0x6f, 0x72, 0x74,
+ 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x12, 0x29, 0x0a, 0x10, 0x70, 0x72, 0x6f,
+ 0x70, 0x6f, 0x73, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x41, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x22, 0x97, 0x01, 0x0a, 0x0f, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69,
+ 0x63, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05,
+ 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75,
+ 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65, 0x72, 0x73,
+ 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x74, 0x65,
+ 0x72, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x65, 0x73, 0x18,
+ 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, 0x09, 0x61, 0x62, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x65, 0x73,
+ 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x7b,
+ 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x24, 0x0a, 0x04, 0x74, 0x79,
+ 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x10, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
+ 0x12, 0x14, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f,
+ 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04,
+ 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x97, 0x01, 0x0a, 0x0d,
+ 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a,
+ 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+ 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76,
+ 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12,
+ 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52,
+ 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64,
+ 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x26, 0x0a,
+ 0x05, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70,
+ 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x56, 0x6f, 0x74, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05,
+ 0x76, 0x6f, 0x74, 0x65, 0x73, 0x2a, 0x48, 0x0a, 0x0e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x56, 0x65,
+ 0x72, 0x62, 0x6f, 0x73, 0x69, 0x74, 0x79, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f, 0x43, 0x4b,
+ 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x4c, 0x4f, 0x43, 0x4b,
+ 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x42, 0x4c, 0x4f, 0x43, 0x4b,
+ 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x10, 0x02, 0x2a,
+ 0x5c, 0x0a, 0x08, 0x56, 0x6f, 0x74, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x56,
+ 0x4f, 0x54, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x10, 0x0a,
+ 0x0c, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12,
+ 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x50, 0x52, 0x45, 0x43, 0x4f, 0x4d, 0x4d, 0x49,
+ 0x54, 0x10, 0x02, 0x12, 0x18, 0x0a, 0x14, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x43, 0x48, 0x41, 0x4e,
+ 0x47, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x45, 0x52, 0x10, 0x03, 0x32, 0xbe, 0x06,
+ 0x0a, 0x0a, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x12, 0x3d, 0x0a, 0x08,
+ 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47,
+ 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x1b, 0x2e, 0x70, 0x61,
+ 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
+ 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f,
+ 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
+ 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x6c,
+ 0x6f, 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x2e, 0x70,
+ 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68,
+ 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21,
0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b,
- 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x21, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6c, 0x6f,
- 0x63, 0x6b, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e,
- 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
- 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66,
- 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
- 0x73, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e,
- 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65,
- 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
- 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74,
- 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x53, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e,
- 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47,
- 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6d, 0x62, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
- 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70,
- 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64,
- 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65,
- 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x59, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42,
- 0x79, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
- 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x79, 0x4e,
- 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70,
- 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
- 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65,
- 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
- 0x73, 0x65, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74,
- 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
- 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x61, 0x63, 0x74,
- 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41,
- 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
- 0x12, 0x4c, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
- 0x73, 0x12, 0x1c, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61,
- 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69,
- 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x45,
+ 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x12, 0x55, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75,
+ 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1f, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47,
+ 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e,
+ 0x47, 0x65, 0x74, 0x43, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x49, 0x6e, 0x66, 0x6f,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x41,
+ 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e,
+ 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x63,
+ 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a,
+ 0x12, 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x12, 0x21, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74,
+ 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x79, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e,
+ 0x47, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x12, 0x49, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
+ 0x6f, 0x72, 0x12, 0x1b, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
+ 0x1c, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69,
+ 0x64, 0x61, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a,
+ 0x14, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x79, 0x4e,
+ 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47,
+ 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x42, 0x79, 0x4e, 0x75, 0x6d,
+ 0x62, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x61, 0x63,
+ 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x64, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x56,
+ 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65,
+ 0x73, 0x12, 0x24, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61,
+ 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73,
+ 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
+ 0x2e, 0x47, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64,
+ 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x45,
0x0a, 0x11, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x63, 0x68,
0x61, 0x69, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70,
@@ -1895,77 +1799,72 @@ func file_blockchain_proto_rawDescGZIP() []byte {
}
var file_blockchain_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_blockchain_proto_msgTypes = make([]protoimpl.MessageInfo, 26)
+var file_blockchain_proto_msgTypes = make([]protoimpl.MessageInfo, 24)
var file_blockchain_proto_goTypes = []interface{}{
(BlockVerbosity)(0), // 0: pactus.BlockVerbosity
(VoteType)(0), // 1: pactus.VoteType
(*GetAccountRequest)(nil), // 2: pactus.GetAccountRequest
(*GetAccountByNumberRequest)(nil), // 3: pactus.GetAccountByNumberRequest
(*GetAccountResponse)(nil), // 4: pactus.GetAccountResponse
- (*GetValidatorsRequest)(nil), // 5: pactus.GetValidatorsRequest
- (*GetValidatorAddressesRequest)(nil), // 6: pactus.GetValidatorAddressesRequest
- (*GetValidatorAddressesResponse)(nil), // 7: pactus.GetValidatorAddressesResponse
- (*GetValidatorRequest)(nil), // 8: pactus.GetValidatorRequest
- (*GetValidatorByNumberRequest)(nil), // 9: pactus.GetValidatorByNumberRequest
- (*GetValidatorsResponse)(nil), // 10: pactus.GetValidatorsResponse
- (*GetValidatorResponse)(nil), // 11: pactus.GetValidatorResponse
- (*GetBlockRequest)(nil), // 12: pactus.GetBlockRequest
- (*GetBlockResponse)(nil), // 13: pactus.GetBlockResponse
- (*GetBlockHashRequest)(nil), // 14: pactus.GetBlockHashRequest
- (*GetBlockHashResponse)(nil), // 15: pactus.GetBlockHashResponse
- (*GetBlockHeightRequest)(nil), // 16: pactus.GetBlockHeightRequest
- (*GetBlockHeightResponse)(nil), // 17: pactus.GetBlockHeightResponse
- (*GetBlockchainInfoRequest)(nil), // 18: pactus.GetBlockchainInfoRequest
- (*GetBlockchainInfoResponse)(nil), // 19: pactus.GetBlockchainInfoResponse
- (*GetConsensusInfoRequest)(nil), // 20: pactus.GetConsensusInfoRequest
- (*GetConsensusInfoResponse)(nil), // 21: pactus.GetConsensusInfoResponse
- (*ValidatorInfo)(nil), // 22: pactus.ValidatorInfo
- (*AccountInfo)(nil), // 23: pactus.AccountInfo
- (*BlockHeaderInfo)(nil), // 24: pactus.BlockHeaderInfo
- (*CertificateInfo)(nil), // 25: pactus.CertificateInfo
- (*VoteInfo)(nil), // 26: pactus.VoteInfo
- (*ConsensusInfo)(nil), // 27: pactus.ConsensusInfo
- (*TransactionInfo)(nil), // 28: pactus.TransactionInfo
+ (*GetValidatorAddressesRequest)(nil), // 5: pactus.GetValidatorAddressesRequest
+ (*GetValidatorAddressesResponse)(nil), // 6: pactus.GetValidatorAddressesResponse
+ (*GetValidatorRequest)(nil), // 7: pactus.GetValidatorRequest
+ (*GetValidatorByNumberRequest)(nil), // 8: pactus.GetValidatorByNumberRequest
+ (*GetValidatorResponse)(nil), // 9: pactus.GetValidatorResponse
+ (*GetBlockRequest)(nil), // 10: pactus.GetBlockRequest
+ (*GetBlockResponse)(nil), // 11: pactus.GetBlockResponse
+ (*GetBlockHashRequest)(nil), // 12: pactus.GetBlockHashRequest
+ (*GetBlockHashResponse)(nil), // 13: pactus.GetBlockHashResponse
+ (*GetBlockHeightRequest)(nil), // 14: pactus.GetBlockHeightRequest
+ (*GetBlockHeightResponse)(nil), // 15: pactus.GetBlockHeightResponse
+ (*GetBlockchainInfoRequest)(nil), // 16: pactus.GetBlockchainInfoRequest
+ (*GetBlockchainInfoResponse)(nil), // 17: pactus.GetBlockchainInfoResponse
+ (*GetConsensusInfoRequest)(nil), // 18: pactus.GetConsensusInfoRequest
+ (*GetConsensusInfoResponse)(nil), // 19: pactus.GetConsensusInfoResponse
+ (*ValidatorInfo)(nil), // 20: pactus.ValidatorInfo
+ (*AccountInfo)(nil), // 21: pactus.AccountInfo
+ (*BlockHeaderInfo)(nil), // 22: pactus.BlockHeaderInfo
+ (*CertificateInfo)(nil), // 23: pactus.CertificateInfo
+ (*VoteInfo)(nil), // 24: pactus.VoteInfo
+ (*ConsensusInfo)(nil), // 25: pactus.ConsensusInfo
+ (*TransactionInfo)(nil), // 26: pactus.TransactionInfo
}
var file_blockchain_proto_depIdxs = []int32{
- 23, // 0: pactus.GetAccountResponse.account:type_name -> pactus.AccountInfo
- 22, // 1: pactus.GetValidatorsResponse.validators:type_name -> pactus.ValidatorInfo
- 22, // 2: pactus.GetValidatorResponse.validator:type_name -> pactus.ValidatorInfo
- 0, // 3: pactus.GetBlockRequest.verbosity:type_name -> pactus.BlockVerbosity
- 24, // 4: pactus.GetBlockResponse.header:type_name -> pactus.BlockHeaderInfo
- 25, // 5: pactus.GetBlockResponse.prev_cert:type_name -> pactus.CertificateInfo
- 28, // 6: pactus.GetBlockResponse.txs:type_name -> pactus.TransactionInfo
- 22, // 7: pactus.GetBlockchainInfoResponse.committee_validators:type_name -> pactus.ValidatorInfo
- 27, // 8: pactus.GetConsensusInfoResponse.instances:type_name -> pactus.ConsensusInfo
- 1, // 9: pactus.VoteInfo.type:type_name -> pactus.VoteType
- 26, // 10: pactus.ConsensusInfo.votes:type_name -> pactus.VoteInfo
- 12, // 11: pactus.Blockchain.GetBlock:input_type -> pactus.GetBlockRequest
- 14, // 12: pactus.Blockchain.GetBlockHash:input_type -> pactus.GetBlockHashRequest
- 16, // 13: pactus.Blockchain.GetBlockHeight:input_type -> pactus.GetBlockHeightRequest
- 18, // 14: pactus.Blockchain.GetBlockchainInfo:input_type -> pactus.GetBlockchainInfoRequest
- 20, // 15: pactus.Blockchain.GetConsensusInfo:input_type -> pactus.GetConsensusInfoRequest
- 2, // 16: pactus.Blockchain.GetAccount:input_type -> pactus.GetAccountRequest
- 3, // 17: pactus.Blockchain.GetAccountByNumber:input_type -> pactus.GetAccountByNumberRequest
- 8, // 18: pactus.Blockchain.GetValidator:input_type -> pactus.GetValidatorRequest
- 9, // 19: pactus.Blockchain.GetValidatorByNumber:input_type -> pactus.GetValidatorByNumberRequest
- 6, // 20: pactus.Blockchain.GetValidatorAddresses:input_type -> pactus.GetValidatorAddressesRequest
- 5, // 21: pactus.Blockchain.GetValidators:input_type -> pactus.GetValidatorsRequest
- 13, // 22: pactus.Blockchain.GetBlock:output_type -> pactus.GetBlockResponse
- 15, // 23: pactus.Blockchain.GetBlockHash:output_type -> pactus.GetBlockHashResponse
- 17, // 24: pactus.Blockchain.GetBlockHeight:output_type -> pactus.GetBlockHeightResponse
- 19, // 25: pactus.Blockchain.GetBlockchainInfo:output_type -> pactus.GetBlockchainInfoResponse
- 21, // 26: pactus.Blockchain.GetConsensusInfo:output_type -> pactus.GetConsensusInfoResponse
- 4, // 27: pactus.Blockchain.GetAccount:output_type -> pactus.GetAccountResponse
- 4, // 28: pactus.Blockchain.GetAccountByNumber:output_type -> pactus.GetAccountResponse
- 11, // 29: pactus.Blockchain.GetValidator:output_type -> pactus.GetValidatorResponse
- 11, // 30: pactus.Blockchain.GetValidatorByNumber:output_type -> pactus.GetValidatorResponse
- 7, // 31: pactus.Blockchain.GetValidatorAddresses:output_type -> pactus.GetValidatorAddressesResponse
- 10, // 32: pactus.Blockchain.GetValidators:output_type -> pactus.GetValidatorsResponse
- 22, // [22:33] is the sub-list for method output_type
- 11, // [11:22] is the sub-list for method input_type
- 11, // [11:11] is the sub-list for extension type_name
- 11, // [11:11] is the sub-list for extension extendee
- 0, // [0:11] is the sub-list for field type_name
+ 21, // 0: pactus.GetAccountResponse.account:type_name -> pactus.AccountInfo
+ 20, // 1: pactus.GetValidatorResponse.validator:type_name -> pactus.ValidatorInfo
+ 0, // 2: pactus.GetBlockRequest.verbosity:type_name -> pactus.BlockVerbosity
+ 22, // 3: pactus.GetBlockResponse.header:type_name -> pactus.BlockHeaderInfo
+ 23, // 4: pactus.GetBlockResponse.prev_cert:type_name -> pactus.CertificateInfo
+ 26, // 5: pactus.GetBlockResponse.txs:type_name -> pactus.TransactionInfo
+ 20, // 6: pactus.GetBlockchainInfoResponse.committee_validators:type_name -> pactus.ValidatorInfo
+ 25, // 7: pactus.GetConsensusInfoResponse.instances:type_name -> pactus.ConsensusInfo
+ 1, // 8: pactus.VoteInfo.type:type_name -> pactus.VoteType
+ 24, // 9: pactus.ConsensusInfo.votes:type_name -> pactus.VoteInfo
+ 10, // 10: pactus.Blockchain.GetBlock:input_type -> pactus.GetBlockRequest
+ 12, // 11: pactus.Blockchain.GetBlockHash:input_type -> pactus.GetBlockHashRequest
+ 14, // 12: pactus.Blockchain.GetBlockHeight:input_type -> pactus.GetBlockHeightRequest
+ 16, // 13: pactus.Blockchain.GetBlockchainInfo:input_type -> pactus.GetBlockchainInfoRequest
+ 18, // 14: pactus.Blockchain.GetConsensusInfo:input_type -> pactus.GetConsensusInfoRequest
+ 2, // 15: pactus.Blockchain.GetAccount:input_type -> pactus.GetAccountRequest
+ 3, // 16: pactus.Blockchain.GetAccountByNumber:input_type -> pactus.GetAccountByNumberRequest
+ 7, // 17: pactus.Blockchain.GetValidator:input_type -> pactus.GetValidatorRequest
+ 8, // 18: pactus.Blockchain.GetValidatorByNumber:input_type -> pactus.GetValidatorByNumberRequest
+ 5, // 19: pactus.Blockchain.GetValidatorAddresses:input_type -> pactus.GetValidatorAddressesRequest
+ 11, // 20: pactus.Blockchain.GetBlock:output_type -> pactus.GetBlockResponse
+ 13, // 21: pactus.Blockchain.GetBlockHash:output_type -> pactus.GetBlockHashResponse
+ 15, // 22: pactus.Blockchain.GetBlockHeight:output_type -> pactus.GetBlockHeightResponse
+ 17, // 23: pactus.Blockchain.GetBlockchainInfo:output_type -> pactus.GetBlockchainInfoResponse
+ 19, // 24: pactus.Blockchain.GetConsensusInfo:output_type -> pactus.GetConsensusInfoResponse
+ 4, // 25: pactus.Blockchain.GetAccount:output_type -> pactus.GetAccountResponse
+ 4, // 26: pactus.Blockchain.GetAccountByNumber:output_type -> pactus.GetAccountResponse
+ 9, // 27: pactus.Blockchain.GetValidator:output_type -> pactus.GetValidatorResponse
+ 9, // 28: pactus.Blockchain.GetValidatorByNumber:output_type -> pactus.GetValidatorResponse
+ 6, // 29: pactus.Blockchain.GetValidatorAddresses:output_type -> pactus.GetValidatorAddressesResponse
+ 20, // [20:30] is the sub-list for method output_type
+ 10, // [10:20] is the sub-list for method input_type
+ 10, // [10:10] is the sub-list for extension type_name
+ 10, // [10:10] is the sub-list for extension extendee
+ 0, // [0:10] is the sub-list for field type_name
}
func init() { file_blockchain_proto_init() }
@@ -2012,18 +1911,6 @@ func file_blockchain_proto_init() {
}
}
file_blockchain_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetValidatorsRequest); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_blockchain_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetValidatorAddressesRequest); i {
case 0:
return &v.state
@@ -2035,7 +1922,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetValidatorAddressesResponse); i {
case 0:
return &v.state
@@ -2047,7 +1934,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetValidatorRequest); i {
case 0:
return &v.state
@@ -2059,7 +1946,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetValidatorByNumberRequest); i {
case 0:
return &v.state
@@ -2071,19 +1958,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*GetValidatorsResponse); i {
- case 0:
- return &v.state
- case 1:
- return &v.sizeCache
- case 2:
- return &v.unknownFields
- default:
- return nil
- }
- }
- file_blockchain_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetValidatorResponse); i {
case 0:
return &v.state
@@ -2095,7 +1970,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockRequest); i {
case 0:
return &v.state
@@ -2107,7 +1982,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockResponse); i {
case 0:
return &v.state
@@ -2119,7 +1994,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockHashRequest); i {
case 0:
return &v.state
@@ -2131,7 +2006,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockHashResponse); i {
case 0:
return &v.state
@@ -2143,7 +2018,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockHeightRequest); i {
case 0:
return &v.state
@@ -2155,7 +2030,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockHeightResponse); i {
case 0:
return &v.state
@@ -2167,7 +2042,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockchainInfoRequest); i {
case 0:
return &v.state
@@ -2179,7 +2054,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetBlockchainInfoResponse); i {
case 0:
return &v.state
@@ -2191,7 +2066,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetConsensusInfoRequest); i {
case 0:
return &v.state
@@ -2203,7 +2078,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetConsensusInfoResponse); i {
case 0:
return &v.state
@@ -2215,7 +2090,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ValidatorInfo); i {
case 0:
return &v.state
@@ -2227,7 +2102,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AccountInfo); i {
case 0:
return &v.state
@@ -2239,7 +2114,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BlockHeaderInfo); i {
case 0:
return &v.state
@@ -2251,7 +2126,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CertificateInfo); i {
case 0:
return &v.state
@@ -2263,7 +2138,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VoteInfo); i {
case 0:
return &v.state
@@ -2275,7 +2150,7 @@ func file_blockchain_proto_init() {
return nil
}
}
- file_blockchain_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} {
+ file_blockchain_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ConsensusInfo); i {
case 0:
return &v.state
@@ -2294,7 +2169,7 @@ func file_blockchain_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_blockchain_proto_rawDesc,
NumEnums: 2,
- NumMessages: 26,
+ NumMessages: 24,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/www/grpc/gen/go/blockchain.pb.gw.go b/www/grpc/gen/go/blockchain.pb.gw.go
index c957aec36..326b0cea1 100644
--- a/www/grpc/gen/go/blockchain.pb.gw.go
+++ b/www/grpc/gen/go/blockchain.pb.gw.go
@@ -439,24 +439,6 @@ func local_request_Blockchain_GetValidatorByNumber_0(ctx context.Context, marsha
}
-func request_Blockchain_GetValidators_0(ctx context.Context, marshaler runtime.Marshaler, client BlockchainClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq GetValidatorsRequest
- var metadata runtime.ServerMetadata
-
- msg, err := client.GetValidators(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
- return msg, metadata, err
-
-}
-
-func local_request_Blockchain_GetValidators_0(ctx context.Context, marshaler runtime.Marshaler, server BlockchainServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
- var protoReq GetValidatorsRequest
- var metadata runtime.ServerMetadata
-
- msg, err := server.GetValidators(ctx, &protoReq)
- return msg, metadata, err
-
-}
-
// RegisterBlockchainHandlerServer registers the http handlers for service Blockchain to "mux".
// UnaryRPC :call BlockchainServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -663,31 +645,6 @@ func RegisterBlockchainHandlerServer(ctx context.Context, mux *runtime.ServeMux,
})
- mux.Handle("GET", pattern_Blockchain_GetValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
- ctx, cancel := context.WithCancel(req.Context())
- defer cancel()
- var stream runtime.ServerTransportStream
- ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- var err error
- var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pactus.Blockchain/GetValidators", runtime.WithHTTPPathPattern("/v1/blockchain/validators"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := local_request_Blockchain_GetValidators_0(annotatedContext, inboundMarshaler, server, req, pathParams)
- md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
-
- forward_Blockchain_GetValidators_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
return nil
}
@@ -905,28 +862,6 @@ func RegisterBlockchainHandlerClient(ctx context.Context, mux *runtime.ServeMux,
})
- mux.Handle("GET", pattern_Blockchain_GetValidators_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
- ctx, cancel := context.WithCancel(req.Context())
- defer cancel()
- inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
- var err error
- var annotatedContext context.Context
- annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pactus.Blockchain/GetValidators", runtime.WithHTTPPathPattern("/v1/blockchain/validators"))
- if err != nil {
- runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
- return
- }
- resp, md, err := request_Blockchain_GetValidators_0(annotatedContext, inboundMarshaler, client, req, pathParams)
- annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
- if err != nil {
- runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
- return
- }
-
- forward_Blockchain_GetValidators_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
-
- })
-
return nil
}
@@ -946,8 +881,6 @@ var (
pattern_Blockchain_GetValidator_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"v1", "blockchain", "validator", "address"}, ""))
pattern_Blockchain_GetValidatorByNumber_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "blockchain", "validator", "number"}, ""))
-
- pattern_Blockchain_GetValidators_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "blockchain", "validators"}, ""))
)
var (
@@ -966,6 +899,4 @@ var (
forward_Blockchain_GetValidator_0 = runtime.ForwardResponseMessage
forward_Blockchain_GetValidatorByNumber_0 = runtime.ForwardResponseMessage
-
- forward_Blockchain_GetValidators_0 = runtime.ForwardResponseMessage
)
diff --git a/www/grpc/gen/go/blockchain_grpc.pb.go b/www/grpc/gen/go/blockchain_grpc.pb.go
index f85a66e32..df0d601cc 100644
--- a/www/grpc/gen/go/blockchain_grpc.pb.go
+++ b/www/grpc/gen/go/blockchain_grpc.pb.go
@@ -1,8 +1,4 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc (unknown)
-// source: blockchain.proto
package pactus
@@ -32,7 +28,6 @@ type BlockchainClient interface {
GetValidator(ctx context.Context, in *GetValidatorRequest, opts ...grpc.CallOption) (*GetValidatorResponse, error)
GetValidatorByNumber(ctx context.Context, in *GetValidatorByNumberRequest, opts ...grpc.CallOption) (*GetValidatorResponse, error)
GetValidatorAddresses(ctx context.Context, in *GetValidatorAddressesRequest, opts ...grpc.CallOption) (*GetValidatorAddressesResponse, error)
- GetValidators(ctx context.Context, in *GetValidatorsRequest, opts ...grpc.CallOption) (*GetValidatorsResponse, error)
}
type blockchainClient struct {
@@ -133,15 +128,6 @@ func (c *blockchainClient) GetValidatorAddresses(ctx context.Context, in *GetVal
return out, nil
}
-func (c *blockchainClient) GetValidators(ctx context.Context, in *GetValidatorsRequest, opts ...grpc.CallOption) (*GetValidatorsResponse, error) {
- out := new(GetValidatorsResponse)
- err := c.cc.Invoke(ctx, "/pactus.Blockchain/GetValidators", in, out, opts...)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
// BlockchainServer is the server API for Blockchain service.
// All implementations should embed UnimplementedBlockchainServer
// for forward compatibility
@@ -156,7 +142,6 @@ type BlockchainServer interface {
GetValidator(context.Context, *GetValidatorRequest) (*GetValidatorResponse, error)
GetValidatorByNumber(context.Context, *GetValidatorByNumberRequest) (*GetValidatorResponse, error)
GetValidatorAddresses(context.Context, *GetValidatorAddressesRequest) (*GetValidatorAddressesResponse, error)
- GetValidators(context.Context, *GetValidatorsRequest) (*GetValidatorsResponse, error)
}
// UnimplementedBlockchainServer should be embedded to have forward compatible implementations.
@@ -193,9 +178,6 @@ func (UnimplementedBlockchainServer) GetValidatorByNumber(context.Context, *GetV
func (UnimplementedBlockchainServer) GetValidatorAddresses(context.Context, *GetValidatorAddressesRequest) (*GetValidatorAddressesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetValidatorAddresses not implemented")
}
-func (UnimplementedBlockchainServer) GetValidators(context.Context, *GetValidatorsRequest) (*GetValidatorsResponse, error) {
- return nil, status.Errorf(codes.Unimplemented, "method GetValidators not implemented")
-}
// UnsafeBlockchainServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BlockchainServer will
@@ -388,24 +370,6 @@ func _Blockchain_GetValidatorAddresses_Handler(srv interface{}, ctx context.Cont
return interceptor(ctx, in, info, handler)
}
-func _Blockchain_GetValidators_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
- in := new(GetValidatorsRequest)
- if err := dec(in); err != nil {
- return nil, err
- }
- if interceptor == nil {
- return srv.(BlockchainServer).GetValidators(ctx, in)
- }
- info := &grpc.UnaryServerInfo{
- Server: srv,
- FullMethod: "/pactus.Blockchain/GetValidators",
- }
- handler := func(ctx context.Context, req interface{}) (interface{}, error) {
- return srv.(BlockchainServer).GetValidators(ctx, req.(*GetValidatorsRequest))
- }
- return interceptor(ctx, in, info, handler)
-}
-
// Blockchain_ServiceDesc is the grpc.ServiceDesc for Blockchain service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -453,10 +417,6 @@ var Blockchain_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetValidatorAddresses",
Handler: _Blockchain_GetValidatorAddresses_Handler,
},
- {
- MethodName: "GetValidators",
- Handler: _Blockchain_GetValidators_Handler,
- },
},
Streams: []grpc.StreamDesc{},
Metadata: "blockchain.proto",
diff --git a/www/grpc/gen/go/network.pb.go b/www/grpc/gen/go/network.pb.go
index 277eeb17e..fa28979c4 100644
--- a/www/grpc/gen/go/network.pb.go
+++ b/www/grpc/gen/go/network.pb.go
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.28.1
+// protoc-gen-go v1.26.0
// protoc (unknown)
// source: network.proto
@@ -63,10 +63,12 @@ type GetNetworkInfoResponse struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- TotalSentBytes int32 `protobuf:"varint,1,opt,name=total_sent_bytes,json=totalSentBytes,proto3" json:"total_sent_bytes,omitempty"`
- TotalReceivedBytes int32 `protobuf:"varint,2,opt,name=total_received_bytes,json=totalReceivedBytes,proto3" json:"total_received_bytes,omitempty"`
- StartedAt int64 `protobuf:"varint,3,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
- Peers []*PeerInfo `protobuf:"bytes,4,rep,name=peers,proto3" json:"peers,omitempty"`
+ TotalSentBytes int32 `protobuf:"varint,1,opt,name=total_sent_bytes,json=totalSentBytes,proto3" json:"total_sent_bytes,omitempty"`
+ TotalReceivedBytes int32 `protobuf:"varint,2,opt,name=total_received_bytes,json=totalReceivedBytes,proto3" json:"total_received_bytes,omitempty"`
+ StartedAt int64 `protobuf:"varint,3,opt,name=started_at,json=startedAt,proto3" json:"started_at,omitempty"`
+ Peers []*PeerInfo `protobuf:"bytes,4,rep,name=peers,proto3" json:"peers,omitempty"`
+ SentBytes map[int32]int64 `protobuf:"bytes,5,rep,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+ ReceivedBytes map[int32]int64 `protobuf:"bytes,6,rep,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *GetNetworkInfoResponse) Reset() {
@@ -129,6 +131,20 @@ func (x *GetNetworkInfoResponse) GetPeers() []*PeerInfo {
return nil
}
+func (x *GetNetworkInfoResponse) GetSentBytes() map[int32]int64 {
+ if x != nil {
+ return x.SentBytes
+ }
+ return nil
+}
+
+func (x *GetNetworkInfoResponse) GetReceivedBytes() map[int32]int64 {
+ if x != nil {
+ return x.ReceivedBytes
+ }
+ return nil
+}
+
type GetNodeInfoRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -235,20 +251,22 @@ type PeerInfo struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
- Agent string `protobuf:"bytes,2,opt,name=agent,proto3" json:"agent,omitempty"`
- PeerId []byte `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
- ConsensusKeys []string `protobuf:"bytes,4,rep,name=consensus_keys,json=consensusKeys,proto3" json:"consensus_keys,omitempty"`
- Flags int32 `protobuf:"varint,5,opt,name=flags,proto3" json:"flags,omitempty"`
- Height uint32 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"`
- ReceivedMessages int32 `protobuf:"varint,7,opt,name=received_messages,json=receivedMessages,proto3" json:"received_messages,omitempty"`
- InvalidMessages int32 `protobuf:"varint,8,opt,name=invalid_messages,json=invalidMessages,proto3" json:"invalid_messages,omitempty"`
- ReceivedBytes int32 `protobuf:"varint,9,opt,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty"`
- Status int32 `protobuf:"varint,10,opt,name=status,proto3" json:"status,omitempty"`
- LastSent int64 `protobuf:"varint,11,opt,name=last_sent,json=lastSent,proto3" json:"last_sent,omitempty"`
- LastReceived int64 `protobuf:"varint,12,opt,name=last_received,json=lastReceived,proto3" json:"last_received,omitempty"`
- SendSuccess int32 `protobuf:"varint,13,opt,name=send_success,json=sendSuccess,proto3" json:"send_success,omitempty"`
- SendFailed int32 `protobuf:"varint,14,opt,name=send_failed,json=sendFailed,proto3" json:"send_failed,omitempty"`
+ Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"`
+ Agent string `protobuf:"bytes,2,opt,name=agent,proto3" json:"agent,omitempty"`
+ PeerId []byte `protobuf:"bytes,3,opt,name=peer_id,json=peerId,proto3" json:"peer_id,omitempty"`
+ ConsensusKeys []string `protobuf:"bytes,4,rep,name=consensus_keys,json=consensusKeys,proto3" json:"consensus_keys,omitempty"`
+ Flags int32 `protobuf:"varint,5,opt,name=flags,proto3" json:"flags,omitempty"`
+ Height uint32 `protobuf:"varint,6,opt,name=height,proto3" json:"height,omitempty"`
+ ReceivedMessages int32 `protobuf:"varint,7,opt,name=received_messages,json=receivedMessages,proto3" json:"received_messages,omitempty"`
+ InvalidMessages int32 `protobuf:"varint,8,opt,name=invalid_messages,json=invalidMessages,proto3" json:"invalid_messages,omitempty"`
+ SentBytes map[int32]int64 `protobuf:"bytes,9,rep,name=sent_bytes,json=sentBytes,proto3" json:"sent_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+ ReceivedBytes map[int32]int64 `protobuf:"bytes,10,rep,name=received_bytes,json=receivedBytes,proto3" json:"received_bytes,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
+ Status int32 `protobuf:"varint,11,opt,name=status,proto3" json:"status,omitempty"`
+ LastSent int64 `protobuf:"varint,12,opt,name=last_sent,json=lastSent,proto3" json:"last_sent,omitempty"`
+ LastReceived int64 `protobuf:"varint,13,opt,name=last_received,json=lastReceived,proto3" json:"last_received,omitempty"`
+ SendSuccess int32 `protobuf:"varint,14,opt,name=send_success,json=sendSuccess,proto3" json:"send_success,omitempty"`
+ SendFailed int32 `protobuf:"varint,15,opt,name=send_failed,json=sendFailed,proto3" json:"send_failed,omitempty"`
+ LastBlockHash []byte `protobuf:"bytes,16,opt,name=last_block_hash,json=lastBlockHash,proto3" json:"last_block_hash,omitempty"`
}
func (x *PeerInfo) Reset() {
@@ -339,11 +357,18 @@ func (x *PeerInfo) GetInvalidMessages() int32 {
return 0
}
-func (x *PeerInfo) GetReceivedBytes() int32 {
+func (x *PeerInfo) GetSentBytes() map[int32]int64 {
+ if x != nil {
+ return x.SentBytes
+ }
+ return nil
+}
+
+func (x *PeerInfo) GetReceivedBytes() map[int32]int64 {
if x != nil {
return x.ReceivedBytes
}
- return 0
+ return nil
}
func (x *PeerInfo) GetStatus() int32 {
@@ -381,13 +406,20 @@ func (x *PeerInfo) GetSendFailed() int32 {
return 0
}
+func (x *PeerInfo) GetLastBlockHash() []byte {
+ if x != nil {
+ return x.LastBlockHash
+ }
+ return nil
+}
+
var File_network_proto protoreflect.FileDescriptor
var file_network_proto_rawDesc = []byte{
0x0a, 0x0d, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x06, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x22, 0x17, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x4e, 0x65,
0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x22, 0xbb, 0x01, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49,
+ 0x22, 0xe3, 0x03, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x10, 0x74,
0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x65, 0x6e, 0x74,
@@ -398,58 +430,94 @@ var file_network_proto_rawDesc = []byte{
0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x74, 0x61,
0x72, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x26, 0x0a, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x18,
0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50,
- 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x22, 0x14,
- 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49,
- 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d,
- 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f,
- 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70,
- 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65,
- 0x65, 0x72, 0x49, 0x64, 0x22, 0xc5, 0x03, 0x0a, 0x08, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66,
- 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61,
- 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e,
- 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f,
- 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03,
- 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4b, 0x65, 0x79,
- 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05,
- 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68,
- 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12,
- 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73,
- 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10, 0x72, 0x65, 0x63, 0x65,
- 0x69, 0x76, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10,
- 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73,
- 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d,
- 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69,
- 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52,
- 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16,
- 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
- 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73,
- 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53,
- 0x65, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65,
- 0x69, 0x76, 0x65, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74,
- 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64,
- 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b,
- 0x73, 0x65, 0x6e, 0x64, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73,
- 0x65, 0x6e, 0x64, 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05,
- 0x52, 0x0a, 0x73, 0x65, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x32, 0xa2, 0x01, 0x0a,
- 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x4f, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4e,
- 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63,
- 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e,
- 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74,
- 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66,
- 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x47, 0x65, 0x74,
- 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
- 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65,
- 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
- 0x65, 0x42, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x6e, 0x65, 0x74, 0x77,
- 0x6f, 0x72, 0x6b, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
- 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70,
- 0x61, 0x63, 0x74, 0x75, 0x73, 0x2f, 0x77, 0x77, 0x77, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70,
- 0x61, 0x63, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x70, 0x65, 0x65, 0x72, 0x73, 0x12, 0x4c,
+ 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03,
+ 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e,
+ 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
+ 0x73, 0x65, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72,
+ 0x79, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x0e,
+ 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x06,
+ 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65,
+ 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
+ 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74,
+ 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
+ 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79,
+ 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
+ 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
+ 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64,
+ 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65,
+ 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c,
+ 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x14, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64,
+ 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x5e, 0x0a, 0x13,
+ 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69, 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a,
+ 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x67,
+ 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72, 0x49, 0x64, 0x22, 0xd2, 0x05, 0x0a,
+ 0x08, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x6f, 0x6e,
+ 0x69, 0x6b, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x6f, 0x6e, 0x69,
+ 0x6b, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x70, 0x65, 0x65,
+ 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x70, 0x65, 0x65, 0x72,
+ 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x5f,
+ 0x6b, 0x65, 0x79, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x73,
+ 0x65, 0x6e, 0x73, 0x75, 0x73, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61,
+ 0x67, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12,
+ 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, 0x52,
+ 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x2b, 0x0a, 0x11, 0x72, 0x65, 0x63, 0x65, 0x69,
+ 0x76, 0x65, 0x64, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x10, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73,
+ 0x61, 0x67, 0x65, 0x73, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f,
+ 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0f,
+ 0x69, 0x6e, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12,
+ 0x3e, 0x0a, 0x0a, 0x73, 0x65, 0x6e, 0x74, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20,
+ 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x65, 0x65,
+ 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45,
+ 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12,
+ 0x4a, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x74, 0x65,
+ 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
+ 0x2e, 0x50, 0x65, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76,
+ 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x72, 0x65,
+ 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x73,
+ 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61,
+ 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x73, 0x65, 0x6e, 0x74,
+ 0x18, 0x0c, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x53, 0x65, 0x6e, 0x74,
+ 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65,
+ 0x64, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x52, 0x65, 0x63,
+ 0x65, 0x69, 0x76, 0x65, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x73, 0x75,
+ 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x73, 0x65, 0x6e,
+ 0x64, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x6e, 0x64,
+ 0x5f, 0x66, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73,
+ 0x65, 0x6e, 0x64, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x6c, 0x61, 0x73,
+ 0x74, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x10, 0x20, 0x01,
+ 0x28, 0x0c, 0x52, 0x0d, 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73,
+ 0x68, 0x1a, 0x3c, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x45, 0x6e,
+ 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
+ 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a,
+ 0x40, 0x0a, 0x12, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x42, 0x79, 0x74, 0x65, 0x73,
+ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38,
+ 0x01, 0x32, 0xa2, 0x01, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x4f, 0x0a,
+ 0x0e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12,
+ 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77,
+ 0x6f, 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e,
+ 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x65, 0x74, 0x77, 0x6f,
+ 0x72, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46,
+ 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x2e,
+ 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e,
+ 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x61, 0x63, 0x74,
+ 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x42, 0x0a, 0x0e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
+ 0x2e, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
+ 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x6a,
+ 0x65, 0x63, 0x74, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2f, 0x77, 0x77, 0x77, 0x2f, 0x67,
+ 0x72, 0x70, 0x63, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x33,
}
var (
@@ -464,25 +532,33 @@ func file_network_proto_rawDescGZIP() []byte {
return file_network_proto_rawDescData
}
-var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
+var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
var file_network_proto_goTypes = []interface{}{
(*GetNetworkInfoRequest)(nil), // 0: pactus.GetNetworkInfoRequest
(*GetNetworkInfoResponse)(nil), // 1: pactus.GetNetworkInfoResponse
(*GetNodeInfoRequest)(nil), // 2: pactus.GetNodeInfoRequest
(*GetNodeInfoResponse)(nil), // 3: pactus.GetNodeInfoResponse
(*PeerInfo)(nil), // 4: pactus.PeerInfo
+ nil, // 5: pactus.GetNetworkInfoResponse.SentBytesEntry
+ nil, // 6: pactus.GetNetworkInfoResponse.ReceivedBytesEntry
+ nil, // 7: pactus.PeerInfo.SentBytesEntry
+ nil, // 8: pactus.PeerInfo.ReceivedBytesEntry
}
var file_network_proto_depIdxs = []int32{
4, // 0: pactus.GetNetworkInfoResponse.peers:type_name -> pactus.PeerInfo
- 0, // 1: pactus.Network.GetNetworkInfo:input_type -> pactus.GetNetworkInfoRequest
- 2, // 2: pactus.Network.GetNodeInfo:input_type -> pactus.GetNodeInfoRequest
- 1, // 3: pactus.Network.GetNetworkInfo:output_type -> pactus.GetNetworkInfoResponse
- 3, // 4: pactus.Network.GetNodeInfo:output_type -> pactus.GetNodeInfoResponse
- 3, // [3:5] is the sub-list for method output_type
- 1, // [1:3] is the sub-list for method input_type
- 1, // [1:1] is the sub-list for extension type_name
- 1, // [1:1] is the sub-list for extension extendee
- 0, // [0:1] is the sub-list for field type_name
+ 5, // 1: pactus.GetNetworkInfoResponse.sent_bytes:type_name -> pactus.GetNetworkInfoResponse.SentBytesEntry
+ 6, // 2: pactus.GetNetworkInfoResponse.received_bytes:type_name -> pactus.GetNetworkInfoResponse.ReceivedBytesEntry
+ 7, // 3: pactus.PeerInfo.sent_bytes:type_name -> pactus.PeerInfo.SentBytesEntry
+ 8, // 4: pactus.PeerInfo.received_bytes:type_name -> pactus.PeerInfo.ReceivedBytesEntry
+ 0, // 5: pactus.Network.GetNetworkInfo:input_type -> pactus.GetNetworkInfoRequest
+ 2, // 6: pactus.Network.GetNodeInfo:input_type -> pactus.GetNodeInfoRequest
+ 1, // 7: pactus.Network.GetNetworkInfo:output_type -> pactus.GetNetworkInfoResponse
+ 3, // 8: pactus.Network.GetNodeInfo:output_type -> pactus.GetNodeInfoResponse
+ 7, // [7:9] is the sub-list for method output_type
+ 5, // [5:7] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_network_proto_init() }
@@ -558,7 +634,7 @@ func file_network_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_network_proto_rawDesc,
NumEnums: 0,
- NumMessages: 5,
+ NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/www/grpc/gen/go/network_grpc.pb.go b/www/grpc/gen/go/network_grpc.pb.go
index 8dfa1ed2e..74f75af03 100644
--- a/www/grpc/gen/go/network_grpc.pb.go
+++ b/www/grpc/gen/go/network_grpc.pb.go
@@ -1,8 +1,4 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc (unknown)
-// source: network.proto
package pactus
diff --git a/www/grpc/gen/go/transaction.pb.go b/www/grpc/gen/go/transaction.pb.go
index a6beeb5a4..cdd7cd5cd 100644
--- a/www/grpc/gen/go/transaction.pb.go
+++ b/www/grpc/gen/go/transaction.pb.go
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.28.1
+// protoc-gen-go v1.26.0
// protoc (unknown)
// source: transaction.proto
@@ -242,6 +242,108 @@ func (x *GetTransactionResponse) GetTransaction() *TransactionInfo {
return nil
}
+type CalculateFeeRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Amount int64 `protobuf:"varint,1,opt,name=amount,proto3" json:"amount,omitempty"`
+ PayloadType PayloadType `protobuf:"varint,2,opt,name=payloadType,proto3,enum=pactus.PayloadType" json:"payloadType,omitempty"`
+}
+
+func (x *CalculateFeeRequest) Reset() {
+ *x = CalculateFeeRequest{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_transaction_proto_msgTypes[2]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CalculateFeeRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CalculateFeeRequest) ProtoMessage() {}
+
+func (x *CalculateFeeRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_transaction_proto_msgTypes[2]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CalculateFeeRequest.ProtoReflect.Descriptor instead.
+func (*CalculateFeeRequest) Descriptor() ([]byte, []int) {
+ return file_transaction_proto_rawDescGZIP(), []int{2}
+}
+
+func (x *CalculateFeeRequest) GetAmount() int64 {
+ if x != nil {
+ return x.Amount
+ }
+ return 0
+}
+
+func (x *CalculateFeeRequest) GetPayloadType() PayloadType {
+ if x != nil {
+ return x.PayloadType
+ }
+ return PayloadType_UNKNOWN
+}
+
+type CalculateFeeResponse struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Fee int64 `protobuf:"varint,1,opt,name=fee,proto3" json:"fee,omitempty"`
+}
+
+func (x *CalculateFeeResponse) Reset() {
+ *x = CalculateFeeResponse{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_transaction_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *CalculateFeeResponse) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*CalculateFeeResponse) ProtoMessage() {}
+
+func (x *CalculateFeeResponse) ProtoReflect() protoreflect.Message {
+ mi := &file_transaction_proto_msgTypes[3]
+ if protoimpl.UnsafeEnabled && x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use CalculateFeeResponse.ProtoReflect.Descriptor instead.
+func (*CalculateFeeResponse) Descriptor() ([]byte, []int) {
+ return file_transaction_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *CalculateFeeResponse) GetFee() int64 {
+ if x != nil {
+ return x.Fee
+ }
+ return 0
+}
+
type SendRawTransactionRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -253,7 +355,7 @@ type SendRawTransactionRequest struct {
func (x *SendRawTransactionRequest) Reset() {
*x = SendRawTransactionRequest{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[2]
+ mi := &file_transaction_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -266,7 +368,7 @@ func (x *SendRawTransactionRequest) String() string {
func (*SendRawTransactionRequest) ProtoMessage() {}
func (x *SendRawTransactionRequest) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[2]
+ mi := &file_transaction_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -279,7 +381,7 @@ func (x *SendRawTransactionRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use SendRawTransactionRequest.ProtoReflect.Descriptor instead.
func (*SendRawTransactionRequest) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{2}
+ return file_transaction_proto_rawDescGZIP(), []int{4}
}
func (x *SendRawTransactionRequest) GetData() []byte {
@@ -300,7 +402,7 @@ type SendRawTransactionResponse struct {
func (x *SendRawTransactionResponse) Reset() {
*x = SendRawTransactionResponse{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[3]
+ mi := &file_transaction_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -313,7 +415,7 @@ func (x *SendRawTransactionResponse) String() string {
func (*SendRawTransactionResponse) ProtoMessage() {}
func (x *SendRawTransactionResponse) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[3]
+ mi := &file_transaction_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -326,7 +428,7 @@ func (x *SendRawTransactionResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use SendRawTransactionResponse.ProtoReflect.Descriptor instead.
func (*SendRawTransactionResponse) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{3}
+ return file_transaction_proto_rawDescGZIP(), []int{5}
}
func (x *SendRawTransactionResponse) GetId() []byte {
@@ -349,7 +451,7 @@ type PayloadTransfer struct {
func (x *PayloadTransfer) Reset() {
*x = PayloadTransfer{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[4]
+ mi := &file_transaction_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -362,7 +464,7 @@ func (x *PayloadTransfer) String() string {
func (*PayloadTransfer) ProtoMessage() {}
func (x *PayloadTransfer) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[4]
+ mi := &file_transaction_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -375,7 +477,7 @@ func (x *PayloadTransfer) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadTransfer.ProtoReflect.Descriptor instead.
func (*PayloadTransfer) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{4}
+ return file_transaction_proto_rawDescGZIP(), []int{6}
}
func (x *PayloadTransfer) GetSender() string {
@@ -412,7 +514,7 @@ type PayloadBond struct {
func (x *PayloadBond) Reset() {
*x = PayloadBond{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[5]
+ mi := &file_transaction_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -425,7 +527,7 @@ func (x *PayloadBond) String() string {
func (*PayloadBond) ProtoMessage() {}
func (x *PayloadBond) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[5]
+ mi := &file_transaction_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -438,7 +540,7 @@ func (x *PayloadBond) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadBond.ProtoReflect.Descriptor instead.
func (*PayloadBond) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{5}
+ return file_transaction_proto_rawDescGZIP(), []int{7}
}
func (x *PayloadBond) GetSender() string {
@@ -474,7 +576,7 @@ type PayloadSortition struct {
func (x *PayloadSortition) Reset() {
*x = PayloadSortition{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[6]
+ mi := &file_transaction_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -487,7 +589,7 @@ func (x *PayloadSortition) String() string {
func (*PayloadSortition) ProtoMessage() {}
func (x *PayloadSortition) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[6]
+ mi := &file_transaction_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -500,7 +602,7 @@ func (x *PayloadSortition) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadSortition.ProtoReflect.Descriptor instead.
func (*PayloadSortition) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{6}
+ return file_transaction_proto_rawDescGZIP(), []int{8}
}
func (x *PayloadSortition) GetAddress() string {
@@ -528,7 +630,7 @@ type PayloadUnbond struct {
func (x *PayloadUnbond) Reset() {
*x = PayloadUnbond{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[7]
+ mi := &file_transaction_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -541,7 +643,7 @@ func (x *PayloadUnbond) String() string {
func (*PayloadUnbond) ProtoMessage() {}
func (x *PayloadUnbond) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[7]
+ mi := &file_transaction_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -554,7 +656,7 @@ func (x *PayloadUnbond) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadUnbond.ProtoReflect.Descriptor instead.
func (*PayloadUnbond) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{7}
+ return file_transaction_proto_rawDescGZIP(), []int{9}
}
func (x *PayloadUnbond) GetValidator() string {
@@ -577,7 +679,7 @@ type PayloadWithdraw struct {
func (x *PayloadWithdraw) Reset() {
*x = PayloadWithdraw{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[8]
+ mi := &file_transaction_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -590,7 +692,7 @@ func (x *PayloadWithdraw) String() string {
func (*PayloadWithdraw) ProtoMessage() {}
func (x *PayloadWithdraw) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[8]
+ mi := &file_transaction_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -603,7 +705,7 @@ func (x *PayloadWithdraw) ProtoReflect() protoreflect.Message {
// Deprecated: Use PayloadWithdraw.ProtoReflect.Descriptor instead.
func (*PayloadWithdraw) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{8}
+ return file_transaction_proto_rawDescGZIP(), []int{10}
}
func (x *PayloadWithdraw) GetFrom() string {
@@ -639,7 +741,7 @@ type TransactionInfo struct {
Sequence int32 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"`
Value int64 `protobuf:"varint,6,opt,name=value,proto3" json:"value,omitempty"`
Fee int64 `protobuf:"varint,7,opt,name=fee,proto3" json:"fee,omitempty"`
- PayloadType PayloadType `protobuf:"varint,8,opt,name=PayloadType,proto3,enum=pactus.PayloadType" json:"PayloadType,omitempty"`
+ PayloadType PayloadType `protobuf:"varint,8,opt,name=payloadType,proto3,enum=pactus.PayloadType" json:"payloadType,omitempty"`
// Types that are assignable to Payload:
//
// *TransactionInfo_Transfer
@@ -647,7 +749,7 @@ type TransactionInfo struct {
// *TransactionInfo_Sortition
// *TransactionInfo_Unbond
// *TransactionInfo_Withdraw
- Payload isTransactionInfo_Payload `protobuf_oneof:"Payload"`
+ Payload isTransactionInfo_Payload `protobuf_oneof:"payload"`
Memo string `protobuf:"bytes,9,opt,name=memo,proto3" json:"memo,omitempty"`
PublicKey string `protobuf:"bytes,10,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
Signature []byte `protobuf:"bytes,11,opt,name=signature,proto3" json:"signature,omitempty"`
@@ -656,7 +758,7 @@ type TransactionInfo struct {
func (x *TransactionInfo) Reset() {
*x = TransactionInfo{}
if protoimpl.UnsafeEnabled {
- mi := &file_transaction_proto_msgTypes[9]
+ mi := &file_transaction_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -669,7 +771,7 @@ func (x *TransactionInfo) String() string {
func (*TransactionInfo) ProtoMessage() {}
func (x *TransactionInfo) ProtoReflect() protoreflect.Message {
- mi := &file_transaction_proto_msgTypes[9]
+ mi := &file_transaction_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -682,7 +784,7 @@ func (x *TransactionInfo) ProtoReflect() protoreflect.Message {
// Deprecated: Use TransactionInfo.ProtoReflect.Descriptor instead.
func (*TransactionInfo) Descriptor() ([]byte, []int) {
- return file_transaction_proto_rawDescGZIP(), []int{9}
+ return file_transaction_proto_rawDescGZIP(), []int{11}
}
func (x *TransactionInfo) GetId() []byte {
@@ -858,7 +960,16 @@ var file_transaction_proto_rawDesc = []byte{
0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x74, 0x72, 0x61,
- 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x19, 0x53, 0x65, 0x6e, 0x64,
+ 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x13, 0x43, 0x61, 0x6c, 0x63,
+ 0x75, 0x6c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
+ 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x35, 0x0a, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f,
+ 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70,
+ 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70,
+ 0x65, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x22, 0x28,
+ 0x0a, 0x14, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65,
+ 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x01, 0x20,
+ 0x01, 0x28, 0x03, 0x52, 0x03, 0x66, 0x65, 0x65, 0x22, 0x2f, 0x0a, 0x19, 0x53, 0x65, 0x6e, 0x64,
0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2c, 0x0a, 0x1a, 0x53, 0x65, 0x6e,
@@ -899,9 +1010,9 @@ var file_transaction_proto_rawDesc = []byte{
0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66,
0x65, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x35, 0x0a,
- 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01,
+ 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x13, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x50, 0x61, 0x79, 0x6c,
- 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
+ 0x6f, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0b, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x54, 0x79, 0x70, 0x65, 0x12, 0x35, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72,
0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e,
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x48,
@@ -923,7 +1034,7 @@ var file_transaction_proto_rawDesc = []byte{
0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x73,
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09,
- 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x50, 0x61, 0x79,
+ 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x70, 0x61, 0x79,
0x6c, 0x6f, 0x61, 0x64, 0x2a, 0x83, 0x01, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0x54, 0x79, 0x70, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10,
0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x46, 0x45, 0x52, 0x5f, 0x50, 0x41,
@@ -936,24 +1047,29 @@ var file_transaction_proto_rawDesc = []byte{
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x69,
0x74, 0x79, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f,
0x4e, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x52, 0x41, 0x4e,
- 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x32, 0xbb,
- 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f,
+ 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x49, 0x4e, 0x46, 0x4f, 0x10, 0x01, 0x32, 0x86,
+ 0x02, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f,
0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x1d, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61,
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1e, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
- 0x5b, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61,
- 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x21, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x53,
- 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
- 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75,
- 0x73, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
- 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x46, 0x0a, 0x12,
- 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x5a, 0x30, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70,
- 0x61, 0x63, 0x74, 0x75, 0x73, 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x61,
- 0x63, 0x74, 0x75, 0x73, 0x2f, 0x77, 0x77, 0x77, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x61,
- 0x63, 0x74, 0x75, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+ 0x49, 0x0a, 0x0c, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x12,
+ 0x1b, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61,
+ 0x74, 0x65, 0x46, 0x65, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70,
+ 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x43, 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x46,
+ 0x65, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5b, 0x0a, 0x12, 0x53, 0x65,
+ 0x6e, 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+ 0x12, 0x21, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x61,
+ 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2e, 0x53, 0x65, 0x6e,
+ 0x64, 0x52, 0x61, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x46, 0x0a, 0x12, 0x70, 0x61, 0x63, 0x74, 0x75,
+ 0x73, 0x2e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5a, 0x30, 0x67,
+ 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73,
+ 0x2d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x2f,
+ 0x77, 0x77, 0x77, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x61, 0x63, 0x74, 0x75, 0x73, 0x62,
+ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -969,39 +1085,44 @@ func file_transaction_proto_rawDescGZIP() []byte {
}
var file_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
-var file_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
+var file_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_transaction_proto_goTypes = []interface{}{
(PayloadType)(0), // 0: pactus.PayloadType
(TransactionVerbosity)(0), // 1: pactus.TransactionVerbosity
(*GetTransactionRequest)(nil), // 2: pactus.GetTransactionRequest
(*GetTransactionResponse)(nil), // 3: pactus.GetTransactionResponse
- (*SendRawTransactionRequest)(nil), // 4: pactus.SendRawTransactionRequest
- (*SendRawTransactionResponse)(nil), // 5: pactus.SendRawTransactionResponse
- (*PayloadTransfer)(nil), // 6: pactus.PayloadTransfer
- (*PayloadBond)(nil), // 7: pactus.PayloadBond
- (*PayloadSortition)(nil), // 8: pactus.PayloadSortition
- (*PayloadUnbond)(nil), // 9: pactus.PayloadUnbond
- (*PayloadWithdraw)(nil), // 10: pactus.PayloadWithdraw
- (*TransactionInfo)(nil), // 11: pactus.TransactionInfo
+ (*CalculateFeeRequest)(nil), // 4: pactus.CalculateFeeRequest
+ (*CalculateFeeResponse)(nil), // 5: pactus.CalculateFeeResponse
+ (*SendRawTransactionRequest)(nil), // 6: pactus.SendRawTransactionRequest
+ (*SendRawTransactionResponse)(nil), // 7: pactus.SendRawTransactionResponse
+ (*PayloadTransfer)(nil), // 8: pactus.PayloadTransfer
+ (*PayloadBond)(nil), // 9: pactus.PayloadBond
+ (*PayloadSortition)(nil), // 10: pactus.PayloadSortition
+ (*PayloadUnbond)(nil), // 11: pactus.PayloadUnbond
+ (*PayloadWithdraw)(nil), // 12: pactus.PayloadWithdraw
+ (*TransactionInfo)(nil), // 13: pactus.TransactionInfo
}
var file_transaction_proto_depIdxs = []int32{
1, // 0: pactus.GetTransactionRequest.verbosity:type_name -> pactus.TransactionVerbosity
- 11, // 1: pactus.GetTransactionResponse.transaction:type_name -> pactus.TransactionInfo
- 0, // 2: pactus.TransactionInfo.PayloadType:type_name -> pactus.PayloadType
- 6, // 3: pactus.TransactionInfo.transfer:type_name -> pactus.PayloadTransfer
- 7, // 4: pactus.TransactionInfo.bond:type_name -> pactus.PayloadBond
- 8, // 5: pactus.TransactionInfo.sortition:type_name -> pactus.PayloadSortition
- 9, // 6: pactus.TransactionInfo.unbond:type_name -> pactus.PayloadUnbond
- 10, // 7: pactus.TransactionInfo.withdraw:type_name -> pactus.PayloadWithdraw
- 2, // 8: pactus.Transaction.GetTransaction:input_type -> pactus.GetTransactionRequest
- 4, // 9: pactus.Transaction.SendRawTransaction:input_type -> pactus.SendRawTransactionRequest
- 3, // 10: pactus.Transaction.GetTransaction:output_type -> pactus.GetTransactionResponse
- 5, // 11: pactus.Transaction.SendRawTransaction:output_type -> pactus.SendRawTransactionResponse
- 10, // [10:12] is the sub-list for method output_type
- 8, // [8:10] is the sub-list for method input_type
- 8, // [8:8] is the sub-list for extension type_name
- 8, // [8:8] is the sub-list for extension extendee
- 0, // [0:8] is the sub-list for field type_name
+ 13, // 1: pactus.GetTransactionResponse.transaction:type_name -> pactus.TransactionInfo
+ 0, // 2: pactus.CalculateFeeRequest.payloadType:type_name -> pactus.PayloadType
+ 0, // 3: pactus.TransactionInfo.payloadType:type_name -> pactus.PayloadType
+ 8, // 4: pactus.TransactionInfo.transfer:type_name -> pactus.PayloadTransfer
+ 9, // 5: pactus.TransactionInfo.bond:type_name -> pactus.PayloadBond
+ 10, // 6: pactus.TransactionInfo.sortition:type_name -> pactus.PayloadSortition
+ 11, // 7: pactus.TransactionInfo.unbond:type_name -> pactus.PayloadUnbond
+ 12, // 8: pactus.TransactionInfo.withdraw:type_name -> pactus.PayloadWithdraw
+ 2, // 9: pactus.Transaction.GetTransaction:input_type -> pactus.GetTransactionRequest
+ 4, // 10: pactus.Transaction.CalculateFee:input_type -> pactus.CalculateFeeRequest
+ 6, // 11: pactus.Transaction.SendRawTransaction:input_type -> pactus.SendRawTransactionRequest
+ 3, // 12: pactus.Transaction.GetTransaction:output_type -> pactus.GetTransactionResponse
+ 5, // 13: pactus.Transaction.CalculateFee:output_type -> pactus.CalculateFeeResponse
+ 7, // 14: pactus.Transaction.SendRawTransaction:output_type -> pactus.SendRawTransactionResponse
+ 12, // [12:15] is the sub-list for method output_type
+ 9, // [9:12] is the sub-list for method input_type
+ 9, // [9:9] is the sub-list for extension type_name
+ 9, // [9:9] is the sub-list for extension extendee
+ 0, // [0:9] is the sub-list for field type_name
}
func init() { file_transaction_proto_init() }
@@ -1035,7 +1156,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*SendRawTransactionRequest); i {
+ switch v := v.(*CalculateFeeRequest); i {
case 0:
return &v.state
case 1:
@@ -1047,7 +1168,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*SendRawTransactionResponse); i {
+ switch v := v.(*CalculateFeeResponse); i {
case 0:
return &v.state
case 1:
@@ -1059,7 +1180,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PayloadTransfer); i {
+ switch v := v.(*SendRawTransactionRequest); i {
case 0:
return &v.state
case 1:
@@ -1071,7 +1192,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PayloadBond); i {
+ switch v := v.(*SendRawTransactionResponse); i {
case 0:
return &v.state
case 1:
@@ -1083,7 +1204,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PayloadSortition); i {
+ switch v := v.(*PayloadTransfer); i {
case 0:
return &v.state
case 1:
@@ -1095,7 +1216,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PayloadUnbond); i {
+ switch v := v.(*PayloadBond); i {
case 0:
return &v.state
case 1:
@@ -1107,7 +1228,7 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*PayloadWithdraw); i {
+ switch v := v.(*PayloadSortition); i {
case 0:
return &v.state
case 1:
@@ -1119,6 +1240,30 @@ func file_transaction_proto_init() {
}
}
file_transaction_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*PayloadUnbond); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_transaction_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*PayloadWithdraw); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_transaction_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransactionInfo); i {
case 0:
return &v.state
@@ -1131,7 +1276,7 @@ func file_transaction_proto_init() {
}
}
}
- file_transaction_proto_msgTypes[9].OneofWrappers = []interface{}{
+ file_transaction_proto_msgTypes[11].OneofWrappers = []interface{}{
(*TransactionInfo_Transfer)(nil),
(*TransactionInfo_Bond)(nil),
(*TransactionInfo_Sortition)(nil),
@@ -1144,7 +1289,7 @@ func file_transaction_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_transaction_proto_rawDesc,
NumEnums: 2,
- NumMessages: 10,
+ NumMessages: 12,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/www/grpc/gen/go/transaction.pb.gw.go b/www/grpc/gen/go/transaction.pb.gw.go
index 11feaaee5..b35fcdbf8 100644
--- a/www/grpc/gen/go/transaction.pb.gw.go
+++ b/www/grpc/gen/go/transaction.pb.gw.go
@@ -109,6 +109,84 @@ func local_request_Transaction_GetTransaction_0(ctx context.Context, marshaler r
}
+func request_Transaction_CalculateFee_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CalculateFeeRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ e int32
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["amount"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount")
+ }
+
+ protoReq.Amount, err = runtime.Int64(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err)
+ }
+
+ val, ok = pathParams["payloadType"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payloadType")
+ }
+
+ e, err = runtime.Enum(val, PayloadType_value)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payloadType", err)
+ }
+
+ protoReq.PayloadType = PayloadType(e)
+
+ msg, err := client.CalculateFee(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+
+}
+
+func local_request_Transaction_CalculateFee_0(ctx context.Context, marshaler runtime.Marshaler, server TransactionServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var protoReq CalculateFeeRequest
+ var metadata runtime.ServerMetadata
+
+ var (
+ val string
+ e int32
+ ok bool
+ err error
+ _ = err
+ )
+
+ val, ok = pathParams["amount"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "amount")
+ }
+
+ protoReq.Amount, err = runtime.Int64(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amount", err)
+ }
+
+ val, ok = pathParams["payloadType"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "payloadType")
+ }
+
+ e, err = runtime.Enum(val, PayloadType_value)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "payloadType", err)
+ }
+
+ protoReq.PayloadType = PayloadType(e)
+
+ msg, err := server.CalculateFee(ctx, &protoReq)
+ return msg, metadata, err
+
+}
+
func request_Transaction_SendRawTransaction_0(ctx context.Context, marshaler runtime.Marshaler, client TransactionClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SendRawTransactionRequest
var metadata runtime.ServerMetadata
@@ -192,6 +270,31 @@ func RegisterTransactionHandlerServer(ctx context.Context, mux *runtime.ServeMux
})
+ mux.Handle("GET", pattern_Transaction_CalculateFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/pactus.Transaction/CalculateFee", runtime.WithHTTPPathPattern("/v1/transaction/amount/{amount}/payloadType/{payloadType}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_Transaction_CalculateFee_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Transaction_CalculateFee_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("PUT", pattern_Transaction_SendRawTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -280,6 +383,28 @@ func RegisterTransactionHandlerClient(ctx context.Context, mux *runtime.ServeMux
})
+ mux.Handle("GET", pattern_Transaction_CalculateFee_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ var err error
+ var annotatedContext context.Context
+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/pactus.Transaction/CalculateFee", runtime.WithHTTPPathPattern("/v1/transaction/amount/{amount}/payloadType/{payloadType}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_Transaction_CalculateFee_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+
+ forward_Transaction_CalculateFee_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+
+ })
+
mux.Handle("PUT", pattern_Transaction_SendRawTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -308,11 +433,15 @@ func RegisterTransactionHandlerClient(ctx context.Context, mux *runtime.ServeMux
var (
pattern_Transaction_GetTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"v1", "transaction", "id", "verbosity"}, ""))
+ pattern_Transaction_CalculateFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"v1", "transaction", "amount", "payloadType"}, ""))
+
pattern_Transaction_SendRawTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "transaction", "send_raw_transaction", "data"}, ""))
)
var (
forward_Transaction_GetTransaction_0 = runtime.ForwardResponseMessage
+ forward_Transaction_CalculateFee_0 = runtime.ForwardResponseMessage
+
forward_Transaction_SendRawTransaction_0 = runtime.ForwardResponseMessage
)
diff --git a/www/grpc/gen/go/transaction_grpc.pb.go b/www/grpc/gen/go/transaction_grpc.pb.go
index 43c40a17b..76efcef30 100644
--- a/www/grpc/gen/go/transaction_grpc.pb.go
+++ b/www/grpc/gen/go/transaction_grpc.pb.go
@@ -1,8 +1,4 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc (unknown)
-// source: transaction.proto
package pactus
@@ -23,6 +19,7 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type TransactionClient interface {
GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error)
+ CalculateFee(ctx context.Context, in *CalculateFeeRequest, opts ...grpc.CallOption) (*CalculateFeeResponse, error)
SendRawTransaction(ctx context.Context, in *SendRawTransactionRequest, opts ...grpc.CallOption) (*SendRawTransactionResponse, error)
}
@@ -43,6 +40,15 @@ func (c *transactionClient) GetTransaction(ctx context.Context, in *GetTransacti
return out, nil
}
+func (c *transactionClient) CalculateFee(ctx context.Context, in *CalculateFeeRequest, opts ...grpc.CallOption) (*CalculateFeeResponse, error) {
+ out := new(CalculateFeeResponse)
+ err := c.cc.Invoke(ctx, "/pactus.Transaction/CalculateFee", in, out, opts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *transactionClient) SendRawTransaction(ctx context.Context, in *SendRawTransactionRequest, opts ...grpc.CallOption) (*SendRawTransactionResponse, error) {
out := new(SendRawTransactionResponse)
err := c.cc.Invoke(ctx, "/pactus.Transaction/SendRawTransaction", in, out, opts...)
@@ -57,6 +63,7 @@ func (c *transactionClient) SendRawTransaction(ctx context.Context, in *SendRawT
// for forward compatibility
type TransactionServer interface {
GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error)
+ CalculateFee(context.Context, *CalculateFeeRequest) (*CalculateFeeResponse, error)
SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error)
}
@@ -67,6 +74,9 @@ type UnimplementedTransactionServer struct {
func (UnimplementedTransactionServer) GetTransaction(context.Context, *GetTransactionRequest) (*GetTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetTransaction not implemented")
}
+func (UnimplementedTransactionServer) CalculateFee(context.Context, *CalculateFeeRequest) (*CalculateFeeResponse, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method CalculateFee not implemented")
+}
func (UnimplementedTransactionServer) SendRawTransaction(context.Context, *SendRawTransactionRequest) (*SendRawTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendRawTransaction not implemented")
}
@@ -100,6 +110,24 @@ func _Transaction_GetTransaction_Handler(srv interface{}, ctx context.Context, d
return interceptor(ctx, in, info, handler)
}
+func _Transaction_CalculateFee_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(CalculateFeeRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(TransactionServer).CalculateFee(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: "/pactus.Transaction/CalculateFee",
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(TransactionServer).CalculateFee(ctx, req.(*CalculateFeeRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _Transaction_SendRawTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendRawTransactionRequest)
if err := dec(in); err != nil {
@@ -129,6 +157,10 @@ var Transaction_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetTransaction",
Handler: _Transaction_GetTransaction_Handler,
},
+ {
+ MethodName: "CalculateFee",
+ Handler: _Transaction_CalculateFee_Handler,
+ },
{
MethodName: "SendRawTransaction",
Handler: _Transaction_SendRawTransaction_Handler,
diff --git a/www/grpc/gen/go/wallet.pb.go b/www/grpc/gen/go/wallet.pb.go
index 1fe692718..320b108cf 100644
--- a/www/grpc/gen/go/wallet.pb.go
+++ b/www/grpc/gen/go/wallet.pb.go
@@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
-// protoc-gen-go v1.28.1
+// protoc-gen-go v1.26.0
// protoc (unknown)
// source: wallet.proto
diff --git a/www/grpc/gen/go/wallet_grpc.pb.go b/www/grpc/gen/go/wallet_grpc.pb.go
index 53b89b640..2607cf981 100644
--- a/www/grpc/gen/go/wallet_grpc.pb.go
+++ b/www/grpc/gen/go/wallet_grpc.pb.go
@@ -1,8 +1,4 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
-// versions:
-// - protoc-gen-go-grpc v1.2.0
-// - protoc (unknown)
-// source: wallet.proto
package pactus
diff --git a/www/grpc/gen/java/pactus/blockchain/BlockchainGrpc.java b/www/grpc/gen/java/pactus/blockchain/BlockchainGrpc.java
index 2fa17bb12..81a2b13c0 100644
--- a/www/grpc/gen/java/pactus/blockchain/BlockchainGrpc.java
+++ b/www/grpc/gen/java/pactus/blockchain/BlockchainGrpc.java
@@ -325,37 +325,6 @@ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse> getGetVali
return getGetValidatorAddressesMethod;
}
- private static volatile io.grpc.MethodDescriptor getGetValidatorsMethod;
-
- @io.grpc.stub.annotations.RpcMethod(
- fullMethodName = SERVICE_NAME + '/' + "GetValidators",
- requestType = pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.class,
- responseType = pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.class,
- methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
- public static io.grpc.MethodDescriptor getGetValidatorsMethod() {
- io.grpc.MethodDescriptor getGetValidatorsMethod;
- if ((getGetValidatorsMethod = BlockchainGrpc.getGetValidatorsMethod) == null) {
- synchronized (BlockchainGrpc.class) {
- if ((getGetValidatorsMethod = BlockchainGrpc.getGetValidatorsMethod) == null) {
- BlockchainGrpc.getGetValidatorsMethod = getGetValidatorsMethod =
- io.grpc.MethodDescriptor.newBuilder()
- .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
- .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetValidators"))
- .setSampledToLocalTracing(true)
- .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.getDefaultInstance()))
- .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.getDefaultInstance()))
- .setSchemaDescriptor(new BlockchainMethodDescriptorSupplier("GetValidators"))
- .build();
- }
- }
- }
- return getGetValidatorsMethod;
- }
-
/**
* Creates a new async stub that supports all call types for the service
*/
@@ -474,13 +443,6 @@ public void getValidatorAddresses(pactus.blockchain.BlockchainOuterClass.GetVali
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetValidatorAddressesMethod(), responseObserver);
}
- /**
- */
- public void getValidators(pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetValidatorsMethod(), responseObserver);
- }
-
@java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
@@ -553,13 +515,6 @@ public void getValidators(pactus.blockchain.BlockchainOuterClass.GetValidatorsRe
pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest,
pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse>(
this, METHODID_GET_VALIDATOR_ADDRESSES)))
- .addMethod(
- getGetValidatorsMethod(),
- io.grpc.stub.ServerCalls.asyncUnaryCall(
- new MethodHandlers<
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest,
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse>(
- this, METHODID_GET_VALIDATORS)))
.build();
}
}
@@ -657,14 +612,6 @@ public void getValidatorAddresses(pactus.blockchain.BlockchainOuterClass.GetVali
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getGetValidatorAddressesMethod(), getCallOptions()), request, responseObserver);
}
-
- /**
- */
- public void getValidators(pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest request,
- io.grpc.stub.StreamObserver responseObserver) {
- io.grpc.stub.ClientCalls.asyncUnaryCall(
- getChannel().newCall(getGetValidatorsMethod(), getCallOptions()), request, responseObserver);
- }
}
/**
@@ -750,13 +697,6 @@ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getV
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getGetValidatorAddressesMethod(), getCallOptions(), request);
}
-
- /**
- */
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse getValidators(pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest request) {
- return io.grpc.stub.ClientCalls.blockingUnaryCall(
- getChannel(), getGetValidatorsMethod(), getCallOptions(), request);
- }
}
/**
@@ -852,14 +792,6 @@ public com.google.common.util.concurrent.ListenableFuture getValidators(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest request) {
- return io.grpc.stub.ClientCalls.futureUnaryCall(
- getChannel().newCall(getGetValidatorsMethod(), getCallOptions()), request);
- }
}
private static final int METHODID_GET_BLOCK = 0;
@@ -872,7 +804,6 @@ public com.google.common.util.concurrent.ListenableFuture implements
io.grpc.stub.ServerCalls.UnaryMethod,
@@ -931,10 +862,6 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv
serviceImpl.getValidatorAddresses((pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
- case METHODID_GET_VALIDATORS:
- serviceImpl.getValidators((pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest) request,
- (io.grpc.stub.StreamObserver) responseObserver);
- break;
default:
throw new AssertionError();
}
@@ -1006,7 +933,6 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getGetValidatorMethod())
.addMethod(getGetValidatorByNumberMethod())
.addMethod(getGetValidatorAddressesMethod())
- .addMethod(getGetValidatorsMethod())
.build();
}
}
diff --git a/www/grpc/gen/java/pactus/blockchain/BlockchainOuterClass.java b/www/grpc/gen/java/pactus/blockchain/BlockchainOuterClass.java
index dd4f61c5e..35332a36a 100644
--- a/www/grpc/gen/java/pactus/blockchain/BlockchainOuterClass.java
+++ b/www/grpc/gen/java/pactus/blockchain/BlockchainOuterClass.java
@@ -1873,30 +1873,30 @@ public pactus.blockchain.BlockchainOuterClass.GetAccountResponse getDefaultInsta
}
- public interface GetValidatorsRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorsRequest)
+ public interface GetValidatorAddressesRequestOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.GetValidatorAddressesRequest)
com.google.protobuf.MessageOrBuilder {
}
/**
- * Protobuf type {@code pactus.GetValidatorsRequest}
+ * Protobuf type {@code pactus.GetValidatorAddressesRequest}
*/
- public static final class GetValidatorsRequest extends
+ public static final class GetValidatorAddressesRequest extends
com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorsRequest)
- GetValidatorsRequestOrBuilder {
+ // @@protoc_insertion_point(message_implements:pactus.GetValidatorAddressesRequest)
+ GetValidatorAddressesRequestOrBuilder {
private static final long serialVersionUID = 0L;
- // Use GetValidatorsRequest.newBuilder() to construct.
- private GetValidatorsRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use GetValidatorAddressesRequest.newBuilder() to construct.
+ private GetValidatorAddressesRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private GetValidatorsRequest() {
+ private GetValidatorAddressesRequest() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
- return new GetValidatorsRequest();
+ return new GetValidatorAddressesRequest();
}
@java.lang.Override
@@ -1906,15 +1906,15 @@ protected java.lang.Object newInstance(
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.Builder.class);
}
private byte memoizedIsInitialized = -1;
@@ -1950,10 +1950,10 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest)) {
+ if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest)) {
return super.equals(obj);
}
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest) obj;
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest) obj;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
@@ -1971,69 +1971,69 @@ public int hashCode() {
return hash;
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(byte[] data)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseDelimitedFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseDelimitedFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -2046,7 +2046,7 @@ public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest parseF
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest prototype) {
+ public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
@@ -2062,26 +2062,26 @@ protected Builder newBuilderForType(
return builder;
}
/**
- * Protobuf type {@code pactus.GetValidatorsRequest}
+ * Protobuf type {@code pactus.GetValidatorAddressesRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorsRequest)
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequestOrBuilder {
+ // @@protoc_insertion_point(builder_implements:pactus.GetValidatorAddressesRequest)
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.Builder.class);
}
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.newBuilder()
+ // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.newBuilder()
private Builder() {
}
@@ -2100,17 +2100,17 @@ public Builder clear() {
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.getDefaultInstance();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstanceForType() {
+ return pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.getDefaultInstance();
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest result = buildPartial();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest build() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -2118,8 +2118,8 @@ public pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest build() {
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest(this);
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest buildPartial() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest(this);
onBuilt();
return result;
}
@@ -2158,16 +2158,16 @@ public Builder addRepeatedField(
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest)other);
+ if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest) {
+ return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest.getDefaultInstance()) return this;
+ public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest other) {
+ if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.getDefaultInstance()) return this;
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -2222,23 +2222,23 @@ public final Builder mergeUnknownFields(
}
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorsRequest)
+ // @@protoc_insertion_point(builder_scope:pactus.GetValidatorAddressesRequest)
}
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorsRequest)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:pactus.GetValidatorAddressesRequest)
+ private static final pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest();
+ DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest();
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest getDefaultInstance() {
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
- public GetValidatorsRequest parsePartialFrom(
+ public GetValidatorAddressesRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
@@ -2257,46 +2257,72 @@ public GetValidatorsRequest parsePartialFrom(
}
};
- public static com.google.protobuf.Parser parser() {
+ public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
+ public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsRequest getDefaultInstanceForType() {
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
- public interface GetValidatorAddressesRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorAddressesRequest)
+ public interface GetValidatorAddressesResponseOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.GetValidatorAddressesResponse)
com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return A list containing the addresses.
+ */
+ java.util.List
+ getAddressesList();
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return The count of addresses.
+ */
+ int getAddressesCount();
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the element to return.
+ * @return The addresses at the given index.
+ */
+ java.lang.String getAddresses(int index);
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the value to return.
+ * @return The bytes of the addresses at the given index.
+ */
+ com.google.protobuf.ByteString
+ getAddressesBytes(int index);
}
/**
- * Protobuf type {@code pactus.GetValidatorAddressesRequest}
+ * Protobuf type {@code pactus.GetValidatorAddressesResponse}
*/
- public static final class GetValidatorAddressesRequest extends
+ public static final class GetValidatorAddressesResponse extends
com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorAddressesRequest)
- GetValidatorAddressesRequestOrBuilder {
+ // @@protoc_insertion_point(message_implements:pactus.GetValidatorAddressesResponse)
+ GetValidatorAddressesResponseOrBuilder {
private static final long serialVersionUID = 0L;
- // Use GetValidatorAddressesRequest.newBuilder() to construct.
- private GetValidatorAddressesRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use GetValidatorAddressesResponse.newBuilder() to construct.
+ private GetValidatorAddressesResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private GetValidatorAddressesRequest() {
+ private GetValidatorAddressesResponse() {
+ addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
- return new GetValidatorAddressesRequest();
+ return new GetValidatorAddressesResponse();
}
@java.lang.Override
@@ -2306,15 +2332,50 @@ protected java.lang.Object newInstance(
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.Builder.class);
+ }
+
+ public static final int ADDRESSES_FIELD_NUMBER = 1;
+ private com.google.protobuf.LazyStringList addresses_;
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return A list containing the addresses.
+ */
+ public com.google.protobuf.ProtocolStringList
+ getAddressesList() {
+ return addresses_;
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return The count of addresses.
+ */
+ public int getAddressesCount() {
+ return addresses_.size();
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the element to return.
+ * @return The addresses at the given index.
+ */
+ public java.lang.String getAddresses(int index) {
+ return addresses_.get(index);
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the value to return.
+ * @return The bytes of the addresses at the given index.
+ */
+ public com.google.protobuf.ByteString
+ getAddressesBytes(int index) {
+ return addresses_.getByteString(index);
}
private byte memoizedIsInitialized = -1;
@@ -2331,6 +2392,9 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
+ for (int i = 0; i < addresses_.size(); i++) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, addresses_.getRaw(i));
+ }
getUnknownFields().writeTo(output);
}
@@ -2340,6 +2404,14 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
+ {
+ int dataSize = 0;
+ for (int i = 0; i < addresses_.size(); i++) {
+ dataSize += computeStringSizeNoTag(addresses_.getRaw(i));
+ }
+ size += dataSize;
+ size += 1 * getAddressesList().size();
+ }
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -2350,11 +2422,13 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest)) {
+ if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse)) {
return super.equals(obj);
}
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest) obj;
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse other = (pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse) obj;
+ if (!getAddressesList()
+ .equals(other.getAddressesList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -2366,74 +2440,78 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
+ if (getAddressesCount() > 0) {
+ hash = (37 * hash) + ADDRESSES_FIELD_NUMBER;
+ hash = (53 * hash) + getAddressesList().hashCode();
+ }
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(byte[] data)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseDelimitedFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseDelimitedFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -2446,7 +2524,7 @@ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesReques
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest prototype) {
+ public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
@@ -2462,26 +2540,26 @@ protected Builder newBuilderForType(
return builder;
}
/**
- * Protobuf type {@code pactus.GetValidatorAddressesRequest}
+ * Protobuf type {@code pactus.GetValidatorAddressesResponse}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorAddressesRequest)
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequestOrBuilder {
+ // @@protoc_insertion_point(builder_implements:pactus.GetValidatorAddressesResponse)
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.Builder.class);
}
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.newBuilder()
+ // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.newBuilder()
private Builder() {
}
@@ -2494,23 +2572,25 @@ private Builder(
@java.lang.Override
public Builder clear() {
super.clear();
+ addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.getDefaultInstance();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstanceForType() {
+ return pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.getDefaultInstance();
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest result = buildPartial();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse build() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -2518,8 +2598,14 @@ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest build
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest(this);
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse buildPartial() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse result = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse(this);
+ int from_bitField0_ = bitField0_;
+ if (((bitField0_ & 0x00000001) != 0)) {
+ addresses_ = addresses_.getUnmodifiableView();
+ bitField0_ = (bitField0_ & ~0x00000001);
+ }
+ result.addresses_ = addresses_;
onBuilt();
return result;
}
@@ -2558,16 +2644,26 @@ public Builder addRepeatedField(
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest)other);
+ if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse) {
+ return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse)other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest.getDefaultInstance()) return this;
+ public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse other) {
+ if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.getDefaultInstance()) return this;
+ if (!other.addresses_.isEmpty()) {
+ if (addresses_.isEmpty()) {
+ addresses_ = other.addresses_;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ } else {
+ ensureAddressesIsMutable();
+ addresses_.addAll(other.addresses_);
+ }
+ onChanged();
+ }
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -2594,6 +2690,12 @@ public Builder mergeFrom(
case 0:
done = true;
break;
+ case 10: {
+ java.lang.String s = input.readStringRequireUtf8();
+ ensureAddressesIsMutable();
+ addresses_.add(s);
+ break;
+ } // case 10
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -2609,1165 +2711,114 @@ public Builder mergeFrom(
} // finally
return this;
}
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorAddressesRequest)
- }
-
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorAddressesRequest)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest();
- }
-
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public GetValidatorAddressesRequest parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesRequest getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface GetValidatorAddressesResponseOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorAddressesResponse)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return A list containing the addresses.
- */
- java.util.List
- getAddressesList();
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return The count of addresses.
- */
- int getAddressesCount();
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the element to return.
- * @return The addresses at the given index.
- */
- java.lang.String getAddresses(int index);
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the value to return.
- * @return The bytes of the addresses at the given index.
- */
- com.google.protobuf.ByteString
- getAddressesBytes(int index);
- }
- /**
- * Protobuf type {@code pactus.GetValidatorAddressesResponse}
- */
- public static final class GetValidatorAddressesResponse extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorAddressesResponse)
- GetValidatorAddressesResponseOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use GetValidatorAddressesResponse.newBuilder() to construct.
- private GetValidatorAddressesResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private GetValidatorAddressesResponse() {
- addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new GetValidatorAddressesResponse();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.Builder.class);
- }
-
- public static final int ADDRESSES_FIELD_NUMBER = 1;
- private com.google.protobuf.LazyStringList addresses_;
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return A list containing the addresses.
- */
- public com.google.protobuf.ProtocolStringList
- getAddressesList() {
- return addresses_;
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return The count of addresses.
- */
- public int getAddressesCount() {
- return addresses_.size();
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the element to return.
- * @return The addresses at the given index.
- */
- public java.lang.String getAddresses(int index) {
- return addresses_.get(index);
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the value to return.
- * @return The bytes of the addresses at the given index.
- */
- public com.google.protobuf.ByteString
- getAddressesBytes(int index) {
- return addresses_.getByteString(index);
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- for (int i = 0; i < addresses_.size(); i++) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 1, addresses_.getRaw(i));
- }
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- {
- int dataSize = 0;
- for (int i = 0; i < addresses_.size(); i++) {
- dataSize += computeStringSizeNoTag(addresses_.getRaw(i));
- }
- size += dataSize;
- size += 1 * getAddressesList().size();
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse)) {
- return super.equals(obj);
- }
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse other = (pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse) obj;
-
- if (!getAddressesList()
- .equals(other.getAddressesList())) return false;
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- if (getAddressesCount() > 0) {
- hash = (37 * hash) + ADDRESSES_FIELD_NUMBER;
- hash = (53 * hash) + getAddressesList().hashCode();
- }
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code pactus.GetValidatorAddressesResponse}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorAddressesResponse)
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponseOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.Builder.class);
- }
-
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorAddressesResponse_descriptor;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.getDefaultInstance();
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse result = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse(this);
- int from_bitField0_ = bitField0_;
- if (((bitField0_ & 0x00000001) != 0)) {
- addresses_ = addresses_.getUnmodifiableView();
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.addresses_ = addresses_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse.getDefaultInstance()) return this;
- if (!other.addresses_.isEmpty()) {
- if (addresses_.isEmpty()) {
- addresses_ = other.addresses_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureAddressesIsMutable();
- addresses_.addAll(other.addresses_);
- }
- onChanged();
- }
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- java.lang.String s = input.readStringRequireUtf8();
- ensureAddressesIsMutable();
- addresses_.add(s);
- break;
- } // case 10
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
- }
- private int bitField0_;
-
- private com.google.protobuf.LazyStringList addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- private void ensureAddressesIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- addresses_ = new com.google.protobuf.LazyStringArrayList(addresses_);
- bitField0_ |= 0x00000001;
- }
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return A list containing the addresses.
- */
- public com.google.protobuf.ProtocolStringList
- getAddressesList() {
- return addresses_.getUnmodifiableView();
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return The count of addresses.
- */
- public int getAddressesCount() {
- return addresses_.size();
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the element to return.
- * @return The addresses at the given index.
- */
- public java.lang.String getAddresses(int index) {
- return addresses_.get(index);
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index of the value to return.
- * @return The bytes of the addresses at the given index.
- */
- public com.google.protobuf.ByteString
- getAddressesBytes(int index) {
- return addresses_.getByteString(index);
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param index The index to set the value at.
- * @param value The addresses to set.
- * @return This builder for chaining.
- */
- public Builder setAddresses(
- int index, java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureAddressesIsMutable();
- addresses_.set(index, value);
- onChanged();
- return this;
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param value The addresses to add.
- * @return This builder for chaining.
- */
- public Builder addAddresses(
- java.lang.String value) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureAddressesIsMutable();
- addresses_.add(value);
- onChanged();
- return this;
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param values The addresses to add.
- * @return This builder for chaining.
- */
- public Builder addAllAddresses(
- java.lang.Iterable values) {
- ensureAddressesIsMutable();
- com.google.protobuf.AbstractMessageLite.Builder.addAll(
- values, addresses_);
- onChanged();
- return this;
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @return This builder for chaining.
- */
- public Builder clearAddresses() {
- addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- return this;
- }
- /**
- * repeated string addresses = 1 [json_name = "addresses"];
- * @param value The bytes of the addresses to add.
- * @return This builder for chaining.
- */
- public Builder addAddressesBytes(
- com.google.protobuf.ByteString value) {
- if (value == null) {
- throw new NullPointerException();
- }
- checkByteStringIsUtf8(value);
- ensureAddressesIsMutable();
- addresses_.add(value);
- onChanged();
- return this;
- }
- @java.lang.Override
- public final Builder setUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.setUnknownFields(unknownFields);
- }
-
- @java.lang.Override
- public final Builder mergeUnknownFields(
- final com.google.protobuf.UnknownFieldSet unknownFields) {
- return super.mergeUnknownFields(unknownFields);
- }
-
-
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorAddressesResponse)
- }
-
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorAddressesResponse)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse DEFAULT_INSTANCE;
- static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse();
- }
-
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstance() {
- return DEFAULT_INSTANCE;
- }
-
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
- @java.lang.Override
- public GetValidatorAddressesResponse parsePartialFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- Builder builder = newBuilder();
- try {
- builder.mergeFrom(input, extensionRegistry);
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.setUnfinishedMessage(builder.buildPartial());
- } catch (com.google.protobuf.UninitializedMessageException e) {
- throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
- } catch (java.io.IOException e) {
- throw new com.google.protobuf.InvalidProtocolBufferException(e)
- .setUnfinishedMessage(builder.buildPartial());
- }
- return builder.buildPartial();
- }
- };
-
- public static com.google.protobuf.Parser parser() {
- return PARSER;
- }
-
- @java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
- return PARSER;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstanceForType() {
- return DEFAULT_INSTANCE;
- }
-
- }
-
- public interface GetValidatorRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorRequest)
- com.google.protobuf.MessageOrBuilder {
-
- /**
- * string address = 1 [json_name = "address"];
- * @return The address.
- */
- java.lang.String getAddress();
- /**
- * string address = 1 [json_name = "address"];
- * @return The bytes for address.
- */
- com.google.protobuf.ByteString
- getAddressBytes();
- }
- /**
- * Protobuf type {@code pactus.GetValidatorRequest}
- */
- public static final class GetValidatorRequest extends
- com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorRequest)
- GetValidatorRequestOrBuilder {
- private static final long serialVersionUID = 0L;
- // Use GetValidatorRequest.newBuilder() to construct.
- private GetValidatorRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
- super(builder);
- }
- private GetValidatorRequest() {
- address_ = "";
- }
-
- @java.lang.Override
- @SuppressWarnings({"unused"})
- protected java.lang.Object newInstance(
- UnusedPrivateParameter unused) {
- return new GetValidatorRequest();
- }
-
- @java.lang.Override
- public final com.google.protobuf.UnknownFieldSet
- getUnknownFields() {
- return this.unknownFields;
- }
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.Builder.class);
- }
-
- public static final int ADDRESS_FIELD_NUMBER = 1;
- private volatile java.lang.Object address_;
- /**
- * string address = 1 [json_name = "address"];
- * @return The address.
- */
- @java.lang.Override
- public java.lang.String getAddress() {
- java.lang.Object ref = address_;
- if (ref instanceof java.lang.String) {
- return (java.lang.String) ref;
- } else {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- address_ = s;
- return s;
- }
- }
- /**
- * string address = 1 [json_name = "address"];
- * @return The bytes for address.
- */
- @java.lang.Override
- public com.google.protobuf.ByteString
- getAddressBytes() {
- java.lang.Object ref = address_;
- if (ref instanceof java.lang.String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- address_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
- }
-
- private byte memoizedIsInitialized = -1;
- @java.lang.Override
- public final boolean isInitialized() {
- byte isInitialized = memoizedIsInitialized;
- if (isInitialized == 1) return true;
- if (isInitialized == 0) return false;
-
- memoizedIsInitialized = 1;
- return true;
- }
-
- @java.lang.Override
- public void writeTo(com.google.protobuf.CodedOutputStream output)
- throws java.io.IOException {
- if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) {
- com.google.protobuf.GeneratedMessageV3.writeString(output, 1, address_);
- }
- getUnknownFields().writeTo(output);
- }
-
- @java.lang.Override
- public int getSerializedSize() {
- int size = memoizedSize;
- if (size != -1) return size;
-
- size = 0;
- if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) {
- size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_);
- }
- size += getUnknownFields().getSerializedSize();
- memoizedSize = size;
- return size;
- }
-
- @java.lang.Override
- public boolean equals(final java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorRequest)) {
- return super.equals(obj);
- }
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorRequest) obj;
-
- if (!getAddress()
- .equals(other.getAddress())) return false;
- if (!getUnknownFields().equals(other.getUnknownFields())) return false;
- return true;
- }
-
- @java.lang.Override
- public int hashCode() {
- if (memoizedHashCode != 0) {
- return memoizedHashCode;
- }
- int hash = 41;
- hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
- hash = (53 * hash) + getAddress().hashCode();
- hash = (29 * hash) + getUnknownFields().hashCode();
- memoizedHashCode = hash;
- return hash;
- }
-
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- java.nio.ByteBuffer data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- java.nio.ByteBuffer data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- com.google.protobuf.ByteString data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- com.google.protobuf.ByteString data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(byte[] data)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- byte[] data,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws com.google.protobuf.InvalidProtocolBufferException {
- return PARSER.parseFrom(data, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseDelimitedFrom(java.io.InputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseDelimitedFrom(
- java.io.InputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- com.google.protobuf.CodedInputStream input)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input);
- }
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- return com.google.protobuf.GeneratedMessageV3
- .parseWithIOException(PARSER, input, extensionRegistry);
- }
-
- @java.lang.Override
- public Builder newBuilderForType() { return newBuilder(); }
- public static Builder newBuilder() {
- return DEFAULT_INSTANCE.toBuilder();
- }
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorRequest prototype) {
- return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
- }
- @java.lang.Override
- public Builder toBuilder() {
- return this == DEFAULT_INSTANCE
- ? new Builder() : new Builder().mergeFrom(this);
- }
-
- @java.lang.Override
- protected Builder newBuilderForType(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- Builder builder = new Builder(parent);
- return builder;
- }
- /**
- * Protobuf type {@code pactus.GetValidatorRequest}
- */
- public static final class Builder extends
- com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorRequest)
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequestOrBuilder {
- public static final com.google.protobuf.Descriptors.Descriptor
- getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
- }
-
- @java.lang.Override
- protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_fieldAccessorTable
- .ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.Builder.class);
- }
-
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.newBuilder()
- private Builder() {
-
- }
-
- private Builder(
- com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
- super(parent);
-
- }
- @java.lang.Override
- public Builder clear() {
- super.clear();
- address_ = "";
-
- return this;
- }
-
- @java.lang.Override
- public com.google.protobuf.Descriptors.Descriptor
- getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.getDefaultInstance();
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequest result = buildPartial();
- if (!result.isInitialized()) {
- throw newUninitializedMessageException(result);
- }
- return result;
- }
-
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorRequest(this);
- result.address_ = address_;
- onBuilt();
- return result;
- }
-
- @java.lang.Override
- public Builder clone() {
- return super.clone();
- }
- @java.lang.Override
- public Builder setField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.setField(field, value);
- }
- @java.lang.Override
- public Builder clearField(
- com.google.protobuf.Descriptors.FieldDescriptor field) {
- return super.clearField(field);
- }
- @java.lang.Override
- public Builder clearOneof(
- com.google.protobuf.Descriptors.OneofDescriptor oneof) {
- return super.clearOneof(oneof);
- }
- @java.lang.Override
- public Builder setRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- int index, java.lang.Object value) {
- return super.setRepeatedField(field, index, value);
- }
- @java.lang.Override
- public Builder addRepeatedField(
- com.google.protobuf.Descriptors.FieldDescriptor field,
- java.lang.Object value) {
- return super.addRepeatedField(field, value);
- }
- @java.lang.Override
- public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorRequest) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorRequest)other);
- } else {
- super.mergeFrom(other);
- return this;
- }
- }
-
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorRequest other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.getDefaultInstance()) return this;
- if (!other.getAddress().isEmpty()) {
- address_ = other.address_;
- onChanged();
- }
- this.mergeUnknownFields(other.getUnknownFields());
- onChanged();
- return this;
- }
-
- @java.lang.Override
- public final boolean isInitialized() {
- return true;
- }
-
- @java.lang.Override
- public Builder mergeFrom(
- com.google.protobuf.CodedInputStream input,
- com.google.protobuf.ExtensionRegistryLite extensionRegistry)
- throws java.io.IOException {
- if (extensionRegistry == null) {
- throw new java.lang.NullPointerException();
- }
- try {
- boolean done = false;
- while (!done) {
- int tag = input.readTag();
- switch (tag) {
- case 0:
- done = true;
- break;
- case 10: {
- address_ = input.readStringRequireUtf8();
+ private int bitField0_;
- break;
- } // case 10
- default: {
- if (!super.parseUnknownField(input, extensionRegistry, tag)) {
- done = true; // was an endgroup tag
- }
- break;
- } // default:
- } // switch (tag)
- } // while (!done)
- } catch (com.google.protobuf.InvalidProtocolBufferException e) {
- throw e.unwrapIOException();
- } finally {
- onChanged();
- } // finally
- return this;
+ private com.google.protobuf.LazyStringList addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ private void ensureAddressesIsMutable() {
+ if (!((bitField0_ & 0x00000001) != 0)) {
+ addresses_ = new com.google.protobuf.LazyStringArrayList(addresses_);
+ bitField0_ |= 0x00000001;
+ }
}
-
- private java.lang.Object address_ = "";
/**
- * string address = 1 [json_name = "address"];
- * @return The address.
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return A list containing the addresses.
*/
- public java.lang.String getAddress() {
- java.lang.Object ref = address_;
- if (!(ref instanceof java.lang.String)) {
- com.google.protobuf.ByteString bs =
- (com.google.protobuf.ByteString) ref;
- java.lang.String s = bs.toStringUtf8();
- address_ = s;
- return s;
- } else {
- return (java.lang.String) ref;
- }
+ public com.google.protobuf.ProtocolStringList
+ getAddressesList() {
+ return addresses_.getUnmodifiableView();
}
/**
- * string address = 1 [json_name = "address"];
- * @return The bytes for address.
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @return The count of addresses.
+ */
+ public int getAddressesCount() {
+ return addresses_.size();
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the element to return.
+ * @return The addresses at the given index.
+ */
+ public java.lang.String getAddresses(int index) {
+ return addresses_.get(index);
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index of the value to return.
+ * @return The bytes of the addresses at the given index.
*/
public com.google.protobuf.ByteString
- getAddressBytes() {
- java.lang.Object ref = address_;
- if (ref instanceof String) {
- com.google.protobuf.ByteString b =
- com.google.protobuf.ByteString.copyFromUtf8(
- (java.lang.String) ref);
- address_ = b;
- return b;
- } else {
- return (com.google.protobuf.ByteString) ref;
- }
+ getAddressesBytes(int index) {
+ return addresses_.getByteString(index);
}
/**
- * string address = 1 [json_name = "address"];
- * @param value The address to set.
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param index The index to set the value at.
+ * @param value The addresses to set.
* @return This builder for chaining.
*/
- public Builder setAddress(
+ public Builder setAddresses(
+ int index, java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ ensureAddressesIsMutable();
+ addresses_.set(index, value);
+ onChanged();
+ return this;
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param value The addresses to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAddresses(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
-
- address_ = value;
+ ensureAddressesIsMutable();
+ addresses_.add(value);
onChanged();
return this;
}
/**
- * string address = 1 [json_name = "address"];
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param values The addresses to add.
* @return This builder for chaining.
*/
- public Builder clearAddress() {
-
- address_ = getDefaultInstance().getAddress();
+ public Builder addAllAddresses(
+ java.lang.Iterable values) {
+ ensureAddressesIsMutable();
+ com.google.protobuf.AbstractMessageLite.Builder.addAll(
+ values, addresses_);
onChanged();
return this;
}
/**
- * string address = 1 [json_name = "address"];
- * @param value The bytes for address to set.
+ * repeated string addresses = 1 [json_name = "addresses"];
* @return This builder for chaining.
*/
- public Builder setAddressBytes(
+ public Builder clearAddresses() {
+ addresses_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ bitField0_ = (bitField0_ & ~0x00000001);
+ onChanged();
+ return this;
+ }
+ /**
+ * repeated string addresses = 1 [json_name = "addresses"];
+ * @param value The bytes of the addresses to add.
+ * @return This builder for chaining.
+ */
+ public Builder addAddressesBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
-
- address_ = value;
+ ensureAddressesIsMutable();
+ addresses_.add(value);
onChanged();
return this;
}
@@ -3784,23 +2835,23 @@ public final Builder mergeUnknownFields(
}
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorRequest)
+ // @@protoc_insertion_point(builder_scope:pactus.GetValidatorAddressesResponse)
}
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorRequest)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorRequest DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:pactus.GetValidatorAddressesResponse)
+ private static final pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorRequest();
+ DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse();
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstance() {
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
- public GetValidatorRequest parsePartialFrom(
+ public GetValidatorAddressesResponse parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
@@ -3819,52 +2870,59 @@ public GetValidatorRequest parsePartialFrom(
}
};
- public static com.google.protobuf.Parser parser() {
+ public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
+ public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstanceForType() {
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorAddressesResponse getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
- public interface GetValidatorByNumberRequestOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorByNumberRequest)
+ public interface GetValidatorRequestOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.GetValidatorRequest)
com.google.protobuf.MessageOrBuilder {
/**
- * int32 number = 1 [json_name = "number"];
- * @return The number.
+ * string address = 1 [json_name = "address"];
+ * @return The address.
*/
- int getNumber();
+ java.lang.String getAddress();
+ /**
+ * string address = 1 [json_name = "address"];
+ * @return The bytes for address.
+ */
+ com.google.protobuf.ByteString
+ getAddressBytes();
}
/**
- * Protobuf type {@code pactus.GetValidatorByNumberRequest}
+ * Protobuf type {@code pactus.GetValidatorRequest}
*/
- public static final class GetValidatorByNumberRequest extends
+ public static final class GetValidatorRequest extends
com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorByNumberRequest)
- GetValidatorByNumberRequestOrBuilder {
+ // @@protoc_insertion_point(message_implements:pactus.GetValidatorRequest)
+ GetValidatorRequestOrBuilder {
private static final long serialVersionUID = 0L;
- // Use GetValidatorByNumberRequest.newBuilder() to construct.
- private GetValidatorByNumberRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use GetValidatorRequest.newBuilder() to construct.
+ private GetValidatorRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private GetValidatorByNumberRequest() {
+ private GetValidatorRequest() {
+ address_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
- return new GetValidatorByNumberRequest();
+ return new GetValidatorRequest();
}
@java.lang.Override
@@ -3874,26 +2932,53 @@ protected java.lang.Object newInstance(
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.Builder.class);
}
- public static final int NUMBER_FIELD_NUMBER = 1;
- private int number_;
+ public static final int ADDRESS_FIELD_NUMBER = 1;
+ private volatile java.lang.Object address_;
/**
- * int32 number = 1 [json_name = "number"];
- * @return The number.
+ * string address = 1 [json_name = "address"];
+ * @return The address.
*/
@java.lang.Override
- public int getNumber() {
- return number_;
+ public java.lang.String getAddress() {
+ java.lang.Object ref = address_;
+ if (ref instanceof java.lang.String) {
+ return (java.lang.String) ref;
+ } else {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ address_ = s;
+ return s;
+ }
+ }
+ /**
+ * string address = 1 [json_name = "address"];
+ * @return The bytes for address.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString
+ getAddressBytes() {
+ java.lang.Object ref = address_;
+ if (ref instanceof java.lang.String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ address_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
}
private byte memoizedIsInitialized = -1;
@@ -3910,8 +2995,8 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
- if (number_ != 0) {
- output.writeInt32(1, number_);
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) {
+ com.google.protobuf.GeneratedMessageV3.writeString(output, 1, address_);
}
getUnknownFields().writeTo(output);
}
@@ -3922,9 +3007,8 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- if (number_ != 0) {
- size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(1, number_);
+ if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) {
+ size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
@@ -3936,13 +3020,13 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest)) {
+ if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorRequest)) {
return super.equals(obj);
}
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest) obj;
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorRequest) obj;
- if (getNumber()
- != other.getNumber()) return false;
+ if (!getAddress()
+ .equals(other.getAddress())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -3954,76 +3038,76 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
- hash = (37 * hash) + NUMBER_FIELD_NUMBER;
- hash = (53 * hash) + getNumber();
+ hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
+ hash = (53 * hash) + getAddress().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(byte[] data)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseDelimitedFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseDelimitedFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -4036,7 +3120,7 @@ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest prototype) {
+ public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
@@ -4052,26 +3136,26 @@ protected Builder newBuilderForType(
return builder;
}
/**
- * Protobuf type {@code pactus.GetValidatorByNumberRequest}
+ * Protobuf type {@code pactus.GetValidatorRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorByNumberRequest)
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequestOrBuilder {
+ // @@protoc_insertion_point(builder_implements:pactus.GetValidatorRequest)
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.Builder.class);
}
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.newBuilder()
+ // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.newBuilder()
private Builder() {
}
@@ -4084,7 +3168,7 @@ private Builder(
@java.lang.Override
public Builder clear() {
super.clear();
- number_ = 0;
+ address_ = "";
return this;
}
@@ -4092,17 +3176,17 @@ public Builder clear() {
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorRequest_descriptor;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.getDefaultInstance();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstanceForType() {
+ return pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.getDefaultInstance();
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest result = buildPartial();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest build() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -4110,9 +3194,9 @@ public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest build(
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest(this);
- result.number_ = number_;
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest buildPartial() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorRequest(this);
+ result.address_ = address_;
onBuilt();
return result;
}
@@ -4151,18 +3235,19 @@ public Builder addRepeatedField(
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest)other);
+ if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorRequest) {
+ return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.getDefaultInstance()) return this;
- if (other.getNumber() != 0) {
- setNumber(other.getNumber());
+ public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorRequest other) {
+ if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorRequest.getDefaultInstance()) return this;
+ if (!other.getAddress().isEmpty()) {
+ address_ = other.address_;
+ onChanged();
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
@@ -4190,11 +3275,11 @@ public Builder mergeFrom(
case 0:
done = true;
break;
- case 8: {
- number_ = input.readInt32();
+ case 10: {
+ address_ = input.readStringRequireUtf8();
break;
- } // case 8
+ } // case 10
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -4211,33 +3296,78 @@ public Builder mergeFrom(
return this;
}
- private int number_ ;
+ private java.lang.Object address_ = "";
/**
- * int32 number = 1 [json_name = "number"];
- * @return The number.
+ * string address = 1 [json_name = "address"];
+ * @return The address.
*/
- @java.lang.Override
- public int getNumber() {
- return number_;
+ public java.lang.String getAddress() {
+ java.lang.Object ref = address_;
+ if (!(ref instanceof java.lang.String)) {
+ com.google.protobuf.ByteString bs =
+ (com.google.protobuf.ByteString) ref;
+ java.lang.String s = bs.toStringUtf8();
+ address_ = s;
+ return s;
+ } else {
+ return (java.lang.String) ref;
+ }
}
/**
- * int32 number = 1 [json_name = "number"];
- * @param value The number to set.
+ * string address = 1 [json_name = "address"];
+ * @return The bytes for address.
+ */
+ public com.google.protobuf.ByteString
+ getAddressBytes() {
+ java.lang.Object ref = address_;
+ if (ref instanceof String) {
+ com.google.protobuf.ByteString b =
+ com.google.protobuf.ByteString.copyFromUtf8(
+ (java.lang.String) ref);
+ address_ = b;
+ return b;
+ } else {
+ return (com.google.protobuf.ByteString) ref;
+ }
+ }
+ /**
+ * string address = 1 [json_name = "address"];
+ * @param value The address to set.
* @return This builder for chaining.
*/
- public Builder setNumber(int value) {
+ public Builder setAddress(
+ java.lang.String value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ address_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * string address = 1 [json_name = "address"];
+ * @return This builder for chaining.
+ */
+ public Builder clearAddress() {
- number_ = value;
+ address_ = getDefaultInstance().getAddress();
onChanged();
return this;
}
/**
- * int32 number = 1 [json_name = "number"];
+ * string address = 1 [json_name = "address"];
+ * @param value The bytes for address to set.
* @return This builder for chaining.
*/
- public Builder clearNumber() {
+ public Builder setAddressBytes(
+ com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+ checkByteStringIsUtf8(value);
- number_ = 0;
+ address_ = value;
onChanged();
return this;
}
@@ -4254,23 +3384,23 @@ public final Builder mergeUnknownFields(
}
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorByNumberRequest)
+ // @@protoc_insertion_point(builder_scope:pactus.GetValidatorRequest)
}
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorByNumberRequest)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:pactus.GetValidatorRequest)
+ private static final pactus.blockchain.BlockchainOuterClass.GetValidatorRequest DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest();
+ DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorRequest();
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstance() {
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
- public GetValidatorByNumberRequest parsePartialFrom(
+ public GetValidatorRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
@@ -4289,71 +3419,52 @@ public GetValidatorByNumberRequest parsePartialFrom(
}
};
- public static com.google.protobuf.Parser parser() {
+ public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
+ public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstanceForType() {
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
- public interface GetValidatorsResponseOrBuilder extends
- // @@protoc_insertion_point(interface_extends:pactus.GetValidatorsResponse)
+ public interface GetValidatorByNumberRequestOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.GetValidatorByNumberRequest)
com.google.protobuf.MessageOrBuilder {
/**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- java.util.List
- getValidatorsList();
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo getValidators(int index);
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- int getValidatorsCount();
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- java.util.List extends pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder>
- getValidatorsOrBuilderList();
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
+ * int32 number = 1 [json_name = "number"];
+ * @return The number.
*/
- pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder getValidatorsOrBuilder(
- int index);
+ int getNumber();
}
/**
- * Protobuf type {@code pactus.GetValidatorsResponse}
+ * Protobuf type {@code pactus.GetValidatorByNumberRequest}
*/
- public static final class GetValidatorsResponse extends
+ public static final class GetValidatorByNumberRequest extends
com.google.protobuf.GeneratedMessageV3 implements
- // @@protoc_insertion_point(message_implements:pactus.GetValidatorsResponse)
- GetValidatorsResponseOrBuilder {
+ // @@protoc_insertion_point(message_implements:pactus.GetValidatorByNumberRequest)
+ GetValidatorByNumberRequestOrBuilder {
private static final long serialVersionUID = 0L;
- // Use GetValidatorsResponse.newBuilder() to construct.
- private GetValidatorsResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ // Use GetValidatorByNumberRequest.newBuilder() to construct.
+ private GetValidatorByNumberRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
- private GetValidatorsResponse() {
- validators_ = java.util.Collections.emptyList();
+ private GetValidatorByNumberRequest() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
- return new GetValidatorsResponse();
+ return new GetValidatorByNumberRequest();
}
@java.lang.Override
@@ -4363,55 +3474,26 @@ protected java.lang.Object newInstance(
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsResponse_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsResponse_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.Builder.class);
}
- public static final int VALIDATORS_FIELD_NUMBER = 1;
- private java.util.List validators_;
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- @java.lang.Override
- public java.util.List getValidatorsList() {
- return validators_;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- @java.lang.Override
- public java.util.List extends pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder>
- getValidatorsOrBuilderList() {
- return validators_;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- @java.lang.Override
- public int getValidatorsCount() {
- return validators_.size();
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- @java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfo getValidators(int index) {
- return validators_.get(index);
- }
+ public static final int NUMBER_FIELD_NUMBER = 1;
+ private int number_;
/**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
+ * int32 number = 1 [json_name = "number"];
+ * @return The number.
*/
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder getValidatorsOrBuilder(
- int index) {
- return validators_.get(index);
+ public int getNumber() {
+ return number_;
}
private byte memoizedIsInitialized = -1;
@@ -4428,8 +3510,8 @@ public final boolean isInitialized() {
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
- for (int i = 0; i < validators_.size(); i++) {
- output.writeMessage(1, validators_.get(i));
+ if (number_ != 0) {
+ output.writeInt32(1, number_);
}
getUnknownFields().writeTo(output);
}
@@ -4440,9 +3522,9 @@ public int getSerializedSize() {
if (size != -1) return size;
size = 0;
- for (int i = 0; i < validators_.size(); i++) {
+ if (number_ != 0) {
size += com.google.protobuf.CodedOutputStream
- .computeMessageSize(1, validators_.get(i));
+ .computeInt32Size(1, number_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
@@ -4454,13 +3536,13 @@ public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
- if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse)) {
+ if (!(obj instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest)) {
return super.equals(obj);
}
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse other = (pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse) obj;
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest other = (pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest) obj;
- if (!getValidatorsList()
- .equals(other.getValidatorsList())) return false;
+ if (getNumber()
+ != other.getNumber()) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -4472,78 +3554,76 @@ public int hashCode() {
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
- if (getValidatorsCount() > 0) {
- hash = (37 * hash) + VALIDATORS_FIELD_NUMBER;
- hash = (53 * hash) + getValidatorsList().hashCode();
- }
+ hash = (37 * hash) + NUMBER_FIELD_NUMBER;
+ hash = (53 * hash) + getNumber();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(byte[] data)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseDelimitedFrom(java.io.InputStream input)
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseDelimitedFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parseFrom(
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
@@ -4556,7 +3636,7 @@ public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse parse
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
- public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse prototype) {
+ public static Builder newBuilder(pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
@@ -4572,26 +3652,26 @@ protected Builder newBuilderForType(
return builder;
}
/**
- * Protobuf type {@code pactus.GetValidatorsResponse}
+ * Protobuf type {@code pactus.GetValidatorByNumberRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
- // @@protoc_insertion_point(builder_implements:pactus.GetValidatorsResponse)
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponseOrBuilder {
+ // @@protoc_insertion_point(builder_implements:pactus.GetValidatorByNumberRequest)
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsResponse_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsResponse_fieldAccessorTable
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.class, pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.Builder.class);
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.class, pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.Builder.class);
}
- // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.newBuilder()
+ // Construct using pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.newBuilder()
private Builder() {
}
@@ -4603,31 +3683,26 @@ private Builder(
}
@java.lang.Override
public Builder clear() {
- super.clear();
- if (validatorsBuilder_ == null) {
- validators_ = java.util.Collections.emptyList();
- } else {
- validators_ = null;
- validatorsBuilder_.clear();
- }
- bitField0_ = (bitField0_ & ~0x00000001);
+ super.clear();
+ number_ = 0;
+
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
- return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorsResponse_descriptor;
+ return pactus.blockchain.BlockchainOuterClass.internal_static_pactus_GetValidatorByNumberRequest_descriptor;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse getDefaultInstanceForType() {
- return pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.getDefaultInstance();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstanceForType() {
+ return pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.getDefaultInstance();
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse build() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse result = buildPartial();
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest build() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
@@ -4635,18 +3710,9 @@ public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse build() {
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse buildPartial() {
- pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse result = new pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse(this);
- int from_bitField0_ = bitField0_;
- if (validatorsBuilder_ == null) {
- if (((bitField0_ & 0x00000001) != 0)) {
- validators_ = java.util.Collections.unmodifiableList(validators_);
- bitField0_ = (bitField0_ & ~0x00000001);
- }
- result.validators_ = validators_;
- } else {
- result.validators_ = validatorsBuilder_.build();
- }
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest buildPartial() {
+ pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest result = new pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest(this);
+ result.number_ = number_;
onBuilt();
return result;
}
@@ -4685,41 +3751,18 @@ public Builder addRepeatedField(
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
- if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse) {
- return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse)other);
+ if (other instanceof pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest) {
+ return mergeFrom((pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
- public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse other) {
- if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse.getDefaultInstance()) return this;
- if (validatorsBuilder_ == null) {
- if (!other.validators_.isEmpty()) {
- if (validators_.isEmpty()) {
- validators_ = other.validators_;
- bitField0_ = (bitField0_ & ~0x00000001);
- } else {
- ensureValidatorsIsMutable();
- validators_.addAll(other.validators_);
- }
- onChanged();
- }
- } else {
- if (!other.validators_.isEmpty()) {
- if (validatorsBuilder_.isEmpty()) {
- validatorsBuilder_.dispose();
- validatorsBuilder_ = null;
- validators_ = other.validators_;
- bitField0_ = (bitField0_ & ~0x00000001);
- validatorsBuilder_ =
- com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
- getValidatorsFieldBuilder() : null;
- } else {
- validatorsBuilder_.addAllMessages(other.validators_);
- }
- }
+ public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest other) {
+ if (other == pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest.getDefaultInstance()) return this;
+ if (other.getNumber() != 0) {
+ setNumber(other.getNumber());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
@@ -4747,19 +3790,11 @@ public Builder mergeFrom(
case 0:
done = true;
break;
- case 10: {
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo m =
- input.readMessage(
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo.parser(),
- extensionRegistry);
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- validators_.add(m);
- } else {
- validatorsBuilder_.addMessage(m);
- }
+ case 8: {
+ number_ = input.readInt32();
+
break;
- } // case 10
+ } // case 8
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -4775,247 +3810,37 @@ public Builder mergeFrom(
} // finally
return this;
}
- private int bitField0_;
-
- private java.util.List validators_ =
- java.util.Collections.emptyList();
- private void ensureValidatorsIsMutable() {
- if (!((bitField0_ & 0x00000001) != 0)) {
- validators_ = new java.util.ArrayList(validators_);
- bitField0_ |= 0x00000001;
- }
- }
-
- private com.google.protobuf.RepeatedFieldBuilderV3<
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder, pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder> validatorsBuilder_;
+ private int number_ ;
/**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public java.util.List getValidatorsList() {
- if (validatorsBuilder_ == null) {
- return java.util.Collections.unmodifiableList(validators_);
- } else {
- return validatorsBuilder_.getMessageList();
- }
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public int getValidatorsCount() {
- if (validatorsBuilder_ == null) {
- return validators_.size();
- } else {
- return validatorsBuilder_.getCount();
- }
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfo getValidators(int index) {
- if (validatorsBuilder_ == null) {
- return validators_.get(index);
- } else {
- return validatorsBuilder_.getMessage(index);
- }
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder setValidators(
- int index, pactus.blockchain.BlockchainOuterClass.ValidatorInfo value) {
- if (validatorsBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureValidatorsIsMutable();
- validators_.set(index, value);
- onChanged();
- } else {
- validatorsBuilder_.setMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder setValidators(
- int index, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder builderForValue) {
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- validators_.set(index, builderForValue.build());
- onChanged();
- } else {
- validatorsBuilder_.setMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder addValidators(pactus.blockchain.BlockchainOuterClass.ValidatorInfo value) {
- if (validatorsBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureValidatorsIsMutable();
- validators_.add(value);
- onChanged();
- } else {
- validatorsBuilder_.addMessage(value);
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder addValidators(
- int index, pactus.blockchain.BlockchainOuterClass.ValidatorInfo value) {
- if (validatorsBuilder_ == null) {
- if (value == null) {
- throw new NullPointerException();
- }
- ensureValidatorsIsMutable();
- validators_.add(index, value);
- onChanged();
- } else {
- validatorsBuilder_.addMessage(index, value);
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder addValidators(
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder builderForValue) {
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- validators_.add(builderForValue.build());
- onChanged();
- } else {
- validatorsBuilder_.addMessage(builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public Builder addValidators(
- int index, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder builderForValue) {
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- validators_.add(index, builderForValue.build());
- onChanged();
- } else {
- validatorsBuilder_.addMessage(index, builderForValue.build());
- }
- return this;
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
+ * int32 number = 1 [json_name = "number"];
+ * @return The number.
*/
- public Builder addAllValidators(
- java.lang.Iterable extends pactus.blockchain.BlockchainOuterClass.ValidatorInfo> values) {
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- com.google.protobuf.AbstractMessageLite.Builder.addAll(
- values, validators_);
- onChanged();
- } else {
- validatorsBuilder_.addAllMessages(values);
- }
- return this;
+ @java.lang.Override
+ public int getNumber() {
+ return number_;
}
/**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
+ * int32 number = 1 [json_name = "number"];
+ * @param value The number to set.
+ * @return This builder for chaining.
*/
- public Builder clearValidators() {
- if (validatorsBuilder_ == null) {
- validators_ = java.util.Collections.emptyList();
- bitField0_ = (bitField0_ & ~0x00000001);
- onChanged();
- } else {
- validatorsBuilder_.clear();
- }
+ public Builder setNumber(int value) {
+
+ number_ = value;
+ onChanged();
return this;
}
/**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
+ * int32 number = 1 [json_name = "number"];
+ * @return This builder for chaining.
*/
- public Builder removeValidators(int index) {
- if (validatorsBuilder_ == null) {
- ensureValidatorsIsMutable();
- validators_.remove(index);
- onChanged();
- } else {
- validatorsBuilder_.remove(index);
- }
+ public Builder clearNumber() {
+
+ number_ = 0;
+ onChanged();
return this;
}
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder getValidatorsBuilder(
- int index) {
- return getValidatorsFieldBuilder().getBuilder(index);
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder getValidatorsOrBuilder(
- int index) {
- if (validatorsBuilder_ == null) {
- return validators_.get(index); } else {
- return validatorsBuilder_.getMessageOrBuilder(index);
- }
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public java.util.List extends pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder>
- getValidatorsOrBuilderList() {
- if (validatorsBuilder_ != null) {
- return validatorsBuilder_.getMessageOrBuilderList();
- } else {
- return java.util.Collections.unmodifiableList(validators_);
- }
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder addValidatorsBuilder() {
- return getValidatorsFieldBuilder().addBuilder(
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo.getDefaultInstance());
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder addValidatorsBuilder(
- int index) {
- return getValidatorsFieldBuilder().addBuilder(
- index, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.getDefaultInstance());
- }
- /**
- * repeated .pactus.ValidatorInfo validators = 1 [json_name = "validators"];
- */
- public java.util.List
- getValidatorsBuilderList() {
- return getValidatorsFieldBuilder().getBuilderList();
- }
- private com.google.protobuf.RepeatedFieldBuilderV3<
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder, pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder>
- getValidatorsFieldBuilder() {
- if (validatorsBuilder_ == null) {
- validatorsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
- pactus.blockchain.BlockchainOuterClass.ValidatorInfo, pactus.blockchain.BlockchainOuterClass.ValidatorInfo.Builder, pactus.blockchain.BlockchainOuterClass.ValidatorInfoOrBuilder>(
- validators_,
- ((bitField0_ & 0x00000001) != 0),
- getParentForChildren(),
- isClean());
- validators_ = null;
- }
- return validatorsBuilder_;
- }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -5029,23 +3854,23 @@ public final Builder mergeUnknownFields(
}
- // @@protoc_insertion_point(builder_scope:pactus.GetValidatorsResponse)
+ // @@protoc_insertion_point(builder_scope:pactus.GetValidatorByNumberRequest)
}
- // @@protoc_insertion_point(class_scope:pactus.GetValidatorsResponse)
- private static final pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse DEFAULT_INSTANCE;
+ // @@protoc_insertion_point(class_scope:pactus.GetValidatorByNumberRequest)
+ private static final pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest DEFAULT_INSTANCE;
static {
- DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse();
+ DEFAULT_INSTANCE = new pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest();
}
- public static pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse getDefaultInstance() {
+ public static pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
- private static final com.google.protobuf.Parser
- PARSER = new com.google.protobuf.AbstractParser() {
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
- public GetValidatorsResponse parsePartialFrom(
+ public GetValidatorByNumberRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
@@ -5064,17 +3889,17 @@ public GetValidatorsResponse parsePartialFrom(
}
};
- public static com.google.protobuf.Parser parser() {
+ public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
- public com.google.protobuf.Parser getParserForType() {
+ public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
- public pactus.blockchain.BlockchainOuterClass.GetValidatorsResponse getDefaultInstanceForType() {
+ public pactus.blockchain.BlockchainOuterClass.GetValidatorByNumberRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
@@ -12427,10 +11252,10 @@ public interface ValidatorInfoOrBuilder extends
int getLastBondingHeight();
/**
- * uint32 last_joined_height = 8 [json_name = "lastJoinedHeight"];
- * @return The lastJoinedHeight.
+ * uint32 last_sortition_height = 8 [json_name = "lastSortitionHeight"];
+ * @return The lastSortitionHeight.
*/
- int getLastJoinedHeight();
+ int getLastSortitionHeight();
/**
* uint32 unbonding_height = 9 [json_name = "unbondingHeight"];
@@ -12598,15 +11423,15 @@ public int getLastBondingHeight() {
return lastBondingHeight_;
}
- public static final int LAST_JOINED_HEIGHT_FIELD_NUMBER = 8;
- private int lastJoinedHeight_;
+ public static final int LAST_SORTITION_HEIGHT_FIELD_NUMBER = 8;
+ private int lastSortitionHeight_;
/**
- * uint32 last_joined_height = 8 [json_name = "lastJoinedHeight"];
- * @return The lastJoinedHeight.
+ * uint32 last_sortition_height = 8 [json_name = "lastSortitionHeight"];
+ * @return The lastSortitionHeight.
*/
@java.lang.Override
- public int getLastJoinedHeight() {
- return lastJoinedHeight_;
+ public int getLastSortitionHeight() {
+ return lastSortitionHeight_;
}
public static final int UNBONDING_HEIGHT_FIELD_NUMBER = 9;
@@ -12693,8 +11518,8 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (lastBondingHeight_ != 0) {
output.writeUInt32(7, lastBondingHeight_);
}
- if (lastJoinedHeight_ != 0) {
- output.writeUInt32(8, lastJoinedHeight_);
+ if (lastSortitionHeight_ != 0) {
+ output.writeUInt32(8, lastSortitionHeight_);
}
if (unbondingHeight_ != 0) {
output.writeUInt32(9, unbondingHeight_);
@@ -12738,9 +11563,9 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(7, lastBondingHeight_);
}
- if (lastJoinedHeight_ != 0) {
+ if (lastSortitionHeight_ != 0) {
size += com.google.protobuf.CodedOutputStream
- .computeUInt32Size(8, lastJoinedHeight_);
+ .computeUInt32Size(8, lastSortitionHeight_);
}
if (unbondingHeight_ != 0) {
size += com.google.protobuf.CodedOutputStream
@@ -12778,8 +11603,8 @@ public boolean equals(final java.lang.Object obj) {
!= other.getStake()) return false;
if (getLastBondingHeight()
!= other.getLastBondingHeight()) return false;
- if (getLastJoinedHeight()
- != other.getLastJoinedHeight()) return false;
+ if (getLastSortitionHeight()
+ != other.getLastSortitionHeight()) return false;
if (getUnbondingHeight()
!= other.getUnbondingHeight()) return false;
if (!getAddress()
@@ -12810,8 +11635,8 @@ public int hashCode() {
getStake());
hash = (37 * hash) + LAST_BONDING_HEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getLastBondingHeight();
- hash = (37 * hash) + LAST_JOINED_HEIGHT_FIELD_NUMBER;
- hash = (53 * hash) + getLastJoinedHeight();
+ hash = (37 * hash) + LAST_SORTITION_HEIGHT_FIELD_NUMBER;
+ hash = (53 * hash) + getLastSortitionHeight();
hash = (37 * hash) + UNBONDING_HEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getUnbondingHeight();
hash = (37 * hash) + ADDRESS_FIELD_NUMBER;
@@ -12958,7 +11783,7 @@ public Builder clear() {
lastBondingHeight_ = 0;
- lastJoinedHeight_ = 0;
+ lastSortitionHeight_ = 0;
unbondingHeight_ = 0;
@@ -12997,7 +11822,7 @@ public pactus.blockchain.BlockchainOuterClass.ValidatorInfo buildPartial() {
result.sequence_ = sequence_;
result.stake_ = stake_;
result.lastBondingHeight_ = lastBondingHeight_;
- result.lastJoinedHeight_ = lastJoinedHeight_;
+ result.lastSortitionHeight_ = lastSortitionHeight_;
result.unbondingHeight_ = unbondingHeight_;
result.address_ = address_;
onBuilt();
@@ -13070,8 +11895,8 @@ public Builder mergeFrom(pactus.blockchain.BlockchainOuterClass.ValidatorInfo ot
if (other.getLastBondingHeight() != 0) {
setLastBondingHeight(other.getLastBondingHeight());
}
- if (other.getLastJoinedHeight() != 0) {
- setLastJoinedHeight(other.getLastJoinedHeight());
+ if (other.getLastSortitionHeight() != 0) {
+ setLastSortitionHeight(other.getLastSortitionHeight());
}
if (other.getUnbondingHeight() != 0) {
setUnbondingHeight(other.getUnbondingHeight());
@@ -13142,7 +11967,7 @@ public Builder mergeFrom(
break;
} // case 56
case 64: {
- lastJoinedHeight_ = input.readUInt32();
+ lastSortitionHeight_ = input.readUInt32();
break;
} // case 64
@@ -13440,33 +12265,33 @@ public Builder clearLastBondingHeight() {
return this;
}
- private int lastJoinedHeight_ ;
+ private int lastSortitionHeight_ ;
/**
- * uint32 last_joined_height = 8 [json_name = "lastJoinedHeight"];
- * @return The lastJoinedHeight.
+ * uint32 last_sortition_height = 8 [json_name = "lastSortitionHeight"];
+ * @return The lastSortitionHeight.
*/
@java.lang.Override
- public int getLastJoinedHeight() {
- return lastJoinedHeight_;
+ public int getLastSortitionHeight() {
+ return lastSortitionHeight_;
}
/**
- * uint32 last_joined_height = 8 [json_name = "lastJoinedHeight"];
- * @param value The lastJoinedHeight to set.
+ * uint32 last_sortition_height = 8 [json_name = "lastSortitionHeight"];
+ * @param value The lastSortitionHeight to set.
* @return This builder for chaining.
*/
- public Builder setLastJoinedHeight(int value) {
+ public Builder setLastSortitionHeight(int value) {
- lastJoinedHeight_ = value;
+ lastSortitionHeight_ = value;
onChanged();
return this;
}
/**
- * uint32 last_joined_height = 8 [json_name = "lastJoinedHeight"];
+ * uint32 last_sortition_height = 8 [json_name = "lastSortitionHeight"];
* @return This builder for chaining.
*/
- public Builder clearLastJoinedHeight() {
+ public Builder clearLastSortitionHeight() {
- lastJoinedHeight_ = 0;
+ lastSortitionHeight_ = 0;
onChanged();
return this;
}
@@ -18181,11 +17006,6 @@ public pactus.blockchain.BlockchainOuterClass.ConsensusInfo getDefaultInstanceFo
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_pactus_GetAccountResponse_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_pactus_GetValidatorsRequest_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_pactus_GetValidatorsRequest_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_pactus_GetValidatorAddressesRequest_descriptor;
private static final
@@ -18206,11 +17026,6 @@ public pactus.blockchain.BlockchainOuterClass.ConsensusInfo getDefaultInstanceFo
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable;
- private static final com.google.protobuf.Descriptors.Descriptor
- internal_static_pactus_GetValidatorsResponse_descriptor;
- private static final
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
- internal_static_pactus_GetValidatorsResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_pactus_GetValidatorResponse_descriptor;
private static final
@@ -18310,98 +17125,94 @@ public pactus.blockchain.BlockchainOuterClass.ConsensusInfo getDefaultInstanceFo
"\001(\tR\007address\"3\n\031GetAccountByNumberReques" +
"t\022\026\n\006number\030\001 \001(\005R\006number\"C\n\022GetAccountR" +
"esponse\022-\n\007account\030\001 \001(\0132\023.pactus.Accoun" +
- "tInfoR\007account\"\026\n\024GetValidatorsRequest\"\036" +
- "\n\034GetValidatorAddressesRequest\"=\n\035GetVal" +
- "idatorAddressesResponse\022\034\n\taddresses\030\001 \003" +
- "(\tR\taddresses\"/\n\023GetValidatorRequest\022\030\n\007" +
- "address\030\001 \001(\tR\007address\"5\n\033GetValidatorBy" +
- "NumberRequest\022\026\n\006number\030\001 \001(\005R\006number\"N\n" +
- "\025GetValidatorsResponse\0225\n\nvalidators\030\001 \003" +
- "(\0132\025.pactus.ValidatorInfoR\nvalidators\"K\n" +
- "\024GetValidatorResponse\0223\n\tvalidator\030\001 \001(\013" +
- "2\025.pactus.ValidatorInfoR\tvalidator\"_\n\017Ge" +
- "tBlockRequest\022\026\n\006height\030\001 \001(\rR\006height\0224\n" +
- "\tverbosity\030\002 \001(\0162\026.pactus.BlockVerbosity" +
- "R\tverbosity\"\203\002\n\020GetBlockResponse\022\026\n\006heig" +
- "ht\030\001 \001(\rR\006height\022\022\n\004hash\030\002 \001(\014R\004hash\022\022\n\004" +
- "data\030\003 \001(\014R\004data\022\035\n\nblock_time\030\004 \001(\rR\tbl" +
- "ockTime\022/\n\006header\030\005 \001(\0132\027.pactus.BlockHe" +
- "aderInfoR\006header\0224\n\tprev_cert\030\006 \001(\0132\027.pa" +
- "ctus.CertificateInfoR\010prevCert\022)\n\003txs\030\007 " +
- "\003(\0132\027.pactus.TransactionInfoR\003txs\"-\n\023Get" +
- "BlockHashRequest\022\026\n\006height\030\001 \001(\rR\006height" +
- "\"*\n\024GetBlockHashResponse\022\022\n\004hash\030\001 \001(\014R\004" +
- "hash\"+\n\025GetBlockHeightRequest\022\022\n\004hash\030\001 " +
- "\001(\014R\004hash\"0\n\026GetBlockHeightResponse\022\026\n\006h" +
- "eight\030\001 \001(\rR\006height\"\032\n\030GetBlockchainInfo" +
- "Request\"\325\002\n\031GetBlockchainInfoResponse\022*\n" +
- "\021last_block_height\030\001 \001(\rR\017lastBlockHeigh" +
- "t\022&\n\017last_block_hash\030\002 \001(\014R\rlastBlockHas" +
- "h\022%\n\016total_accounts\030\003 \001(\005R\rtotalAccounts" +
- "\022)\n\020total_validators\030\004 \001(\005R\017totalValidat" +
- "ors\022\037\n\013total_power\030\005 \001(\003R\ntotalPower\022\'\n\017" +
- "committee_power\030\006 \001(\003R\016committeePower\022H\n" +
- "\024committee_validators\030\007 \003(\0132\025.pactus.Val" +
- "idatorInfoR\023committeeValidators\"\031\n\027GetCo" +
- "nsensusInfoRequest\"O\n\030GetConsensusInfoRe" +
- "sponse\0223\n\tinstances\030\001 \003(\0132\025.pactus.Conse" +
- "nsusInfoR\tinstances\"\303\002\n\rValidatorInfo\022\022\n" +
- "\004hash\030\001 \001(\014R\004hash\022\022\n\004data\030\002 \001(\014R\004data\022\035\n" +
- "\npublic_key\030\003 \001(\tR\tpublicKey\022\026\n\006number\030\004" +
- " \001(\005R\006number\022\032\n\010sequence\030\005 \001(\005R\010sequence" +
- "\022\024\n\005stake\030\006 \001(\003R\005stake\022.\n\023last_bonding_h" +
- "eight\030\007 \001(\rR\021lastBondingHeight\022,\n\022last_j" +
- "oined_height\030\010 \001(\rR\020lastJoinedHeight\022)\n\020" +
- "unbonding_height\030\t \001(\rR\017unbondingHeight\022" +
- "\030\n\007address\030\n \001(\tR\007address\"\203\001\n\013AccountInf" +
- "o\022\022\n\004hash\030\001 \001(\014R\004hash\022\022\n\004data\030\002 \001(\014R\004dat" +
- "a\022\026\n\006number\030\003 \001(\005R\006number\022\032\n\010sequence\030\004 " +
- "\001(\005R\010sequence\022\030\n\007balance\030\005 \001(\003R\007balance\"" +
- "\304\001\n\017BlockHeaderInfo\022\030\n\007version\030\001 \001(\005R\007ve" +
- "rsion\022&\n\017prev_block_hash\030\002 \001(\014R\rprevBloc" +
- "kHash\022\035\n\nstate_root\030\003 \001(\014R\tstateRoot\022%\n\016" +
- "sortition_seed\030\004 \001(\014R\rsortitionSeed\022)\n\020p" +
- "roposer_address\030\005 \001(\tR\017proposerAddress\"\227" +
- "\001\n\017CertificateInfo\022\022\n\004hash\030\001 \001(\014R\004hash\022\024" +
- "\n\005round\030\002 \001(\005R\005round\022\036\n\ncommitters\030\003 \003(\005" +
- "R\ncommitters\022\034\n\tabsentees\030\004 \003(\005R\tabsente" +
- "es\022\034\n\tsignature\030\005 \001(\014R\tsignature\"{\n\010Vote" +
- "Info\022$\n\004type\030\001 \001(\0162\020.pactus.VoteTypeR\004ty" +
- "pe\022\024\n\005voter\030\002 \001(\tR\005voter\022\035\n\nblock_hash\030\003" +
- " \001(\014R\tblockHash\022\024\n\005round\030\004 \001(\005R\005round\"\227\001" +
- "\n\rConsensusInfo\022\030\n\007address\030\001 \001(\tR\007addres" +
- "s\022\026\n\006Active\030\002 \001(\010R\006Active\022\026\n\006height\030\003 \001(" +
- "\rR\006height\022\024\n\005round\030\004 \001(\005R\005round\022&\n\005votes" +
- "\030\005 \003(\0132\020.pactus.VoteInfoR\005votes*H\n\016Block" +
- "Verbosity\022\016\n\nBLOCK_DATA\020\000\022\016\n\nBLOCK_INFO\020" +
- "\001\022\026\n\022BLOCK_TRANSACTIONS\020\002*\\\n\010VoteType\022\020\n" +
- "\014VOTE_UNKNOWN\020\000\022\020\n\014VOTE_PREPARE\020\001\022\022\n\016VOT" +
- "E_PRECOMMIT\020\002\022\030\n\024VOTE_CHANGE_PROPOSER\020\0032" +
- "\214\007\n\nBlockchain\022=\n\010GetBlock\022\027.pactus.GetB" +
- "lockRequest\032\030.pactus.GetBlockResponse\022I\n" +
- "\014GetBlockHash\022\033.pactus.GetBlockHashReque" +
- "st\032\034.pactus.GetBlockHashResponse\022O\n\016GetB" +
- "lockHeight\022\035.pactus.GetBlockHeightReques" +
- "t\032\036.pactus.GetBlockHeightResponse\022X\n\021Get" +
- "BlockchainInfo\022 .pactus.GetBlockchainInf" +
- "oRequest\032!.pactus.GetBlockchainInfoRespo" +
- "nse\022U\n\020GetConsensusInfo\022\037.pactus.GetCons" +
- "ensusInfoRequest\032 .pactus.GetConsensusIn" +
- "foResponse\022C\n\nGetAccount\022\031.pactus.GetAcc" +
- "ountRequest\032\032.pactus.GetAccountResponse\022" +
- "S\n\022GetAccountByNumber\022!.pactus.GetAccoun" +
- "tByNumberRequest\032\032.pactus.GetAccountResp" +
- "onse\022I\n\014GetValidator\022\033.pactus.GetValidat" +
- "orRequest\032\034.pactus.GetValidatorResponse\022" +
- "Y\n\024GetValidatorByNumber\022#.pactus.GetVali" +
- "datorByNumberRequest\032\034.pactus.GetValidat" +
- "orResponse\022d\n\025GetValidatorAddresses\022$.pa" +
- "ctus.GetValidatorAddressesRequest\032%.pact" +
- "us.GetValidatorAddressesResponse\022L\n\rGetV" +
- "alidators\022\034.pactus.GetValidatorsRequest\032" +
- "\035.pactus.GetValidatorsResponseBE\n\021pactus" +
- ".blockchainZ0github.com/pactus-project/p" +
- "actus/www/grpc/pactusb\006proto3"
+ "tInfoR\007account\"\036\n\034GetValidatorAddressesR" +
+ "equest\"=\n\035GetValidatorAddressesResponse\022" +
+ "\034\n\taddresses\030\001 \003(\tR\taddresses\"/\n\023GetVali" +
+ "datorRequest\022\030\n\007address\030\001 \001(\tR\007address\"5" +
+ "\n\033GetValidatorByNumberRequest\022\026\n\006number\030" +
+ "\001 \001(\005R\006number\"K\n\024GetValidatorResponse\0223\n" +
+ "\tvalidator\030\001 \001(\0132\025.pactus.ValidatorInfoR" +
+ "\tvalidator\"_\n\017GetBlockRequest\022\026\n\006height\030" +
+ "\001 \001(\rR\006height\0224\n\tverbosity\030\002 \001(\0162\026.pactu" +
+ "s.BlockVerbosityR\tverbosity\"\203\002\n\020GetBlock" +
+ "Response\022\026\n\006height\030\001 \001(\rR\006height\022\022\n\004hash" +
+ "\030\002 \001(\014R\004hash\022\022\n\004data\030\003 \001(\014R\004data\022\035\n\nbloc" +
+ "k_time\030\004 \001(\rR\tblockTime\022/\n\006header\030\005 \001(\0132" +
+ "\027.pactus.BlockHeaderInfoR\006header\0224\n\tprev" +
+ "_cert\030\006 \001(\0132\027.pactus.CertificateInfoR\010pr" +
+ "evCert\022)\n\003txs\030\007 \003(\0132\027.pactus.Transaction" +
+ "InfoR\003txs\"-\n\023GetBlockHashRequest\022\026\n\006heig" +
+ "ht\030\001 \001(\rR\006height\"*\n\024GetBlockHashResponse" +
+ "\022\022\n\004hash\030\001 \001(\014R\004hash\"+\n\025GetBlockHeightRe" +
+ "quest\022\022\n\004hash\030\001 \001(\014R\004hash\"0\n\026GetBlockHei" +
+ "ghtResponse\022\026\n\006height\030\001 \001(\rR\006height\"\032\n\030G" +
+ "etBlockchainInfoRequest\"\325\002\n\031GetBlockchai" +
+ "nInfoResponse\022*\n\021last_block_height\030\001 \001(\r" +
+ "R\017lastBlockHeight\022&\n\017last_block_hash\030\002 \001" +
+ "(\014R\rlastBlockHash\022%\n\016total_accounts\030\003 \001(" +
+ "\005R\rtotalAccounts\022)\n\020total_validators\030\004 \001" +
+ "(\005R\017totalValidators\022\037\n\013total_power\030\005 \001(\003" +
+ "R\ntotalPower\022\'\n\017committee_power\030\006 \001(\003R\016c" +
+ "ommitteePower\022H\n\024committee_validators\030\007 " +
+ "\003(\0132\025.pactus.ValidatorInfoR\023committeeVal" +
+ "idators\"\031\n\027GetConsensusInfoRequest\"O\n\030Ge" +
+ "tConsensusInfoResponse\0223\n\tinstances\030\001 \003(" +
+ "\0132\025.pactus.ConsensusInfoR\tinstances\"\311\002\n\r" +
+ "ValidatorInfo\022\022\n\004hash\030\001 \001(\014R\004hash\022\022\n\004dat" +
+ "a\030\002 \001(\014R\004data\022\035\n\npublic_key\030\003 \001(\tR\tpubli" +
+ "cKey\022\026\n\006number\030\004 \001(\005R\006number\022\032\n\010sequence" +
+ "\030\005 \001(\005R\010sequence\022\024\n\005stake\030\006 \001(\003R\005stake\022." +
+ "\n\023last_bonding_height\030\007 \001(\rR\021lastBonding" +
+ "Height\0222\n\025last_sortition_height\030\010 \001(\rR\023l" +
+ "astSortitionHeight\022)\n\020unbonding_height\030\t" +
+ " \001(\rR\017unbondingHeight\022\030\n\007address\030\n \001(\tR\007" +
+ "address\"\203\001\n\013AccountInfo\022\022\n\004hash\030\001 \001(\014R\004h" +
+ "ash\022\022\n\004data\030\002 \001(\014R\004data\022\026\n\006number\030\003 \001(\005R" +
+ "\006number\022\032\n\010sequence\030\004 \001(\005R\010sequence\022\030\n\007b" +
+ "alance\030\005 \001(\003R\007balance\"\304\001\n\017BlockHeaderInf" +
+ "o\022\030\n\007version\030\001 \001(\005R\007version\022&\n\017prev_bloc" +
+ "k_hash\030\002 \001(\014R\rprevBlockHash\022\035\n\nstate_roo" +
+ "t\030\003 \001(\014R\tstateRoot\022%\n\016sortition_seed\030\004 \001" +
+ "(\014R\rsortitionSeed\022)\n\020proposer_address\030\005 " +
+ "\001(\tR\017proposerAddress\"\227\001\n\017CertificateInfo" +
+ "\022\022\n\004hash\030\001 \001(\014R\004hash\022\024\n\005round\030\002 \001(\005R\005rou" +
+ "nd\022\036\n\ncommitters\030\003 \003(\005R\ncommitters\022\034\n\tab" +
+ "sentees\030\004 \003(\005R\tabsentees\022\034\n\tsignature\030\005 " +
+ "\001(\014R\tsignature\"{\n\010VoteInfo\022$\n\004type\030\001 \001(\016" +
+ "2\020.pactus.VoteTypeR\004type\022\024\n\005voter\030\002 \001(\tR" +
+ "\005voter\022\035\n\nblock_hash\030\003 \001(\014R\tblockHash\022\024\n" +
+ "\005round\030\004 \001(\005R\005round\"\227\001\n\rConsensusInfo\022\030\n" +
+ "\007address\030\001 \001(\tR\007address\022\026\n\006Active\030\002 \001(\010R" +
+ "\006Active\022\026\n\006height\030\003 \001(\rR\006height\022\024\n\005round" +
+ "\030\004 \001(\005R\005round\022&\n\005votes\030\005 \003(\0132\020.pactus.Vo" +
+ "teInfoR\005votes*H\n\016BlockVerbosity\022\016\n\nBLOCK" +
+ "_DATA\020\000\022\016\n\nBLOCK_INFO\020\001\022\026\n\022BLOCK_TRANSAC" +
+ "TIONS\020\002*\\\n\010VoteType\022\020\n\014VOTE_UNKNOWN\020\000\022\020\n" +
+ "\014VOTE_PREPARE\020\001\022\022\n\016VOTE_PRECOMMIT\020\002\022\030\n\024V" +
+ "OTE_CHANGE_PROPOSER\020\0032\276\006\n\nBlockchain\022=\n\010" +
+ "GetBlock\022\027.pactus.GetBlockRequest\032\030.pact" +
+ "us.GetBlockResponse\022I\n\014GetBlockHash\022\033.pa" +
+ "ctus.GetBlockHashRequest\032\034.pactus.GetBlo" +
+ "ckHashResponse\022O\n\016GetBlockHeight\022\035.pactu" +
+ "s.GetBlockHeightRequest\032\036.pactus.GetBloc" +
+ "kHeightResponse\022X\n\021GetBlockchainInfo\022 .p" +
+ "actus.GetBlockchainInfoRequest\032!.pactus." +
+ "GetBlockchainInfoResponse\022U\n\020GetConsensu" +
+ "sInfo\022\037.pactus.GetConsensusInfoRequest\032 " +
+ ".pactus.GetConsensusInfoResponse\022C\n\nGetA" +
+ "ccount\022\031.pactus.GetAccountRequest\032\032.pact" +
+ "us.GetAccountResponse\022S\n\022GetAccountByNum" +
+ "ber\022!.pactus.GetAccountByNumberRequest\032\032" +
+ ".pactus.GetAccountResponse\022I\n\014GetValidat" +
+ "or\022\033.pactus.GetValidatorRequest\032\034.pactus" +
+ ".GetValidatorResponse\022Y\n\024GetValidatorByN" +
+ "umber\022#.pactus.GetValidatorByNumberReque" +
+ "st\032\034.pactus.GetValidatorResponse\022d\n\025GetV" +
+ "alidatorAddresses\022$.pactus.GetValidatorA" +
+ "ddressesRequest\032%.pactus.GetValidatorAdd" +
+ "ressesResponseBE\n\021pactus.blockchainZ0git" +
+ "hub.com/pactus-project/pactus/www/grpc/p" +
+ "actusb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -18426,140 +17237,128 @@ public pactus.blockchain.BlockchainOuterClass.ConsensusInfo getDefaultInstanceFo
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetAccountResponse_descriptor,
new java.lang.String[] { "Account", });
- internal_static_pactus_GetValidatorsRequest_descriptor =
- getDescriptor().getMessageTypes().get(3);
- internal_static_pactus_GetValidatorsRequest_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_pactus_GetValidatorsRequest_descriptor,
- new java.lang.String[] { });
internal_static_pactus_GetValidatorAddressesRequest_descriptor =
- getDescriptor().getMessageTypes().get(4);
+ getDescriptor().getMessageTypes().get(3);
internal_static_pactus_GetValidatorAddressesRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetValidatorAddressesRequest_descriptor,
new java.lang.String[] { });
internal_static_pactus_GetValidatorAddressesResponse_descriptor =
- getDescriptor().getMessageTypes().get(5);
+ getDescriptor().getMessageTypes().get(4);
internal_static_pactus_GetValidatorAddressesResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetValidatorAddressesResponse_descriptor,
new java.lang.String[] { "Addresses", });
internal_static_pactus_GetValidatorRequest_descriptor =
- getDescriptor().getMessageTypes().get(6);
+ getDescriptor().getMessageTypes().get(5);
internal_static_pactus_GetValidatorRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetValidatorRequest_descriptor,
new java.lang.String[] { "Address", });
internal_static_pactus_GetValidatorByNumberRequest_descriptor =
- getDescriptor().getMessageTypes().get(7);
+ getDescriptor().getMessageTypes().get(6);
internal_static_pactus_GetValidatorByNumberRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetValidatorByNumberRequest_descriptor,
new java.lang.String[] { "Number", });
- internal_static_pactus_GetValidatorsResponse_descriptor =
- getDescriptor().getMessageTypes().get(8);
- internal_static_pactus_GetValidatorsResponse_fieldAccessorTable = new
- com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
- internal_static_pactus_GetValidatorsResponse_descriptor,
- new java.lang.String[] { "Validators", });
internal_static_pactus_GetValidatorResponse_descriptor =
- getDescriptor().getMessageTypes().get(9);
+ getDescriptor().getMessageTypes().get(7);
internal_static_pactus_GetValidatorResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetValidatorResponse_descriptor,
new java.lang.String[] { "Validator", });
internal_static_pactus_GetBlockRequest_descriptor =
- getDescriptor().getMessageTypes().get(10);
+ getDescriptor().getMessageTypes().get(8);
internal_static_pactus_GetBlockRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockRequest_descriptor,
new java.lang.String[] { "Height", "Verbosity", });
internal_static_pactus_GetBlockResponse_descriptor =
- getDescriptor().getMessageTypes().get(11);
+ getDescriptor().getMessageTypes().get(9);
internal_static_pactus_GetBlockResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockResponse_descriptor,
new java.lang.String[] { "Height", "Hash", "Data", "BlockTime", "Header", "PrevCert", "Txs", });
internal_static_pactus_GetBlockHashRequest_descriptor =
- getDescriptor().getMessageTypes().get(12);
+ getDescriptor().getMessageTypes().get(10);
internal_static_pactus_GetBlockHashRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockHashRequest_descriptor,
new java.lang.String[] { "Height", });
internal_static_pactus_GetBlockHashResponse_descriptor =
- getDescriptor().getMessageTypes().get(13);
+ getDescriptor().getMessageTypes().get(11);
internal_static_pactus_GetBlockHashResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockHashResponse_descriptor,
new java.lang.String[] { "Hash", });
internal_static_pactus_GetBlockHeightRequest_descriptor =
- getDescriptor().getMessageTypes().get(14);
+ getDescriptor().getMessageTypes().get(12);
internal_static_pactus_GetBlockHeightRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockHeightRequest_descriptor,
new java.lang.String[] { "Hash", });
internal_static_pactus_GetBlockHeightResponse_descriptor =
- getDescriptor().getMessageTypes().get(15);
+ getDescriptor().getMessageTypes().get(13);
internal_static_pactus_GetBlockHeightResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockHeightResponse_descriptor,
new java.lang.String[] { "Height", });
internal_static_pactus_GetBlockchainInfoRequest_descriptor =
- getDescriptor().getMessageTypes().get(16);
+ getDescriptor().getMessageTypes().get(14);
internal_static_pactus_GetBlockchainInfoRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockchainInfoRequest_descriptor,
new java.lang.String[] { });
internal_static_pactus_GetBlockchainInfoResponse_descriptor =
- getDescriptor().getMessageTypes().get(17);
+ getDescriptor().getMessageTypes().get(15);
internal_static_pactus_GetBlockchainInfoResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetBlockchainInfoResponse_descriptor,
new java.lang.String[] { "LastBlockHeight", "LastBlockHash", "TotalAccounts", "TotalValidators", "TotalPower", "CommitteePower", "CommitteeValidators", });
internal_static_pactus_GetConsensusInfoRequest_descriptor =
- getDescriptor().getMessageTypes().get(18);
+ getDescriptor().getMessageTypes().get(16);
internal_static_pactus_GetConsensusInfoRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetConsensusInfoRequest_descriptor,
new java.lang.String[] { });
internal_static_pactus_GetConsensusInfoResponse_descriptor =
- getDescriptor().getMessageTypes().get(19);
+ getDescriptor().getMessageTypes().get(17);
internal_static_pactus_GetConsensusInfoResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetConsensusInfoResponse_descriptor,
new java.lang.String[] { "Instances", });
internal_static_pactus_ValidatorInfo_descriptor =
- getDescriptor().getMessageTypes().get(20);
+ getDescriptor().getMessageTypes().get(18);
internal_static_pactus_ValidatorInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_ValidatorInfo_descriptor,
- new java.lang.String[] { "Hash", "Data", "PublicKey", "Number", "Sequence", "Stake", "LastBondingHeight", "LastJoinedHeight", "UnbondingHeight", "Address", });
+ new java.lang.String[] { "Hash", "Data", "PublicKey", "Number", "Sequence", "Stake", "LastBondingHeight", "LastSortitionHeight", "UnbondingHeight", "Address", });
internal_static_pactus_AccountInfo_descriptor =
- getDescriptor().getMessageTypes().get(21);
+ getDescriptor().getMessageTypes().get(19);
internal_static_pactus_AccountInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_AccountInfo_descriptor,
new java.lang.String[] { "Hash", "Data", "Number", "Sequence", "Balance", });
internal_static_pactus_BlockHeaderInfo_descriptor =
- getDescriptor().getMessageTypes().get(22);
+ getDescriptor().getMessageTypes().get(20);
internal_static_pactus_BlockHeaderInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_BlockHeaderInfo_descriptor,
new java.lang.String[] { "Version", "PrevBlockHash", "StateRoot", "SortitionSeed", "ProposerAddress", });
internal_static_pactus_CertificateInfo_descriptor =
- getDescriptor().getMessageTypes().get(23);
+ getDescriptor().getMessageTypes().get(21);
internal_static_pactus_CertificateInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_CertificateInfo_descriptor,
new java.lang.String[] { "Hash", "Round", "Committers", "Absentees", "Signature", });
internal_static_pactus_VoteInfo_descriptor =
- getDescriptor().getMessageTypes().get(24);
+ getDescriptor().getMessageTypes().get(22);
internal_static_pactus_VoteInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_VoteInfo_descriptor,
new java.lang.String[] { "Type", "Voter", "BlockHash", "Round", });
internal_static_pactus_ConsensusInfo_descriptor =
- getDescriptor().getMessageTypes().get(25);
+ getDescriptor().getMessageTypes().get(23);
internal_static_pactus_ConsensusInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_ConsensusInfo_descriptor,
diff --git a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java
index 35572a104..e43f6339b 100644
--- a/www/grpc/gen/java/pactus/network/NetworkOuterClass.java
+++ b/www/grpc/gen/java/pactus/network/NetworkOuterClass.java
@@ -459,6 +459,74 @@ public interface GetNetworkInfoResponseOrBuilder extends
*/
pactus.network.NetworkOuterClass.PeerInfoOrBuilder getPeersOrBuilder(
int index);
+
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ int getSentBytesCount();
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ boolean containsSentBytes(
+ int key);
+ /**
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Deprecated
+ java.util.Map
+ getSentBytes();
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ java.util.Map
+ getSentBytesMap();
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ long getSentBytesOrDefault(
+ int key,
+ long defaultValue);
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ long getSentBytesOrThrow(
+ int key);
+
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ int getReceivedBytesCount();
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ boolean containsReceivedBytes(
+ int key);
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
+ */
+ @java.lang.Deprecated
+ java.util.Map
+ getReceivedBytes();
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ java.util.Map
+ getReceivedBytesMap();
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue);
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ long getReceivedBytesOrThrow(
+ int key);
}
/**
* Protobuf type {@code pactus.GetNetworkInfoResponse}
@@ -493,6 +561,20 @@ protected java.lang.Object newInstance(
return pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_descriptor;
}
+ @SuppressWarnings({"rawtypes"})
+ @java.lang.Override
+ protected com.google.protobuf.MapField internalGetMapField(
+ int number) {
+ switch (number) {
+ case 5:
+ return internalGetSentBytes();
+ case 6:
+ return internalGetReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
@@ -574,6 +656,168 @@ public pactus.network.NetworkOuterClass.PeerInfoOrBuilder getPeersOrBuilder(
return peers_.get(index);
}
+ public static final int SENT_BYTES_FIELD_NUMBER = 5;
+ private static final class SentBytesDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry<
+ java.lang.Integer, java.lang.Long> defaultEntry =
+ com.google.protobuf.MapEntry
+ .newDefaultInstance(
+ pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor,
+ com.google.protobuf.WireFormat.FieldType.INT32,
+ 0,
+ com.google.protobuf.WireFormat.FieldType.INT64,
+ 0L);
+ }
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> sentBytes_;
+ private com.google.protobuf.MapField
+ internalGetSentBytes() {
+ if (sentBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ return sentBytes_;
+ }
+
+ public int getSentBytesCount() {
+ return internalGetSentBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsSentBytes(
+ int key) {
+
+ return internalGetSentBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getSentBytes() {
+ return getSentBytesMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getSentBytesMap() {
+ return internalGetSentBytes().getMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public static final int RECEIVED_BYTES_FIELD_NUMBER = 6;
+ private static final class ReceivedBytesDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry<
+ java.lang.Integer, java.lang.Long> defaultEntry =
+ com.google.protobuf.MapEntry
+ .newDefaultInstance(
+ pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor,
+ com.google.protobuf.WireFormat.FieldType.INT32,
+ 0,
+ com.google.protobuf.WireFormat.FieldType.INT64,
+ 0L);
+ }
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> receivedBytes_;
+ private com.google.protobuf.MapField
+ internalGetReceivedBytes() {
+ if (receivedBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
+ return receivedBytes_;
+ }
+
+ public int getReceivedBytesCount() {
+ return internalGetReceivedBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsReceivedBytes(
+ int key) {
+
+ return internalGetReceivedBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getReceivedBytes() {
+ return getReceivedBytesMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getReceivedBytesMap() {
+ return internalGetReceivedBytes().getMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -600,6 +844,18 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
for (int i = 0; i < peers_.size(); i++) {
output.writeMessage(4, peers_.get(i));
}
+ com.google.protobuf.GeneratedMessageV3
+ .serializeIntegerMapTo(
+ output,
+ internalGetSentBytes(),
+ SentBytesDefaultEntryHolder.defaultEntry,
+ 5);
+ com.google.protobuf.GeneratedMessageV3
+ .serializeIntegerMapTo(
+ output,
+ internalGetReceivedBytes(),
+ ReceivedBytesDefaultEntryHolder.defaultEntry,
+ 6);
getUnknownFields().writeTo(output);
}
@@ -625,6 +881,26 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(4, peers_.get(i));
}
+ for (java.util.Map.Entry entry
+ : internalGetSentBytes().getMap().entrySet()) {
+ com.google.protobuf.MapEntry
+ sentBytes__ = SentBytesDefaultEntryHolder.defaultEntry.newBuilderForType()
+ .setKey(entry.getKey())
+ .setValue(entry.getValue())
+ .build();
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(5, sentBytes__);
+ }
+ for (java.util.Map.Entry entry
+ : internalGetReceivedBytes().getMap().entrySet()) {
+ com.google.protobuf.MapEntry
+ receivedBytes__ = ReceivedBytesDefaultEntryHolder.defaultEntry.newBuilderForType()
+ .setKey(entry.getKey())
+ .setValue(entry.getValue())
+ .build();
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(6, receivedBytes__);
+ }
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
@@ -648,6 +924,10 @@ public boolean equals(final java.lang.Object obj) {
!= other.getStartedAt()) return false;
if (!getPeersList()
.equals(other.getPeersList())) return false;
+ if (!internalGetSentBytes().equals(
+ other.internalGetSentBytes())) return false;
+ if (!internalGetReceivedBytes().equals(
+ other.internalGetReceivedBytes())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -670,6 +950,14 @@ public int hashCode() {
hash = (37 * hash) + PEERS_FIELD_NUMBER;
hash = (53 * hash) + getPeersList().hashCode();
}
+ if (!internalGetSentBytes().getMap().isEmpty()) {
+ hash = (37 * hash) + SENT_BYTES_FIELD_NUMBER;
+ hash = (53 * hash) + internalGetSentBytes().hashCode();
+ }
+ if (!internalGetReceivedBytes().getMap().isEmpty()) {
+ hash = (37 * hash) + RECEIVED_BYTES_FIELD_NUMBER;
+ hash = (53 * hash) + internalGetReceivedBytes().hashCode();
+ }
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
@@ -777,6 +1065,32 @@ public static final class Builder extends
return pactus.network.NetworkOuterClass.internal_static_pactus_GetNetworkInfoResponse_descriptor;
}
+ @SuppressWarnings({"rawtypes"})
+ protected com.google.protobuf.MapField internalGetMapField(
+ int number) {
+ switch (number) {
+ case 5:
+ return internalGetSentBytes();
+ case 6:
+ return internalGetReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
+ @SuppressWarnings({"rawtypes"})
+ protected com.google.protobuf.MapField internalGetMutableMapField(
+ int number) {
+ switch (number) {
+ case 5:
+ return internalGetMutableSentBytes();
+ case 6:
+ return internalGetMutableReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
@@ -811,6 +1125,8 @@ public Builder clear() {
peersBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
+ internalGetMutableSentBytes().clear();
+ internalGetMutableReceivedBytes().clear();
return this;
}
@@ -850,6 +1166,10 @@ public pactus.network.NetworkOuterClass.GetNetworkInfoResponse buildPartial() {
} else {
result.peers_ = peersBuilder_.build();
}
+ result.sentBytes_ = internalGetSentBytes();
+ result.sentBytes_.makeImmutable();
+ result.receivedBytes_ = internalGetReceivedBytes();
+ result.receivedBytes_.makeImmutable();
onBuilt();
return result;
}
@@ -933,6 +1253,10 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.GetNetworkInfoResponse
}
}
}
+ internalGetMutableSentBytes().mergeFrom(
+ other.internalGetSentBytes());
+ internalGetMutableReceivedBytes().mergeFrom(
+ other.internalGetReceivedBytes());
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -987,6 +1311,22 @@ public Builder mergeFrom(
}
break;
} // case 34
+ case 42: {
+ com.google.protobuf.MapEntry
+ sentBytes__ = input.readMessage(
+ SentBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
+ internalGetMutableSentBytes().getMutableMap().put(
+ sentBytes__.getKey(), sentBytes__.getValue());
+ break;
+ } // case 42
+ case 50: {
+ com.google.protobuf.MapEntry
+ receivedBytes__ = input.readMessage(
+ ReceivedBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
+ internalGetMutableReceivedBytes().getMutableMap().put(
+ receivedBytes__.getKey(), receivedBytes__.getValue());
+ break;
+ } // case 50
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -1336,6 +1676,262 @@ public pactus.network.NetworkOuterClass.PeerInfo.Builder addPeersBuilder(
}
return peersBuilder_;
}
+
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> sentBytes_;
+ private com.google.protobuf.MapField
+ internalGetSentBytes() {
+ if (sentBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ return sentBytes_;
+ }
+ private com.google.protobuf.MapField
+ internalGetMutableSentBytes() {
+ onChanged();;
+ if (sentBytes_ == null) {
+ sentBytes_ = com.google.protobuf.MapField.newMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ if (!sentBytes_.isMutable()) {
+ sentBytes_ = sentBytes_.copy();
+ }
+ return sentBytes_;
+ }
+
+ public int getSentBytesCount() {
+ return internalGetSentBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsSentBytes(
+ int key) {
+
+ return internalGetSentBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getSentBytes() {
+ return getSentBytesMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getSentBytesMap() {
+ return internalGetSentBytes().getMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public Builder clearSentBytes() {
+ internalGetMutableSentBytes().getMutableMap()
+ .clear();
+ return this;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ public Builder removeSentBytes(
+ int key) {
+
+ internalGetMutableSentBytes().getMutableMap()
+ .remove(key);
+ return this;
+ }
+ /**
+ * Use alternate mutation accessors instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map
+ getMutableSentBytes() {
+ return internalGetMutableSentBytes().getMutableMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+ public Builder putSentBytes(
+ int key,
+ long value) {
+
+
+ internalGetMutableSentBytes().getMutableMap()
+ .put(key, value);
+ return this;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 5 [json_name = "sentBytes"];
+ */
+
+ public Builder putAllSentBytes(
+ java.util.Map values) {
+ internalGetMutableSentBytes().getMutableMap()
+ .putAll(values);
+ return this;
+ }
+
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> receivedBytes_;
+ private com.google.protobuf.MapField
+ internalGetReceivedBytes() {
+ if (receivedBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
+ return receivedBytes_;
+ }
+ private com.google.protobuf.MapField
+ internalGetMutableReceivedBytes() {
+ onChanged();;
+ if (receivedBytes_ == null) {
+ receivedBytes_ = com.google.protobuf.MapField.newMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
+ if (!receivedBytes_.isMutable()) {
+ receivedBytes_ = receivedBytes_.copy();
+ }
+ return receivedBytes_;
+ }
+
+ public int getReceivedBytesCount() {
+ return internalGetReceivedBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsReceivedBytes(
+ int key) {
+
+ return internalGetReceivedBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getReceivedBytes() {
+ return getReceivedBytesMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getReceivedBytesMap() {
+ return internalGetReceivedBytes().getMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public Builder clearReceivedBytes() {
+ internalGetMutableReceivedBytes().getMutableMap()
+ .clear();
+ return this;
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ public Builder removeReceivedBytes(
+ int key) {
+
+ internalGetMutableReceivedBytes().getMutableMap()
+ .remove(key);
+ return this;
+ }
+ /**
+ * Use alternate mutation accessors instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map
+ getMutableReceivedBytes() {
+ return internalGetMutableReceivedBytes().getMutableMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+ public Builder putReceivedBytes(
+ int key,
+ long value) {
+
+
+ internalGetMutableReceivedBytes().getMutableMap()
+ .put(key, value);
+ return this;
+ }
+ /**
+ * map<int32, int64> received_bytes = 6 [json_name = "receivedBytes"];
+ */
+
+ public Builder putAllReceivedBytes(
+ java.util.Map values) {
+ internalGetMutableReceivedBytes().getMutableMap()
+ .putAll(values);
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -2656,40 +3252,108 @@ public interface PeerInfoOrBuilder extends
int getInvalidMessages();
/**
- * int32 received_bytes = 9 [json_name = "receivedBytes"];
- * @return The receivedBytes.
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ int getSentBytesCount();
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ boolean containsSentBytes(
+ int key);
+ /**
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Deprecated
+ java.util.Map
+ getSentBytes();
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ java.util.Map
+ getSentBytesMap();
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+
+ long getSentBytesOrDefault(
+ int key,
+ long defaultValue);
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+
+ long getSentBytesOrThrow(
+ int key);
+
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ int getReceivedBytesCount();
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ boolean containsReceivedBytes(
+ int key);
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
+ */
+ @java.lang.Deprecated
+ java.util.Map
+ getReceivedBytes();
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ java.util.Map
+ getReceivedBytesMap();
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+
+ long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue);
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
*/
- int getReceivedBytes();
+
+ long getReceivedBytesOrThrow(
+ int key);
/**
- * int32 status = 10 [json_name = "status"];
+ * int32 status = 11 [json_name = "status"];
* @return The status.
*/
int getStatus();
/**
- * int64 last_sent = 11 [json_name = "lastSent"];
+ * int64 last_sent = 12 [json_name = "lastSent"];
* @return The lastSent.
*/
long getLastSent();
/**
- * int64 last_received = 12 [json_name = "lastReceived"];
+ * int64 last_received = 13 [json_name = "lastReceived"];
* @return The lastReceived.
*/
long getLastReceived();
/**
- * int32 send_success = 13 [json_name = "sendSuccess"];
+ * int32 send_success = 14 [json_name = "sendSuccess"];
* @return The sendSuccess.
*/
int getSendSuccess();
/**
- * int32 send_failed = 14 [json_name = "sendFailed"];
+ * int32 send_failed = 15 [json_name = "sendFailed"];
* @return The sendFailed.
*/
int getSendFailed();
+
+ /**
+ * bytes last_block_hash = 16 [json_name = "lastBlockHash"];
+ * @return The lastBlockHash.
+ */
+ com.google.protobuf.ByteString getLastBlockHash();
}
/**
* Protobuf type {@code pactus.PeerInfo}
@@ -2708,6 +3372,7 @@ private PeerInfo() {
agent_ = "";
peerId_ = com.google.protobuf.ByteString.EMPTY;
consensusKeys_ = com.google.protobuf.LazyStringArrayList.EMPTY;
+ lastBlockHash_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@@ -2727,6 +3392,20 @@ protected java.lang.Object newInstance(
return pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_descriptor;
}
+ @SuppressWarnings({"rawtypes"})
+ @java.lang.Override
+ protected com.google.protobuf.MapField internalGetMapField(
+ int number) {
+ switch (number) {
+ case 9:
+ return internalGetSentBytes();
+ case 10:
+ return internalGetReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
@@ -2901,21 +3580,172 @@ public int getInvalidMessages() {
return invalidMessages_;
}
- public static final int RECEIVED_BYTES_FIELD_NUMBER = 9;
- private int receivedBytes_;
+ public static final int SENT_BYTES_FIELD_NUMBER = 9;
+ private static final class SentBytesDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry<
+ java.lang.Integer, java.lang.Long> defaultEntry =
+ com.google.protobuf.MapEntry
+ .newDefaultInstance(
+ pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_SentBytesEntry_descriptor,
+ com.google.protobuf.WireFormat.FieldType.INT32,
+ 0,
+ com.google.protobuf.WireFormat.FieldType.INT64,
+ 0L);
+ }
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> sentBytes_;
+ private com.google.protobuf.MapField
+ internalGetSentBytes() {
+ if (sentBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ return sentBytes_;
+ }
+
+ public int getSentBytesCount() {
+ return internalGetSentBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsSentBytes(
+ int key) {
+
+ return internalGetSentBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getSentBytes() {
+ return getSentBytesMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getSentBytesMap() {
+ return internalGetSentBytes().getMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
/**
- * int32 received_bytes = 9 [json_name = "receivedBytes"];
- * @return The receivedBytes.
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
*/
@java.lang.Override
- public int getReceivedBytes() {
+
+ public long getSentBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public static final int RECEIVED_BYTES_FIELD_NUMBER = 10;
+ private static final class ReceivedBytesDefaultEntryHolder {
+ static final com.google.protobuf.MapEntry<
+ java.lang.Integer, java.lang.Long> defaultEntry =
+ com.google.protobuf.MapEntry
+ .newDefaultInstance(
+ pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor,
+ com.google.protobuf.WireFormat.FieldType.INT32,
+ 0,
+ com.google.protobuf.WireFormat.FieldType.INT64,
+ 0L);
+ }
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> receivedBytes_;
+ private com.google.protobuf.MapField
+ internalGetReceivedBytes() {
+ if (receivedBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
return receivedBytes_;
}
- public static final int STATUS_FIELD_NUMBER = 10;
+ public int getReceivedBytesCount() {
+ return internalGetReceivedBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsReceivedBytes(
+ int key) {
+
+ return internalGetReceivedBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getReceivedBytes() {
+ return getReceivedBytesMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getReceivedBytesMap() {
+ return internalGetReceivedBytes().getMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public static final int STATUS_FIELD_NUMBER = 11;
private int status_;
/**
- * int32 status = 10 [json_name = "status"];
+ * int32 status = 11 [json_name = "status"];
* @return The status.
*/
@java.lang.Override
@@ -2923,10 +3753,10 @@ public int getStatus() {
return status_;
}
- public static final int LAST_SENT_FIELD_NUMBER = 11;
+ public static final int LAST_SENT_FIELD_NUMBER = 12;
private long lastSent_;
/**
- * int64 last_sent = 11 [json_name = "lastSent"];
+ * int64 last_sent = 12 [json_name = "lastSent"];
* @return The lastSent.
*/
@java.lang.Override
@@ -2934,10 +3764,10 @@ public long getLastSent() {
return lastSent_;
}
- public static final int LAST_RECEIVED_FIELD_NUMBER = 12;
+ public static final int LAST_RECEIVED_FIELD_NUMBER = 13;
private long lastReceived_;
/**
- * int64 last_received = 12 [json_name = "lastReceived"];
+ * int64 last_received = 13 [json_name = "lastReceived"];
* @return The lastReceived.
*/
@java.lang.Override
@@ -2945,10 +3775,10 @@ public long getLastReceived() {
return lastReceived_;
}
- public static final int SEND_SUCCESS_FIELD_NUMBER = 13;
+ public static final int SEND_SUCCESS_FIELD_NUMBER = 14;
private int sendSuccess_;
/**
- * int32 send_success = 13 [json_name = "sendSuccess"];
+ * int32 send_success = 14 [json_name = "sendSuccess"];
* @return The sendSuccess.
*/
@java.lang.Override
@@ -2956,10 +3786,10 @@ public int getSendSuccess() {
return sendSuccess_;
}
- public static final int SEND_FAILED_FIELD_NUMBER = 14;
+ public static final int SEND_FAILED_FIELD_NUMBER = 15;
private int sendFailed_;
/**
- * int32 send_failed = 14 [json_name = "sendFailed"];
+ * int32 send_failed = 15 [json_name = "sendFailed"];
* @return The sendFailed.
*/
@java.lang.Override
@@ -2967,6 +3797,17 @@ public int getSendFailed() {
return sendFailed_;
}
+ public static final int LAST_BLOCK_HASH_FIELD_NUMBER = 16;
+ private com.google.protobuf.ByteString lastBlockHash_;
+ /**
+ * bytes last_block_hash = 16 [json_name = "lastBlockHash"];
+ * @return The lastBlockHash.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getLastBlockHash() {
+ return lastBlockHash_;
+ }
+
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
@@ -3005,23 +3846,35 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
if (invalidMessages_ != 0) {
output.writeInt32(8, invalidMessages_);
}
- if (receivedBytes_ != 0) {
- output.writeInt32(9, receivedBytes_);
- }
+ com.google.protobuf.GeneratedMessageV3
+ .serializeIntegerMapTo(
+ output,
+ internalGetSentBytes(),
+ SentBytesDefaultEntryHolder.defaultEntry,
+ 9);
+ com.google.protobuf.GeneratedMessageV3
+ .serializeIntegerMapTo(
+ output,
+ internalGetReceivedBytes(),
+ ReceivedBytesDefaultEntryHolder.defaultEntry,
+ 10);
if (status_ != 0) {
- output.writeInt32(10, status_);
+ output.writeInt32(11, status_);
}
if (lastSent_ != 0L) {
- output.writeInt64(11, lastSent_);
+ output.writeInt64(12, lastSent_);
}
if (lastReceived_ != 0L) {
- output.writeInt64(12, lastReceived_);
+ output.writeInt64(13, lastReceived_);
}
if (sendSuccess_ != 0) {
- output.writeInt32(13, sendSuccess_);
+ output.writeInt32(14, sendSuccess_);
}
if (sendFailed_ != 0) {
- output.writeInt32(14, sendFailed_);
+ output.writeInt32(15, sendFailed_);
+ }
+ if (!lastBlockHash_.isEmpty()) {
+ output.writeBytes(16, lastBlockHash_);
}
getUnknownFields().writeTo(output);
}
@@ -3066,29 +3919,49 @@ public int getSerializedSize() {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(8, invalidMessages_);
}
- if (receivedBytes_ != 0) {
+ for (java.util.Map.Entry entry
+ : internalGetSentBytes().getMap().entrySet()) {
+ com.google.protobuf.MapEntry
+ sentBytes__ = SentBytesDefaultEntryHolder.defaultEntry.newBuilderForType()
+ .setKey(entry.getKey())
+ .setValue(entry.getValue())
+ .build();
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(9, receivedBytes_);
+ .computeMessageSize(9, sentBytes__);
+ }
+ for (java.util.Map.Entry entry
+ : internalGetReceivedBytes().getMap().entrySet()) {
+ com.google.protobuf.MapEntry
+ receivedBytes__ = ReceivedBytesDefaultEntryHolder.defaultEntry.newBuilderForType()
+ .setKey(entry.getKey())
+ .setValue(entry.getValue())
+ .build();
+ size += com.google.protobuf.CodedOutputStream
+ .computeMessageSize(10, receivedBytes__);
}
if (status_ != 0) {
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(10, status_);
+ .computeInt32Size(11, status_);
}
if (lastSent_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(11, lastSent_);
+ .computeInt64Size(12, lastSent_);
}
if (lastReceived_ != 0L) {
size += com.google.protobuf.CodedOutputStream
- .computeInt64Size(12, lastReceived_);
+ .computeInt64Size(13, lastReceived_);
}
if (sendSuccess_ != 0) {
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(13, sendSuccess_);
+ .computeInt32Size(14, sendSuccess_);
}
if (sendFailed_ != 0) {
size += com.google.protobuf.CodedOutputStream
- .computeInt32Size(14, sendFailed_);
+ .computeInt32Size(15, sendFailed_);
+ }
+ if (!lastBlockHash_.isEmpty()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeBytesSize(16, lastBlockHash_);
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
@@ -3121,8 +3994,10 @@ public boolean equals(final java.lang.Object obj) {
!= other.getReceivedMessages()) return false;
if (getInvalidMessages()
!= other.getInvalidMessages()) return false;
- if (getReceivedBytes()
- != other.getReceivedBytes()) return false;
+ if (!internalGetSentBytes().equals(
+ other.internalGetSentBytes())) return false;
+ if (!internalGetReceivedBytes().equals(
+ other.internalGetReceivedBytes())) return false;
if (getStatus()
!= other.getStatus()) return false;
if (getLastSent()
@@ -3133,6 +4008,8 @@ public boolean equals(final java.lang.Object obj) {
!= other.getSendSuccess()) return false;
if (getSendFailed()
!= other.getSendFailed()) return false;
+ if (!getLastBlockHash()
+ .equals(other.getLastBlockHash())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@@ -3162,8 +4039,14 @@ public int hashCode() {
hash = (53 * hash) + getReceivedMessages();
hash = (37 * hash) + INVALID_MESSAGES_FIELD_NUMBER;
hash = (53 * hash) + getInvalidMessages();
- hash = (37 * hash) + RECEIVED_BYTES_FIELD_NUMBER;
- hash = (53 * hash) + getReceivedBytes();
+ if (!internalGetSentBytes().getMap().isEmpty()) {
+ hash = (37 * hash) + SENT_BYTES_FIELD_NUMBER;
+ hash = (53 * hash) + internalGetSentBytes().hashCode();
+ }
+ if (!internalGetReceivedBytes().getMap().isEmpty()) {
+ hash = (37 * hash) + RECEIVED_BYTES_FIELD_NUMBER;
+ hash = (53 * hash) + internalGetReceivedBytes().hashCode();
+ }
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + getStatus();
hash = (37 * hash) + LAST_SENT_FIELD_NUMBER;
@@ -3176,6 +4059,8 @@ public int hashCode() {
hash = (53 * hash) + getSendSuccess();
hash = (37 * hash) + SEND_FAILED_FIELD_NUMBER;
hash = (53 * hash) + getSendFailed();
+ hash = (37 * hash) + LAST_BLOCK_HASH_FIELD_NUMBER;
+ hash = (53 * hash) + getLastBlockHash().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
@@ -3283,6 +4168,32 @@ public static final class Builder extends
return pactus.network.NetworkOuterClass.internal_static_pactus_PeerInfo_descriptor;
}
+ @SuppressWarnings({"rawtypes"})
+ protected com.google.protobuf.MapField internalGetMapField(
+ int number) {
+ switch (number) {
+ case 9:
+ return internalGetSentBytes();
+ case 10:
+ return internalGetReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
+ @SuppressWarnings({"rawtypes"})
+ protected com.google.protobuf.MapField internalGetMutableMapField(
+ int number) {
+ switch (number) {
+ case 9:
+ return internalGetMutableSentBytes();
+ case 10:
+ return internalGetMutableReceivedBytes();
+ default:
+ throw new RuntimeException(
+ "Invalid map field number: " + number);
+ }
+ }
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
@@ -3320,8 +4231,8 @@ public Builder clear() {
invalidMessages_ = 0;
- receivedBytes_ = 0;
-
+ internalGetMutableSentBytes().clear();
+ internalGetMutableReceivedBytes().clear();
status_ = 0;
lastSent_ = 0L;
@@ -3332,6 +4243,8 @@ public Builder clear() {
sendFailed_ = 0;
+ lastBlockHash_ = com.google.protobuf.ByteString.EMPTY;
+
return this;
}
@@ -3371,12 +4284,16 @@ public pactus.network.NetworkOuterClass.PeerInfo buildPartial() {
result.height_ = height_;
result.receivedMessages_ = receivedMessages_;
result.invalidMessages_ = invalidMessages_;
- result.receivedBytes_ = receivedBytes_;
+ result.sentBytes_ = internalGetSentBytes();
+ result.sentBytes_.makeImmutable();
+ result.receivedBytes_ = internalGetReceivedBytes();
+ result.receivedBytes_.makeImmutable();
result.status_ = status_;
result.lastSent_ = lastSent_;
result.lastReceived_ = lastReceived_;
result.sendSuccess_ = sendSuccess_;
result.sendFailed_ = sendFailed_;
+ result.lastBlockHash_ = lastBlockHash_;
onBuilt();
return result;
}
@@ -3458,9 +4375,10 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.PeerInfo other) {
if (other.getInvalidMessages() != 0) {
setInvalidMessages(other.getInvalidMessages());
}
- if (other.getReceivedBytes() != 0) {
- setReceivedBytes(other.getReceivedBytes());
- }
+ internalGetMutableSentBytes().mergeFrom(
+ other.internalGetSentBytes());
+ internalGetMutableReceivedBytes().mergeFrom(
+ other.internalGetReceivedBytes());
if (other.getStatus() != 0) {
setStatus(other.getStatus());
}
@@ -3476,6 +4394,9 @@ public Builder mergeFrom(pactus.network.NetworkOuterClass.PeerInfo other) {
if (other.getSendFailed() != 0) {
setSendFailed(other.getSendFailed());
}
+ if (other.getLastBlockHash() != com.google.protobuf.ByteString.EMPTY) {
+ setLastBlockHash(other.getLastBlockHash());
+ }
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
@@ -3543,36 +4464,52 @@ public Builder mergeFrom(
break;
} // case 64
- case 72: {
- receivedBytes_ = input.readInt32();
-
+ case 74: {
+ com.google.protobuf.MapEntry
+ sentBytes__ = input.readMessage(
+ SentBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
+ internalGetMutableSentBytes().getMutableMap().put(
+ sentBytes__.getKey(), sentBytes__.getValue());
break;
- } // case 72
- case 80: {
- status_ = input.readInt32();
-
+ } // case 74
+ case 82: {
+ com.google.protobuf.MapEntry
+ receivedBytes__ = input.readMessage(
+ ReceivedBytesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
+ internalGetMutableReceivedBytes().getMutableMap().put(
+ receivedBytes__.getKey(), receivedBytes__.getValue());
break;
- } // case 80
+ } // case 82
case 88: {
- lastSent_ = input.readInt64();
+ status_ = input.readInt32();
break;
} // case 88
case 96: {
- lastReceived_ = input.readInt64();
+ lastSent_ = input.readInt64();
break;
} // case 96
case 104: {
- sendSuccess_ = input.readInt32();
+ lastReceived_ = input.readInt64();
break;
} // case 104
case 112: {
- sendFailed_ = input.readInt32();
+ sendSuccess_ = input.readInt32();
break;
} // case 112
+ case 120: {
+ sendFailed_ = input.readInt32();
+
+ break;
+ } // case 120
+ case 130: {
+ lastBlockHash_ = input.readBytes();
+
+ break;
+ } // case 130
default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
@@ -4010,40 +4947,265 @@ public Builder clearInvalidMessages() {
return this;
}
- private int receivedBytes_ ;
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> sentBytes_;
+ private com.google.protobuf.MapField
+ internalGetSentBytes() {
+ if (sentBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ return sentBytes_;
+ }
+ private com.google.protobuf.MapField
+ internalGetMutableSentBytes() {
+ onChanged();;
+ if (sentBytes_ == null) {
+ sentBytes_ = com.google.protobuf.MapField.newMapField(
+ SentBytesDefaultEntryHolder.defaultEntry);
+ }
+ if (!sentBytes_.isMutable()) {
+ sentBytes_ = sentBytes_.copy();
+ }
+ return sentBytes_;
+ }
+
+ public int getSentBytesCount() {
+ return internalGetSentBytes().getMap().size();
+ }
/**
- * int32 received_bytes = 9 [json_name = "receivedBytes"];
- * @return The receivedBytes.
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
*/
+
@java.lang.Override
- public int getReceivedBytes() {
- return receivedBytes_;
+ public boolean containsSentBytes(
+ int key) {
+
+ return internalGetSentBytes().getMap().containsKey(key);
}
/**
- * int32 received_bytes = 9 [json_name = "receivedBytes"];
- * @param value The receivedBytes to set.
- * @return This builder for chaining.
+ * Use {@link #getSentBytesMap()} instead.
+ */
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getSentBytes() {
+ return getSentBytesMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
*/
- public Builder setReceivedBytes(int value) {
+ @java.lang.Override
+
+ public java.util.Map getSentBytesMap() {
+ return internalGetSentBytes().getMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrDefault(
+ int key,
+ long defaultValue) {
- receivedBytes_ = value;
- onChanged();
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ @java.lang.Override
+
+ public long getSentBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetSentBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
+ public Builder clearSentBytes() {
+ internalGetMutableSentBytes().getMutableMap()
+ .clear();
return this;
}
/**
- * int32 received_bytes = 9 [json_name = "receivedBytes"];
- * @return This builder for chaining.
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+
+ public Builder removeSentBytes(
+ int key) {
+
+ internalGetMutableSentBytes().getMutableMap()
+ .remove(key);
+ return this;
+ }
+ /**
+ * Use alternate mutation accessors instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map
+ getMutableSentBytes() {
+ return internalGetMutableSentBytes().getMutableMap();
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+ public Builder putSentBytes(
+ int key,
+ long value) {
+
+
+ internalGetMutableSentBytes().getMutableMap()
+ .put(key, value);
+ return this;
+ }
+ /**
+ * map<int32, int64> sent_bytes = 9 [json_name = "sentBytes"];
+ */
+
+ public Builder putAllSentBytes(
+ java.util.Map values) {
+ internalGetMutableSentBytes().getMutableMap()
+ .putAll(values);
+ return this;
+ }
+
+ private com.google.protobuf.MapField<
+ java.lang.Integer, java.lang.Long> receivedBytes_;
+ private com.google.protobuf.MapField
+ internalGetReceivedBytes() {
+ if (receivedBytes_ == null) {
+ return com.google.protobuf.MapField.emptyMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
+ return receivedBytes_;
+ }
+ private com.google.protobuf.MapField
+ internalGetMutableReceivedBytes() {
+ onChanged();;
+ if (receivedBytes_ == null) {
+ receivedBytes_ = com.google.protobuf.MapField.newMapField(
+ ReceivedBytesDefaultEntryHolder.defaultEntry);
+ }
+ if (!receivedBytes_.isMutable()) {
+ receivedBytes_ = receivedBytes_.copy();
+ }
+ return receivedBytes_;
+ }
+
+ public int getReceivedBytesCount() {
+ return internalGetReceivedBytes().getMap().size();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+
+ @java.lang.Override
+ public boolean containsReceivedBytes(
+ int key) {
+
+ return internalGetReceivedBytes().getMap().containsKey(key);
+ }
+ /**
+ * Use {@link #getReceivedBytesMap()} instead.
*/
+ @java.lang.Override
+ @java.lang.Deprecated
+ public java.util.Map getReceivedBytes() {
+ return getReceivedBytesMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public java.util.Map getReceivedBytesMap() {
+ return internalGetReceivedBytes().getMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrDefault(
+ int key,
+ long defaultValue) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ return map.containsKey(key) ? map.get(key) : defaultValue;
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ @java.lang.Override
+
+ public long getReceivedBytesOrThrow(
+ int key) {
+
+ java.util.Map map =
+ internalGetReceivedBytes().getMap();
+ if (!map.containsKey(key)) {
+ throw new java.lang.IllegalArgumentException();
+ }
+ return map.get(key);
+ }
+
public Builder clearReceivedBytes() {
+ internalGetMutableReceivedBytes().getMutableMap()
+ .clear();
+ return this;
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+
+ public Builder removeReceivedBytes(
+ int key) {
- receivedBytes_ = 0;
- onChanged();
+ internalGetMutableReceivedBytes().getMutableMap()
+ .remove(key);
+ return this;
+ }
+ /**
+ * Use alternate mutation accessors instead.
+ */
+ @java.lang.Deprecated
+ public java.util.Map
+ getMutableReceivedBytes() {
+ return internalGetMutableReceivedBytes().getMutableMap();
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+ public Builder putReceivedBytes(
+ int key,
+ long value) {
+
+
+ internalGetMutableReceivedBytes().getMutableMap()
+ .put(key, value);
+ return this;
+ }
+ /**
+ * map<int32, int64> received_bytes = 10 [json_name = "receivedBytes"];
+ */
+
+ public Builder putAllReceivedBytes(
+ java.util.Map values) {
+ internalGetMutableReceivedBytes().getMutableMap()
+ .putAll(values);
return this;
}
private int status_ ;
/**
- * int32 status = 10 [json_name = "status"];
+ * int32 status = 11 [json_name = "status"];
* @return The status.
*/
@java.lang.Override
@@ -4051,7 +5213,7 @@ public int getStatus() {
return status_;
}
/**
- * int32 status = 10 [json_name = "status"];
+ * int32 status = 11 [json_name = "status"];
* @param value The status to set.
* @return This builder for chaining.
*/
@@ -4062,7 +5224,7 @@ public Builder setStatus(int value) {
return this;
}
/**
- * int32 status = 10 [json_name = "status"];
+ * int32 status = 11 [json_name = "status"];
* @return This builder for chaining.
*/
public Builder clearStatus() {
@@ -4074,7 +5236,7 @@ public Builder clearStatus() {
private long lastSent_ ;
/**
- * int64 last_sent = 11 [json_name = "lastSent"];
+ * int64 last_sent = 12 [json_name = "lastSent"];
* @return The lastSent.
*/
@java.lang.Override
@@ -4082,7 +5244,7 @@ public long getLastSent() {
return lastSent_;
}
/**
- * int64 last_sent = 11 [json_name = "lastSent"];
+ * int64 last_sent = 12 [json_name = "lastSent"];
* @param value The lastSent to set.
* @return This builder for chaining.
*/
@@ -4093,7 +5255,7 @@ public Builder setLastSent(long value) {
return this;
}
/**
- * int64 last_sent = 11 [json_name = "lastSent"];
+ * int64 last_sent = 12 [json_name = "lastSent"];
* @return This builder for chaining.
*/
public Builder clearLastSent() {
@@ -4105,7 +5267,7 @@ public Builder clearLastSent() {
private long lastReceived_ ;
/**
- * int64 last_received = 12 [json_name = "lastReceived"];
+ * int64 last_received = 13 [json_name = "lastReceived"];
* @return The lastReceived.
*/
@java.lang.Override
@@ -4113,7 +5275,7 @@ public long getLastReceived() {
return lastReceived_;
}
/**
- * int64 last_received = 12 [json_name = "lastReceived"];
+ * int64 last_received = 13 [json_name = "lastReceived"];
* @param value The lastReceived to set.
* @return This builder for chaining.
*/
@@ -4124,7 +5286,7 @@ public Builder setLastReceived(long value) {
return this;
}
/**
- * int64 last_received = 12 [json_name = "lastReceived"];
+ * int64 last_received = 13 [json_name = "lastReceived"];
* @return This builder for chaining.
*/
public Builder clearLastReceived() {
@@ -4136,7 +5298,7 @@ public Builder clearLastReceived() {
private int sendSuccess_ ;
/**
- * int32 send_success = 13 [json_name = "sendSuccess"];
+ * int32 send_success = 14 [json_name = "sendSuccess"];
* @return The sendSuccess.
*/
@java.lang.Override
@@ -4144,7 +5306,7 @@ public int getSendSuccess() {
return sendSuccess_;
}
/**
- * int32 send_success = 13 [json_name = "sendSuccess"];
+ * int32 send_success = 14 [json_name = "sendSuccess"];
* @param value The sendSuccess to set.
* @return This builder for chaining.
*/
@@ -4155,7 +5317,7 @@ public Builder setSendSuccess(int value) {
return this;
}
/**
- * int32 send_success = 13 [json_name = "sendSuccess"];
+ * int32 send_success = 14 [json_name = "sendSuccess"];
* @return This builder for chaining.
*/
public Builder clearSendSuccess() {
@@ -4167,7 +5329,7 @@ public Builder clearSendSuccess() {
private int sendFailed_ ;
/**
- * int32 send_failed = 14 [json_name = "sendFailed"];
+ * int32 send_failed = 15 [json_name = "sendFailed"];
* @return The sendFailed.
*/
@java.lang.Override
@@ -4175,7 +5337,7 @@ public int getSendFailed() {
return sendFailed_;
}
/**
- * int32 send_failed = 14 [json_name = "sendFailed"];
+ * int32 send_failed = 15 [json_name = "sendFailed"];
* @param value The sendFailed to set.
* @return This builder for chaining.
*/
@@ -4186,7 +5348,7 @@ public Builder setSendFailed(int value) {
return this;
}
/**
- * int32 send_failed = 14 [json_name = "sendFailed"];
+ * int32 send_failed = 15 [json_name = "sendFailed"];
* @return This builder for chaining.
*/
public Builder clearSendFailed() {
@@ -4195,6 +5357,40 @@ public Builder clearSendFailed() {
onChanged();
return this;
}
+
+ private com.google.protobuf.ByteString lastBlockHash_ = com.google.protobuf.ByteString.EMPTY;
+ /**
+ * bytes last_block_hash = 16 [json_name = "lastBlockHash"];
+ * @return The lastBlockHash.
+ */
+ @java.lang.Override
+ public com.google.protobuf.ByteString getLastBlockHash() {
+ return lastBlockHash_;
+ }
+ /**
+ * bytes last_block_hash = 16 [json_name = "lastBlockHash"];
+ * @param value The lastBlockHash to set.
+ * @return This builder for chaining.
+ */
+ public Builder setLastBlockHash(com.google.protobuf.ByteString value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ lastBlockHash_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * bytes last_block_hash = 16 [json_name = "lastBlockHash"];
+ * @return This builder for chaining.
+ */
+ public Builder clearLastBlockHash() {
+
+ lastBlockHash_ = getDefaultInstance().getLastBlockHash();
+ onChanged();
+ return this;
+ }
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
@@ -4269,6 +5465,16 @@ public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() {
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_pactus_GetNodeInfoRequest_descriptor;
private static final
@@ -4284,6 +5490,16 @@ public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() {
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_pactus_PeerInfo_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_PeerInfo_SentBytesEntry_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_PeerInfo_SentBytesEntry_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_PeerInfo_ReceivedBytesEntry_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
@@ -4294,32 +5510,46 @@ public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() {
static {
java.lang.String[] descriptorData = {
"\n\rnetwork.proto\022\006pactus\"\027\n\025GetNetworkInf" +
- "oRequest\"\273\001\n\026GetNetworkInfoResponse\022(\n\020t" +
+ "oRequest\"\343\003\n\026GetNetworkInfoResponse\022(\n\020t" +
"otal_sent_bytes\030\001 \001(\005R\016totalSentBytes\0220\n" +
"\024total_received_bytes\030\002 \001(\005R\022totalReceiv" +
"edBytes\022\035\n\nstarted_at\030\003 \001(\003R\tstartedAt\022&" +
- "\n\005peers\030\004 \003(\0132\020.pactus.PeerInfoR\005peers\"\024" +
- "\n\022GetNodeInfoRequest\"^\n\023GetNodeInfoRespo" +
- "nse\022\030\n\007moniker\030\001 \001(\tR\007moniker\022\024\n\005agent\030\002" +
- " \001(\tR\005agent\022\027\n\007peer_id\030\003 \001(\014R\006peerId\"\305\003\n" +
- "\010PeerInfo\022\030\n\007moniker\030\001 \001(\tR\007moniker\022\024\n\005a" +
- "gent\030\002 \001(\tR\005agent\022\027\n\007peer_id\030\003 \001(\014R\006peer" +
- "Id\022%\n\016consensus_keys\030\004 \003(\tR\rconsensusKey" +
- "s\022\024\n\005flags\030\005 \001(\005R\005flags\022\026\n\006height\030\006 \001(\rR" +
- "\006height\022+\n\021received_messages\030\007 \001(\005R\020rece" +
- "ivedMessages\022)\n\020invalid_messages\030\010 \001(\005R\017" +
- "invalidMessages\022%\n\016received_bytes\030\t \001(\005R" +
- "\rreceivedBytes\022\026\n\006status\030\n \001(\005R\006status\022\033" +
- "\n\tlast_sent\030\013 \001(\003R\010lastSent\022#\n\rlast_rece" +
- "ived\030\014 \001(\003R\014lastReceived\022!\n\014send_success" +
- "\030\r \001(\005R\013sendSuccess\022\037\n\013send_failed\030\016 \001(\005" +
- "R\nsendFailed2\242\001\n\007Network\022O\n\016GetNetworkIn" +
- "fo\022\035.pactus.GetNetworkInfoRequest\032\036.pact" +
- "us.GetNetworkInfoResponse\022F\n\013GetNodeInfo" +
- "\022\032.pactus.GetNodeInfoRequest\032\033.pactus.Ge" +
- "tNodeInfoResponseBB\n\016pactus.networkZ0git" +
- "hub.com/pactus-project/pactus/www/grpc/p" +
- "actusb\006proto3"
+ "\n\005peers\030\004 \003(\0132\020.pactus.PeerInfoR\005peers\022L" +
+ "\n\nsent_bytes\030\005 \003(\0132-.pactus.GetNetworkIn" +
+ "foResponse.SentBytesEntryR\tsentBytes\022X\n\016" +
+ "received_bytes\030\006 \003(\01321.pactus.GetNetwork" +
+ "InfoResponse.ReceivedBytesEntryR\rreceive" +
+ "dBytes\032<\n\016SentBytesEntry\022\020\n\003key\030\001 \001(\005R\003k" +
+ "ey\022\024\n\005value\030\002 \001(\003R\005value:\0028\001\032@\n\022Received" +
+ "BytesEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 " +
+ "\001(\003R\005value:\0028\001\"\024\n\022GetNodeInfoRequest\"^\n\023" +
+ "GetNodeInfoResponse\022\030\n\007moniker\030\001 \001(\tR\007mo" +
+ "niker\022\024\n\005agent\030\002 \001(\tR\005agent\022\027\n\007peer_id\030\003" +
+ " \001(\014R\006peerId\"\322\005\n\010PeerInfo\022\030\n\007moniker\030\001 \001" +
+ "(\tR\007moniker\022\024\n\005agent\030\002 \001(\tR\005agent\022\027\n\007pee" +
+ "r_id\030\003 \001(\014R\006peerId\022%\n\016consensus_keys\030\004 \003" +
+ "(\tR\rconsensusKeys\022\024\n\005flags\030\005 \001(\005R\005flags\022" +
+ "\026\n\006height\030\006 \001(\rR\006height\022+\n\021received_mess" +
+ "ages\030\007 \001(\005R\020receivedMessages\022)\n\020invalid_" +
+ "messages\030\010 \001(\005R\017invalidMessages\022>\n\nsent_" +
+ "bytes\030\t \003(\0132\037.pactus.PeerInfo.SentBytesE" +
+ "ntryR\tsentBytes\022J\n\016received_bytes\030\n \003(\0132" +
+ "#.pactus.PeerInfo.ReceivedBytesEntryR\rre" +
+ "ceivedBytes\022\026\n\006status\030\013 \001(\005R\006status\022\033\n\tl" +
+ "ast_sent\030\014 \001(\003R\010lastSent\022#\n\rlast_receive" +
+ "d\030\r \001(\003R\014lastReceived\022!\n\014send_success\030\016 " +
+ "\001(\005R\013sendSuccess\022\037\n\013send_failed\030\017 \001(\005R\ns" +
+ "endFailed\022&\n\017last_block_hash\030\020 \001(\014R\rlast" +
+ "BlockHash\032<\n\016SentBytesEntry\022\020\n\003key\030\001 \001(\005" +
+ "R\003key\022\024\n\005value\030\002 \001(\003R\005value:\0028\001\032@\n\022Recei" +
+ "vedBytesEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value" +
+ "\030\002 \001(\003R\005value:\0028\0012\242\001\n\007Network\022O\n\016GetNetw" +
+ "orkInfo\022\035.pactus.GetNetworkInfoRequest\032\036" +
+ ".pactus.GetNetworkInfoResponse\022F\n\013GetNod" +
+ "eInfo\022\032.pactus.GetNodeInfoRequest\032\033.pact" +
+ "us.GetNodeInfoResponseBB\n\016pactus.network" +
+ "Z0github.com/pactus-project/pactus/www/g" +
+ "rpc/pactusb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -4336,7 +5566,19 @@ public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() {
internal_static_pactus_GetNetworkInfoResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetNetworkInfoResponse_descriptor,
- new java.lang.String[] { "TotalSentBytes", "TotalReceivedBytes", "StartedAt", "Peers", });
+ new java.lang.String[] { "TotalSentBytes", "TotalReceivedBytes", "StartedAt", "Peers", "SentBytes", "ReceivedBytes", });
+ internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor =
+ internal_static_pactus_GetNetworkInfoResponse_descriptor.getNestedTypes().get(0);
+ internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_GetNetworkInfoResponse_SentBytesEntry_descriptor,
+ new java.lang.String[] { "Key", "Value", });
+ internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor =
+ internal_static_pactus_GetNetworkInfoResponse_descriptor.getNestedTypes().get(1);
+ internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_GetNetworkInfoResponse_ReceivedBytesEntry_descriptor,
+ new java.lang.String[] { "Key", "Value", });
internal_static_pactus_GetNodeInfoRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_pactus_GetNodeInfoRequest_fieldAccessorTable = new
@@ -4354,7 +5596,19 @@ public pactus.network.NetworkOuterClass.PeerInfo getDefaultInstanceForType() {
internal_static_pactus_PeerInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PeerInfo_descriptor,
- new java.lang.String[] { "Moniker", "Agent", "PeerId", "ConsensusKeys", "Flags", "Height", "ReceivedMessages", "InvalidMessages", "ReceivedBytes", "Status", "LastSent", "LastReceived", "SendSuccess", "SendFailed", });
+ new java.lang.String[] { "Moniker", "Agent", "PeerId", "ConsensusKeys", "Flags", "Height", "ReceivedMessages", "InvalidMessages", "SentBytes", "ReceivedBytes", "Status", "LastSent", "LastReceived", "SendSuccess", "SendFailed", "LastBlockHash", });
+ internal_static_pactus_PeerInfo_SentBytesEntry_descriptor =
+ internal_static_pactus_PeerInfo_descriptor.getNestedTypes().get(0);
+ internal_static_pactus_PeerInfo_SentBytesEntry_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_PeerInfo_SentBytesEntry_descriptor,
+ new java.lang.String[] { "Key", "Value", });
+ internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor =
+ internal_static_pactus_PeerInfo_descriptor.getNestedTypes().get(1);
+ internal_static_pactus_PeerInfo_ReceivedBytesEntry_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_PeerInfo_ReceivedBytesEntry_descriptor,
+ new java.lang.String[] { "Key", "Value", });
}
// @@protoc_insertion_point(outer_class_scope)
diff --git a/www/grpc/gen/java/pactus/transaction/TransactionGrpc.java b/www/grpc/gen/java/pactus/transaction/TransactionGrpc.java
index 421aab7a3..f039f4b79 100644
--- a/www/grpc/gen/java/pactus/transaction/TransactionGrpc.java
+++ b/www/grpc/gen/java/pactus/transaction/TransactionGrpc.java
@@ -46,6 +46,37 @@ pactus.transaction.TransactionOuterClass.GetTransactionResponse> getGetTransacti
return getGetTransactionMethod;
}
+ private static volatile io.grpc.MethodDescriptor getCalculateFeeMethod;
+
+ @io.grpc.stub.annotations.RpcMethod(
+ fullMethodName = SERVICE_NAME + '/' + "CalculateFee",
+ requestType = pactus.transaction.TransactionOuterClass.CalculateFeeRequest.class,
+ responseType = pactus.transaction.TransactionOuterClass.CalculateFeeResponse.class,
+ methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
+ public static io.grpc.MethodDescriptor getCalculateFeeMethod() {
+ io.grpc.MethodDescriptor getCalculateFeeMethod;
+ if ((getCalculateFeeMethod = TransactionGrpc.getCalculateFeeMethod) == null) {
+ synchronized (TransactionGrpc.class) {
+ if ((getCalculateFeeMethod = TransactionGrpc.getCalculateFeeMethod) == null) {
+ TransactionGrpc.getCalculateFeeMethod = getCalculateFeeMethod =
+ io.grpc.MethodDescriptor.newBuilder()
+ .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
+ .setFullMethodName(generateFullMethodName(SERVICE_NAME, "CalculateFee"))
+ .setSampledToLocalTracing(true)
+ .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest.getDefaultInstance()))
+ .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse.getDefaultInstance()))
+ .setSchemaDescriptor(new TransactionMethodDescriptorSupplier("CalculateFee"))
+ .build();
+ }
+ }
+ }
+ return getCalculateFeeMethod;
+ }
+
private static volatile io.grpc.MethodDescriptor getSendRawTransactionMethod;
@@ -132,6 +163,13 @@ public void getTransaction(pactus.transaction.TransactionOuterClass.GetTransacti
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTransactionMethod(), responseObserver);
}
+ /**
+ */
+ public void calculateFee(pactus.transaction.TransactionOuterClass.CalculateFeeRequest request,
+ io.grpc.stub.StreamObserver responseObserver) {
+ io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getCalculateFeeMethod(), responseObserver);
+ }
+
/**
*/
public void sendRawTransaction(pactus.transaction.TransactionOuterClass.SendRawTransactionRequest request,
@@ -148,6 +186,13 @@ public void sendRawTransaction(pactus.transaction.TransactionOuterClass.SendRawT
pactus.transaction.TransactionOuterClass.GetTransactionRequest,
pactus.transaction.TransactionOuterClass.GetTransactionResponse>(
this, METHODID_GET_TRANSACTION)))
+ .addMethod(
+ getCalculateFeeMethod(),
+ io.grpc.stub.ServerCalls.asyncUnaryCall(
+ new MethodHandlers<
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest,
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse>(
+ this, METHODID_CALCULATE_FEE)))
.addMethod(
getSendRawTransactionMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
@@ -181,6 +226,14 @@ public void getTransaction(pactus.transaction.TransactionOuterClass.GetTransacti
getChannel().newCall(getGetTransactionMethod(), getCallOptions()), request, responseObserver);
}
+ /**
+ */
+ public void calculateFee(pactus.transaction.TransactionOuterClass.CalculateFeeRequest request,
+ io.grpc.stub.StreamObserver responseObserver) {
+ io.grpc.stub.ClientCalls.asyncUnaryCall(
+ getChannel().newCall(getCalculateFeeMethod(), getCallOptions()), request, responseObserver);
+ }
+
/**
*/
public void sendRawTransaction(pactus.transaction.TransactionOuterClass.SendRawTransactionRequest request,
@@ -211,6 +264,13 @@ public pactus.transaction.TransactionOuterClass.GetTransactionResponse getTransa
getChannel(), getGetTransactionMethod(), getCallOptions(), request);
}
+ /**
+ */
+ public pactus.transaction.TransactionOuterClass.CalculateFeeResponse calculateFee(pactus.transaction.TransactionOuterClass.CalculateFeeRequest request) {
+ return io.grpc.stub.ClientCalls.blockingUnaryCall(
+ getChannel(), getCalculateFeeMethod(), getCallOptions(), request);
+ }
+
/**
*/
public pactus.transaction.TransactionOuterClass.SendRawTransactionResponse sendRawTransaction(pactus.transaction.TransactionOuterClass.SendRawTransactionRequest request) {
@@ -241,6 +301,14 @@ public com.google.common.util.concurrent.ListenableFuture calculateFee(
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest request) {
+ return io.grpc.stub.ClientCalls.futureUnaryCall(
+ getChannel().newCall(getCalculateFeeMethod(), getCallOptions()), request);
+ }
+
/**
*/
public com.google.common.util.concurrent.ListenableFuture sendRawTransaction(
@@ -251,7 +319,8 @@ public com.google.common.util.concurrent.ListenableFuture implements
io.grpc.stub.ServerCalls.UnaryMethod,
@@ -274,6 +343,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv
serviceImpl.getTransaction((pactus.transaction.TransactionOuterClass.GetTransactionRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
break;
+ case METHODID_CALCULATE_FEE:
+ serviceImpl.calculateFee((pactus.transaction.TransactionOuterClass.CalculateFeeRequest) request,
+ (io.grpc.stub.StreamObserver) responseObserver);
+ break;
case METHODID_SEND_RAW_TRANSACTION:
serviceImpl.sendRawTransaction((pactus.transaction.TransactionOuterClass.SendRawTransactionRequest) request,
(io.grpc.stub.StreamObserver) responseObserver);
@@ -340,6 +413,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
.setSchemaDescriptor(new TransactionFileDescriptorSupplier())
.addMethod(getGetTransactionMethod())
+ .addMethod(getCalculateFeeMethod())
.addMethod(getSendRawTransactionMethod())
.build();
}
diff --git a/www/grpc/gen/java/pactus/transaction/TransactionOuterClass.java b/www/grpc/gen/java/pactus/transaction/TransactionOuterClass.java
index 0e70cf1a6..e7ddea2d8 100644
--- a/www/grpc/gen/java/pactus/transaction/TransactionOuterClass.java
+++ b/www/grpc/gen/java/pactus/transaction/TransactionOuterClass.java
@@ -1583,6 +1583,1054 @@ public pactus.transaction.TransactionOuterClass.GetTransactionResponse getDefaul
}
+ public interface CalculateFeeRequestOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.CalculateFeeRequest)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * int64 amount = 1 [json_name = "amount"];
+ * @return The amount.
+ */
+ long getAmount();
+
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The enum numeric value on the wire for payloadType.
+ */
+ int getPayloadTypeValue();
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The payloadType.
+ */
+ pactus.transaction.TransactionOuterClass.PayloadType getPayloadType();
+ }
+ /**
+ * Protobuf type {@code pactus.CalculateFeeRequest}
+ */
+ public static final class CalculateFeeRequest extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:pactus.CalculateFeeRequest)
+ CalculateFeeRequestOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use CalculateFeeRequest.newBuilder() to construct.
+ private CalculateFeeRequest(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private CalculateFeeRequest() {
+ payloadType_ = 0;
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new CalculateFeeRequest();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeRequest_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest.class, pactus.transaction.TransactionOuterClass.CalculateFeeRequest.Builder.class);
+ }
+
+ public static final int AMOUNT_FIELD_NUMBER = 1;
+ private long amount_;
+ /**
+ * int64 amount = 1 [json_name = "amount"];
+ * @return The amount.
+ */
+ @java.lang.Override
+ public long getAmount() {
+ return amount_;
+ }
+
+ public static final int PAYLOADTYPE_FIELD_NUMBER = 2;
+ private int payloadType_;
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The enum numeric value on the wire for payloadType.
+ */
+ @java.lang.Override public int getPayloadTypeValue() {
+ return payloadType_;
+ }
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The payloadType.
+ */
+ @java.lang.Override public pactus.transaction.TransactionOuterClass.PayloadType getPayloadType() {
+ @SuppressWarnings("deprecation")
+ pactus.transaction.TransactionOuterClass.PayloadType result = pactus.transaction.TransactionOuterClass.PayloadType.valueOf(payloadType_);
+ return result == null ? pactus.transaction.TransactionOuterClass.PayloadType.UNRECOGNIZED : result;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (amount_ != 0L) {
+ output.writeInt64(1, amount_);
+ }
+ if (payloadType_ != pactus.transaction.TransactionOuterClass.PayloadType.UNKNOWN.getNumber()) {
+ output.writeEnum(2, payloadType_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (amount_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, amount_);
+ }
+ if (payloadType_ != pactus.transaction.TransactionOuterClass.PayloadType.UNKNOWN.getNumber()) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeEnumSize(2, payloadType_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof pactus.transaction.TransactionOuterClass.CalculateFeeRequest)) {
+ return super.equals(obj);
+ }
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest other = (pactus.transaction.TransactionOuterClass.CalculateFeeRequest) obj;
+
+ if (getAmount()
+ != other.getAmount()) return false;
+ if (payloadType_ != other.payloadType_) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + AMOUNT_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getAmount());
+ hash = (37 * hash) + PAYLOADTYPE_FIELD_NUMBER;
+ hash = (53 * hash) + payloadType_;
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(pactus.transaction.TransactionOuterClass.CalculateFeeRequest prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code pactus.CalculateFeeRequest}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:pactus.CalculateFeeRequest)
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequestOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeRequest_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeRequest_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest.class, pactus.transaction.TransactionOuterClass.CalculateFeeRequest.Builder.class);
+ }
+
+ // Construct using pactus.transaction.TransactionOuterClass.CalculateFeeRequest.newBuilder()
+ private Builder() {
+
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ amount_ = 0L;
+
+ payloadType_ = 0;
+
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeRequest_descriptor;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeRequest getDefaultInstanceForType() {
+ return pactus.transaction.TransactionOuterClass.CalculateFeeRequest.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeRequest build() {
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeRequest buildPartial() {
+ pactus.transaction.TransactionOuterClass.CalculateFeeRequest result = new pactus.transaction.TransactionOuterClass.CalculateFeeRequest(this);
+ result.amount_ = amount_;
+ result.payloadType_ = payloadType_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof pactus.transaction.TransactionOuterClass.CalculateFeeRequest) {
+ return mergeFrom((pactus.transaction.TransactionOuterClass.CalculateFeeRequest)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(pactus.transaction.TransactionOuterClass.CalculateFeeRequest other) {
+ if (other == pactus.transaction.TransactionOuterClass.CalculateFeeRequest.getDefaultInstance()) return this;
+ if (other.getAmount() != 0L) {
+ setAmount(other.getAmount());
+ }
+ if (other.payloadType_ != 0) {
+ setPayloadTypeValue(other.getPayloadTypeValue());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ amount_ = input.readInt64();
+
+ break;
+ } // case 8
+ case 16: {
+ payloadType_ = input.readEnum();
+
+ break;
+ } // case 16
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.unwrapIOException();
+ } finally {
+ onChanged();
+ } // finally
+ return this;
+ }
+
+ private long amount_ ;
+ /**
+ * int64 amount = 1 [json_name = "amount"];
+ * @return The amount.
+ */
+ @java.lang.Override
+ public long getAmount() {
+ return amount_;
+ }
+ /**
+ * int64 amount = 1 [json_name = "amount"];
+ * @param value The amount to set.
+ * @return This builder for chaining.
+ */
+ public Builder setAmount(long value) {
+
+ amount_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 amount = 1 [json_name = "amount"];
+ * @return This builder for chaining.
+ */
+ public Builder clearAmount() {
+
+ amount_ = 0L;
+ onChanged();
+ return this;
+ }
+
+ private int payloadType_ = 0;
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The enum numeric value on the wire for payloadType.
+ */
+ @java.lang.Override public int getPayloadTypeValue() {
+ return payloadType_;
+ }
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @param value The enum numeric value on the wire for payloadType to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPayloadTypeValue(int value) {
+
+ payloadType_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return The payloadType.
+ */
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.PayloadType getPayloadType() {
+ @SuppressWarnings("deprecation")
+ pactus.transaction.TransactionOuterClass.PayloadType result = pactus.transaction.TransactionOuterClass.PayloadType.valueOf(payloadType_);
+ return result == null ? pactus.transaction.TransactionOuterClass.PayloadType.UNRECOGNIZED : result;
+ }
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @param value The payloadType to set.
+ * @return This builder for chaining.
+ */
+ public Builder setPayloadType(pactus.transaction.TransactionOuterClass.PayloadType value) {
+ if (value == null) {
+ throw new NullPointerException();
+ }
+
+ payloadType_ = value.getNumber();
+ onChanged();
+ return this;
+ }
+ /**
+ * .pactus.PayloadType payloadType = 2 [json_name = "payloadType"];
+ * @return This builder for chaining.
+ */
+ public Builder clearPayloadType() {
+
+ payloadType_ = 0;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:pactus.CalculateFeeRequest)
+ }
+
+ // @@protoc_insertion_point(class_scope:pactus.CalculateFeeRequest)
+ private static final pactus.transaction.TransactionOuterClass.CalculateFeeRequest DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new pactus.transaction.TransactionOuterClass.CalculateFeeRequest();
+ }
+
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeRequest getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ @java.lang.Override
+ public CalculateFeeRequest parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ Builder builder = newBuilder();
+ try {
+ builder.mergeFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(builder.buildPartial());
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(builder.buildPartial());
+ }
+ return builder.buildPartial();
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeRequest getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
+ public interface CalculateFeeResponseOrBuilder extends
+ // @@protoc_insertion_point(interface_extends:pactus.CalculateFeeResponse)
+ com.google.protobuf.MessageOrBuilder {
+
+ /**
+ * int64 fee = 1 [json_name = "fee"];
+ * @return The fee.
+ */
+ long getFee();
+ }
+ /**
+ * Protobuf type {@code pactus.CalculateFeeResponse}
+ */
+ public static final class CalculateFeeResponse extends
+ com.google.protobuf.GeneratedMessageV3 implements
+ // @@protoc_insertion_point(message_implements:pactus.CalculateFeeResponse)
+ CalculateFeeResponseOrBuilder {
+ private static final long serialVersionUID = 0L;
+ // Use CalculateFeeResponse.newBuilder() to construct.
+ private CalculateFeeResponse(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
+ super(builder);
+ }
+ private CalculateFeeResponse() {
+ }
+
+ @java.lang.Override
+ @SuppressWarnings({"unused"})
+ protected java.lang.Object newInstance(
+ UnusedPrivateParameter unused) {
+ return new CalculateFeeResponse();
+ }
+
+ @java.lang.Override
+ public final com.google.protobuf.UnknownFieldSet
+ getUnknownFields() {
+ return this.unknownFields;
+ }
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeResponse_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeResponse_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse.class, pactus.transaction.TransactionOuterClass.CalculateFeeResponse.Builder.class);
+ }
+
+ public static final int FEE_FIELD_NUMBER = 1;
+ private long fee_;
+ /**
+ * int64 fee = 1 [json_name = "fee"];
+ * @return The fee.
+ */
+ @java.lang.Override
+ public long getFee() {
+ return fee_;
+ }
+
+ private byte memoizedIsInitialized = -1;
+ @java.lang.Override
+ public final boolean isInitialized() {
+ byte isInitialized = memoizedIsInitialized;
+ if (isInitialized == 1) return true;
+ if (isInitialized == 0) return false;
+
+ memoizedIsInitialized = 1;
+ return true;
+ }
+
+ @java.lang.Override
+ public void writeTo(com.google.protobuf.CodedOutputStream output)
+ throws java.io.IOException {
+ if (fee_ != 0L) {
+ output.writeInt64(1, fee_);
+ }
+ getUnknownFields().writeTo(output);
+ }
+
+ @java.lang.Override
+ public int getSerializedSize() {
+ int size = memoizedSize;
+ if (size != -1) return size;
+
+ size = 0;
+ if (fee_ != 0L) {
+ size += com.google.protobuf.CodedOutputStream
+ .computeInt64Size(1, fee_);
+ }
+ size += getUnknownFields().getSerializedSize();
+ memoizedSize = size;
+ return size;
+ }
+
+ @java.lang.Override
+ public boolean equals(final java.lang.Object obj) {
+ if (obj == this) {
+ return true;
+ }
+ if (!(obj instanceof pactus.transaction.TransactionOuterClass.CalculateFeeResponse)) {
+ return super.equals(obj);
+ }
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse other = (pactus.transaction.TransactionOuterClass.CalculateFeeResponse) obj;
+
+ if (getFee()
+ != other.getFee()) return false;
+ if (!getUnknownFields().equals(other.getUnknownFields())) return false;
+ return true;
+ }
+
+ @java.lang.Override
+ public int hashCode() {
+ if (memoizedHashCode != 0) {
+ return memoizedHashCode;
+ }
+ int hash = 41;
+ hash = (19 * hash) + getDescriptor().hashCode();
+ hash = (37 * hash) + FEE_FIELD_NUMBER;
+ hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
+ getFee());
+ hash = (29 * hash) + getUnknownFields().hashCode();
+ memoizedHashCode = hash;
+ return hash;
+ }
+
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ java.nio.ByteBuffer data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ java.nio.ByteBuffer data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ com.google.protobuf.ByteString data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ com.google.protobuf.ByteString data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(byte[] data)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ byte[] data,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ return PARSER.parseFrom(data, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseDelimitedFrom(java.io.InputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseDelimitedFrom(
+ java.io.InputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ com.google.protobuf.CodedInputStream input)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input);
+ }
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse parseFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ return com.google.protobuf.GeneratedMessageV3
+ .parseWithIOException(PARSER, input, extensionRegistry);
+ }
+
+ @java.lang.Override
+ public Builder newBuilderForType() { return newBuilder(); }
+ public static Builder newBuilder() {
+ return DEFAULT_INSTANCE.toBuilder();
+ }
+ public static Builder newBuilder(pactus.transaction.TransactionOuterClass.CalculateFeeResponse prototype) {
+ return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
+ }
+ @java.lang.Override
+ public Builder toBuilder() {
+ return this == DEFAULT_INSTANCE
+ ? new Builder() : new Builder().mergeFrom(this);
+ }
+
+ @java.lang.Override
+ protected Builder newBuilderForType(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ Builder builder = new Builder(parent);
+ return builder;
+ }
+ /**
+ * Protobuf type {@code pactus.CalculateFeeResponse}
+ */
+ public static final class Builder extends
+ com.google.protobuf.GeneratedMessageV3.Builder implements
+ // @@protoc_insertion_point(builder_implements:pactus.CalculateFeeResponse)
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponseOrBuilder {
+ public static final com.google.protobuf.Descriptors.Descriptor
+ getDescriptor() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeResponse_descriptor;
+ }
+
+ @java.lang.Override
+ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internalGetFieldAccessorTable() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeResponse_fieldAccessorTable
+ .ensureFieldAccessorsInitialized(
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse.class, pactus.transaction.TransactionOuterClass.CalculateFeeResponse.Builder.class);
+ }
+
+ // Construct using pactus.transaction.TransactionOuterClass.CalculateFeeResponse.newBuilder()
+ private Builder() {
+
+ }
+
+ private Builder(
+ com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
+ super(parent);
+
+ }
+ @java.lang.Override
+ public Builder clear() {
+ super.clear();
+ fee_ = 0L;
+
+ return this;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Descriptors.Descriptor
+ getDescriptorForType() {
+ return pactus.transaction.TransactionOuterClass.internal_static_pactus_CalculateFeeResponse_descriptor;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeResponse getDefaultInstanceForType() {
+ return pactus.transaction.TransactionOuterClass.CalculateFeeResponse.getDefaultInstance();
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeResponse build() {
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse result = buildPartial();
+ if (!result.isInitialized()) {
+ throw newUninitializedMessageException(result);
+ }
+ return result;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeResponse buildPartial() {
+ pactus.transaction.TransactionOuterClass.CalculateFeeResponse result = new pactus.transaction.TransactionOuterClass.CalculateFeeResponse(this);
+ result.fee_ = fee_;
+ onBuilt();
+ return result;
+ }
+
+ @java.lang.Override
+ public Builder clone() {
+ return super.clone();
+ }
+ @java.lang.Override
+ public Builder setField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.setField(field, value);
+ }
+ @java.lang.Override
+ public Builder clearField(
+ com.google.protobuf.Descriptors.FieldDescriptor field) {
+ return super.clearField(field);
+ }
+ @java.lang.Override
+ public Builder clearOneof(
+ com.google.protobuf.Descriptors.OneofDescriptor oneof) {
+ return super.clearOneof(oneof);
+ }
+ @java.lang.Override
+ public Builder setRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ int index, java.lang.Object value) {
+ return super.setRepeatedField(field, index, value);
+ }
+ @java.lang.Override
+ public Builder addRepeatedField(
+ com.google.protobuf.Descriptors.FieldDescriptor field,
+ java.lang.Object value) {
+ return super.addRepeatedField(field, value);
+ }
+ @java.lang.Override
+ public Builder mergeFrom(com.google.protobuf.Message other) {
+ if (other instanceof pactus.transaction.TransactionOuterClass.CalculateFeeResponse) {
+ return mergeFrom((pactus.transaction.TransactionOuterClass.CalculateFeeResponse)other);
+ } else {
+ super.mergeFrom(other);
+ return this;
+ }
+ }
+
+ public Builder mergeFrom(pactus.transaction.TransactionOuterClass.CalculateFeeResponse other) {
+ if (other == pactus.transaction.TransactionOuterClass.CalculateFeeResponse.getDefaultInstance()) return this;
+ if (other.getFee() != 0L) {
+ setFee(other.getFee());
+ }
+ this.mergeUnknownFields(other.getUnknownFields());
+ onChanged();
+ return this;
+ }
+
+ @java.lang.Override
+ public final boolean isInitialized() {
+ return true;
+ }
+
+ @java.lang.Override
+ public Builder mergeFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws java.io.IOException {
+ if (extensionRegistry == null) {
+ throw new java.lang.NullPointerException();
+ }
+ try {
+ boolean done = false;
+ while (!done) {
+ int tag = input.readTag();
+ switch (tag) {
+ case 0:
+ done = true;
+ break;
+ case 8: {
+ fee_ = input.readInt64();
+
+ break;
+ } // case 8
+ default: {
+ if (!super.parseUnknownField(input, extensionRegistry, tag)) {
+ done = true; // was an endgroup tag
+ }
+ break;
+ } // default:
+ } // switch (tag)
+ } // while (!done)
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.unwrapIOException();
+ } finally {
+ onChanged();
+ } // finally
+ return this;
+ }
+
+ private long fee_ ;
+ /**
+ * int64 fee = 1 [json_name = "fee"];
+ * @return The fee.
+ */
+ @java.lang.Override
+ public long getFee() {
+ return fee_;
+ }
+ /**
+ * int64 fee = 1 [json_name = "fee"];
+ * @param value The fee to set.
+ * @return This builder for chaining.
+ */
+ public Builder setFee(long value) {
+
+ fee_ = value;
+ onChanged();
+ return this;
+ }
+ /**
+ * int64 fee = 1 [json_name = "fee"];
+ * @return This builder for chaining.
+ */
+ public Builder clearFee() {
+
+ fee_ = 0L;
+ onChanged();
+ return this;
+ }
+ @java.lang.Override
+ public final Builder setUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.setUnknownFields(unknownFields);
+ }
+
+ @java.lang.Override
+ public final Builder mergeUnknownFields(
+ final com.google.protobuf.UnknownFieldSet unknownFields) {
+ return super.mergeUnknownFields(unknownFields);
+ }
+
+
+ // @@protoc_insertion_point(builder_scope:pactus.CalculateFeeResponse)
+ }
+
+ // @@protoc_insertion_point(class_scope:pactus.CalculateFeeResponse)
+ private static final pactus.transaction.TransactionOuterClass.CalculateFeeResponse DEFAULT_INSTANCE;
+ static {
+ DEFAULT_INSTANCE = new pactus.transaction.TransactionOuterClass.CalculateFeeResponse();
+ }
+
+ public static pactus.transaction.TransactionOuterClass.CalculateFeeResponse getDefaultInstance() {
+ return DEFAULT_INSTANCE;
+ }
+
+ private static final com.google.protobuf.Parser
+ PARSER = new com.google.protobuf.AbstractParser() {
+ @java.lang.Override
+ public CalculateFeeResponse parsePartialFrom(
+ com.google.protobuf.CodedInputStream input,
+ com.google.protobuf.ExtensionRegistryLite extensionRegistry)
+ throws com.google.protobuf.InvalidProtocolBufferException {
+ Builder builder = newBuilder();
+ try {
+ builder.mergeFrom(input, extensionRegistry);
+ } catch (com.google.protobuf.InvalidProtocolBufferException e) {
+ throw e.setUnfinishedMessage(builder.buildPartial());
+ } catch (com.google.protobuf.UninitializedMessageException e) {
+ throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
+ } catch (java.io.IOException e) {
+ throw new com.google.protobuf.InvalidProtocolBufferException(e)
+ .setUnfinishedMessage(builder.buildPartial());
+ }
+ return builder.buildPartial();
+ }
+ };
+
+ public static com.google.protobuf.Parser parser() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public com.google.protobuf.Parser getParserForType() {
+ return PARSER;
+ }
+
+ @java.lang.Override
+ public pactus.transaction.TransactionOuterClass.CalculateFeeResponse getDefaultInstanceForType() {
+ return DEFAULT_INSTANCE;
+ }
+
+ }
+
public interface SendRawTransactionRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:pactus.SendRawTransactionRequest)
com.google.protobuf.MessageOrBuilder {
@@ -6057,12 +7105,12 @@ public interface TransactionInfoOrBuilder extends
long getFee();
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The enum numeric value on the wire for payloadType.
*/
int getPayloadTypeValue();
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The payloadType.
*/
pactus.transaction.TransactionOuterClass.PayloadType getPayloadType();
@@ -6348,14 +7396,14 @@ public long getFee() {
public static final int PAYLOADTYPE_FIELD_NUMBER = 8;
private int payloadType_;
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The enum numeric value on the wire for payloadType.
*/
@java.lang.Override public int getPayloadTypeValue() {
return payloadType_;
}
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The payloadType.
*/
@java.lang.Override public pactus.transaction.TransactionOuterClass.PayloadType getPayloadType() {
@@ -7582,14 +8630,14 @@ public Builder clearFee() {
private int payloadType_ = 0;
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The enum numeric value on the wire for payloadType.
*/
@java.lang.Override public int getPayloadTypeValue() {
return payloadType_;
}
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @param value The enum numeric value on the wire for payloadType to set.
* @return This builder for chaining.
*/
@@ -7600,7 +8648,7 @@ public Builder setPayloadTypeValue(int value) {
return this;
}
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return The payloadType.
*/
@java.lang.Override
@@ -7610,7 +8658,7 @@ public pactus.transaction.TransactionOuterClass.PayloadType getPayloadType() {
return result == null ? pactus.transaction.TransactionOuterClass.PayloadType.UNRECOGNIZED : result;
}
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @param value The payloadType to set.
* @return This builder for chaining.
*/
@@ -7624,7 +8672,7 @@ public Builder setPayloadType(pactus.transaction.TransactionOuterClass.PayloadTy
return this;
}
/**
- * .pactus.PayloadType PayloadType = 8 [json_name = "PayloadType"];
+ * .pactus.PayloadType payloadType = 8 [json_name = "payloadType"];
* @return This builder for chaining.
*/
public Builder clearPayloadType() {
@@ -8603,6 +9651,16 @@ public pactus.transaction.TransactionOuterClass.TransactionInfo getDefaultInstan
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_pactus_GetTransactionResponse_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_CalculateFeeRequest_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_CalculateFeeRequest_fieldAccessorTable;
+ private static final com.google.protobuf.Descriptors.Descriptor
+ internal_static_pactus_CalculateFeeResponse_descriptor;
+ private static final
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
+ internal_static_pactus_CalculateFeeResponse_fieldAccessorTable;
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_pactus_SendRawTransactionRequest_descriptor;
private static final
@@ -8659,45 +9717,50 @@ public pactus.transaction.TransactionOuterClass.TransactionInfo getDefaultInstan
"lock_height\030\014 \001(\rR\013blockHeight\022\035\n\nblock_" +
"time\030\r \001(\rR\tblockTime\0229\n\013transaction\030\003 \001" +
"(\0132\027.pactus.TransactionInfoR\013transaction" +
- "\"/\n\031SendRawTransactionRequest\022\022\n\004data\030\001 " +
- "\001(\014R\004data\",\n\032SendRawTransactionResponse\022" +
- "\016\n\002id\030\002 \001(\014R\002id\"]\n\017PayloadTransfer\022\026\n\006se" +
- "nder\030\001 \001(\tR\006sender\022\032\n\010receiver\030\002 \001(\tR\010re" +
- "ceiver\022\026\n\006amount\030\003 \001(\003R\006amount\"W\n\013Payloa" +
- "dBond\022\026\n\006sender\030\001 \001(\tR\006sender\022\032\n\010receive" +
- "r\030\002 \001(\tR\010receiver\022\024\n\005stake\030\003 \001(\003R\005stake\"" +
- "B\n\020PayloadSortition\022\030\n\007address\030\001 \001(\tR\007ad" +
- "dress\022\024\n\005proof\030\002 \001(\014R\005proof\"-\n\rPayloadUn" +
- "bond\022\034\n\tvalidator\030\001 \001(\tR\tvalidator\"M\n\017Pa" +
- "yloadWithdraw\022\022\n\004from\030\001 \001(\tR\004from\022\016\n\002to\030" +
- "\002 \001(\tR\002to\022\026\n\006amount\030\003 \001(\003R\006amount\"\300\004\n\017Tr" +
- "ansactionInfo\022\016\n\002id\030\001 \001(\014R\002id\022\022\n\004data\030\002 " +
- "\001(\014R\004data\022\030\n\007version\030\003 \001(\005R\007version\022\024\n\005s" +
- "tamp\030\004 \001(\014R\005stamp\022\032\n\010sequence\030\005 \001(\005R\010seq" +
- "uence\022\024\n\005value\030\006 \001(\003R\005value\022\020\n\003fee\030\007 \001(\003" +
- "R\003fee\0225\n\013PayloadType\030\010 \001(\0162\023.pactus.Payl" +
- "oadTypeR\013PayloadType\0225\n\010transfer\030\036 \001(\0132\027" +
- ".pactus.PayloadTransferH\000R\010transfer\022)\n\004b" +
- "ond\030\037 \001(\0132\023.pactus.PayloadBondH\000R\004bond\0228" +
- "\n\tsortition\030 \001(\0132\030.pactus.PayloadSortit" +
- "ionH\000R\tsortition\022/\n\006unbond\030! \001(\0132\025.pactu" +
- "s.PayloadUnbondH\000R\006unbond\0225\n\010withdraw\030\" " +
- "\001(\0132\027.pactus.PayloadWithdrawH\000R\010withdraw" +
- "\022\022\n\004memo\030\t \001(\tR\004memo\022\035\n\npublic_key\030\n \001(\t" +
- "R\tpublicKey\022\034\n\tsignature\030\013 \001(\014R\tsignatur" +
- "eB\t\n\007Payload*\203\001\n\013PayloadType\022\013\n\007UNKNOWN\020" +
- "\000\022\024\n\020TRANSFER_PAYLOAD\020\001\022\020\n\014BOND_PAYLOAD\020" +
- "\002\022\025\n\021SORTITION_PAYLOAD\020\003\022\022\n\016UNBOND_PAYLO" +
- "AD\020\004\022\024\n\020WITHDRAW_PAYLOAD\020\005*B\n\024Transactio" +
- "nVerbosity\022\024\n\020TRANSACTION_DATA\020\000\022\024\n\020TRAN" +
- "SACTION_INFO\020\0012\273\001\n\013Transaction\022O\n\016GetTra" +
- "nsaction\022\035.pactus.GetTransactionRequest\032" +
- "\036.pactus.GetTransactionResponse\022[\n\022SendR" +
- "awTransaction\022!.pactus.SendRawTransactio" +
- "nRequest\032\".pactus.SendRawTransactionResp" +
- "onseBF\n\022pactus.transactionZ0github.com/p" +
- "actus-project/pactus/www/grpc/pactusb\006pr" +
- "oto3"
+ "\"d\n\023CalculateFeeRequest\022\026\n\006amount\030\001 \001(\003R" +
+ "\006amount\0225\n\013payloadType\030\002 \001(\0162\023.pactus.Pa" +
+ "yloadTypeR\013payloadType\"(\n\024CalculateFeeRe" +
+ "sponse\022\020\n\003fee\030\001 \001(\003R\003fee\"/\n\031SendRawTrans" +
+ "actionRequest\022\022\n\004data\030\001 \001(\014R\004data\",\n\032Sen" +
+ "dRawTransactionResponse\022\016\n\002id\030\002 \001(\014R\002id\"" +
+ "]\n\017PayloadTransfer\022\026\n\006sender\030\001 \001(\tR\006send" +
+ "er\022\032\n\010receiver\030\002 \001(\tR\010receiver\022\026\n\006amount" +
+ "\030\003 \001(\003R\006amount\"W\n\013PayloadBond\022\026\n\006sender\030" +
+ "\001 \001(\tR\006sender\022\032\n\010receiver\030\002 \001(\tR\010receive" +
+ "r\022\024\n\005stake\030\003 \001(\003R\005stake\"B\n\020PayloadSortit" +
+ "ion\022\030\n\007address\030\001 \001(\tR\007address\022\024\n\005proof\030\002" +
+ " \001(\014R\005proof\"-\n\rPayloadUnbond\022\034\n\tvalidato" +
+ "r\030\001 \001(\tR\tvalidator\"M\n\017PayloadWithdraw\022\022\n" +
+ "\004from\030\001 \001(\tR\004from\022\016\n\002to\030\002 \001(\tR\002to\022\026\n\006amo" +
+ "unt\030\003 \001(\003R\006amount\"\300\004\n\017TransactionInfo\022\016\n" +
+ "\002id\030\001 \001(\014R\002id\022\022\n\004data\030\002 \001(\014R\004data\022\030\n\007ver" +
+ "sion\030\003 \001(\005R\007version\022\024\n\005stamp\030\004 \001(\014R\005stam" +
+ "p\022\032\n\010sequence\030\005 \001(\005R\010sequence\022\024\n\005value\030\006" +
+ " \001(\003R\005value\022\020\n\003fee\030\007 \001(\003R\003fee\0225\n\013payload" +
+ "Type\030\010 \001(\0162\023.pactus.PayloadTypeR\013payload" +
+ "Type\0225\n\010transfer\030\036 \001(\0132\027.pactus.PayloadT" +
+ "ransferH\000R\010transfer\022)\n\004bond\030\037 \001(\0132\023.pact" +
+ "us.PayloadBondH\000R\004bond\0228\n\tsortition\030 \001(" +
+ "\0132\030.pactus.PayloadSortitionH\000R\tsortition" +
+ "\022/\n\006unbond\030! \001(\0132\025.pactus.PayloadUnbondH" +
+ "\000R\006unbond\0225\n\010withdraw\030\" \001(\0132\027.pactus.Pay" +
+ "loadWithdrawH\000R\010withdraw\022\022\n\004memo\030\t \001(\tR\004" +
+ "memo\022\035\n\npublic_key\030\n \001(\tR\tpublicKey\022\034\n\ts" +
+ "ignature\030\013 \001(\014R\tsignatureB\t\n\007payload*\203\001\n" +
+ "\013PayloadType\022\013\n\007UNKNOWN\020\000\022\024\n\020TRANSFER_PA" +
+ "YLOAD\020\001\022\020\n\014BOND_PAYLOAD\020\002\022\025\n\021SORTITION_P" +
+ "AYLOAD\020\003\022\022\n\016UNBOND_PAYLOAD\020\004\022\024\n\020WITHDRAW" +
+ "_PAYLOAD\020\005*B\n\024TransactionVerbosity\022\024\n\020TR" +
+ "ANSACTION_DATA\020\000\022\024\n\020TRANSACTION_INFO\020\0012\206" +
+ "\002\n\013Transaction\022O\n\016GetTransaction\022\035.pactu" +
+ "s.GetTransactionRequest\032\036.pactus.GetTran" +
+ "sactionResponse\022I\n\014CalculateFee\022\033.pactus" +
+ ".CalculateFeeRequest\032\034.pactus.CalculateF" +
+ "eeResponse\022[\n\022SendRawTransaction\022!.pactu" +
+ "s.SendRawTransactionRequest\032\".pactus.Sen" +
+ "dRawTransactionResponseBF\n\022pactus.transa" +
+ "ctionZ0github.com/pactus-project/pactus/" +
+ "www/grpc/pactusb\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
@@ -8715,50 +9778,62 @@ public pactus.transaction.TransactionOuterClass.TransactionInfo getDefaultInstan
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_GetTransactionResponse_descriptor,
new java.lang.String[] { "BlockHeight", "BlockTime", "Transaction", });
- internal_static_pactus_SendRawTransactionRequest_descriptor =
+ internal_static_pactus_CalculateFeeRequest_descriptor =
getDescriptor().getMessageTypes().get(2);
+ internal_static_pactus_CalculateFeeRequest_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_CalculateFeeRequest_descriptor,
+ new java.lang.String[] { "Amount", "PayloadType", });
+ internal_static_pactus_CalculateFeeResponse_descriptor =
+ getDescriptor().getMessageTypes().get(3);
+ internal_static_pactus_CalculateFeeResponse_fieldAccessorTable = new
+ com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
+ internal_static_pactus_CalculateFeeResponse_descriptor,
+ new java.lang.String[] { "Fee", });
+ internal_static_pactus_SendRawTransactionRequest_descriptor =
+ getDescriptor().getMessageTypes().get(4);
internal_static_pactus_SendRawTransactionRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_SendRawTransactionRequest_descriptor,
new java.lang.String[] { "Data", });
internal_static_pactus_SendRawTransactionResponse_descriptor =
- getDescriptor().getMessageTypes().get(3);
+ getDescriptor().getMessageTypes().get(5);
internal_static_pactus_SendRawTransactionResponse_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_SendRawTransactionResponse_descriptor,
new java.lang.String[] { "Id", });
internal_static_pactus_PayloadTransfer_descriptor =
- getDescriptor().getMessageTypes().get(4);
+ getDescriptor().getMessageTypes().get(6);
internal_static_pactus_PayloadTransfer_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PayloadTransfer_descriptor,
new java.lang.String[] { "Sender", "Receiver", "Amount", });
internal_static_pactus_PayloadBond_descriptor =
- getDescriptor().getMessageTypes().get(5);
+ getDescriptor().getMessageTypes().get(7);
internal_static_pactus_PayloadBond_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PayloadBond_descriptor,
new java.lang.String[] { "Sender", "Receiver", "Stake", });
internal_static_pactus_PayloadSortition_descriptor =
- getDescriptor().getMessageTypes().get(6);
+ getDescriptor().getMessageTypes().get(8);
internal_static_pactus_PayloadSortition_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PayloadSortition_descriptor,
new java.lang.String[] { "Address", "Proof", });
internal_static_pactus_PayloadUnbond_descriptor =
- getDescriptor().getMessageTypes().get(7);
+ getDescriptor().getMessageTypes().get(9);
internal_static_pactus_PayloadUnbond_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PayloadUnbond_descriptor,
new java.lang.String[] { "Validator", });
internal_static_pactus_PayloadWithdraw_descriptor =
- getDescriptor().getMessageTypes().get(8);
+ getDescriptor().getMessageTypes().get(10);
internal_static_pactus_PayloadWithdraw_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_PayloadWithdraw_descriptor,
new java.lang.String[] { "From", "To", "Amount", });
internal_static_pactus_TransactionInfo_descriptor =
- getDescriptor().getMessageTypes().get(9);
+ getDescriptor().getMessageTypes().get(11);
internal_static_pactus_TransactionInfo_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_pactus_TransactionInfo_descriptor,
diff --git a/www/grpc/gen/js/blockchain_grpc_pb.js b/www/grpc/gen/js/blockchain_grpc_pb.js
index 96575481c..c639ccb7a 100644
--- a/www/grpc/gen/js/blockchain_grpc_pb.js
+++ b/www/grpc/gen/js/blockchain_grpc_pb.js
@@ -203,28 +203,6 @@ function deserialize_pactus_GetValidatorResponse(buffer_arg) {
return blockchain_pb.GetValidatorResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
-function serialize_pactus_GetValidatorsRequest(arg) {
- if (!(arg instanceof blockchain_pb.GetValidatorsRequest)) {
- throw new Error('Expected argument of type pactus.GetValidatorsRequest');
- }
- return Buffer.from(arg.serializeBinary());
-}
-
-function deserialize_pactus_GetValidatorsRequest(buffer_arg) {
- return blockchain_pb.GetValidatorsRequest.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
-function serialize_pactus_GetValidatorsResponse(arg) {
- if (!(arg instanceof blockchain_pb.GetValidatorsResponse)) {
- throw new Error('Expected argument of type pactus.GetValidatorsResponse');
- }
- return Buffer.from(arg.serializeBinary());
-}
-
-function deserialize_pactus_GetValidatorsResponse(buffer_arg) {
- return blockchain_pb.GetValidatorsResponse.deserializeBinary(new Uint8Array(buffer_arg));
-}
-
var BlockchainService = exports.BlockchainService = {
getBlock: {
@@ -337,17 +315,6 @@ var BlockchainService = exports.BlockchainService = {
responseSerialize: serialize_pactus_GetValidatorAddressesResponse,
responseDeserialize: deserialize_pactus_GetValidatorAddressesResponse,
},
- getValidators: {
- path: '/pactus.Blockchain/GetValidators',
- requestStream: false,
- responseStream: false,
- requestType: blockchain_pb.GetValidatorsRequest,
- responseType: blockchain_pb.GetValidatorsResponse,
- requestSerialize: serialize_pactus_GetValidatorsRequest,
- requestDeserialize: deserialize_pactus_GetValidatorsRequest,
- responseSerialize: serialize_pactus_GetValidatorsResponse,
- responseDeserialize: deserialize_pactus_GetValidatorsResponse,
- },
};
exports.BlockchainClient = grpc.makeGenericClientConstructor(BlockchainService);
diff --git a/www/grpc/gen/js/blockchain_pb.js b/www/grpc/gen/js/blockchain_pb.js
index a7ef091f6..8e83732b3 100644
--- a/www/grpc/gen/js/blockchain_pb.js
+++ b/www/grpc/gen/js/blockchain_pb.js
@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
-var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
+var global =
+ (typeof globalThis !== 'undefined' && globalThis) ||
+ (typeof window !== 'undefined' && window) ||
+ (typeof global !== 'undefined' && global) ||
+ (typeof self !== 'undefined' && self) ||
+ (function () { return this; }).call(null) ||
+ Function('return this')();
var transaction_pb = require('./transaction_pb.js');
goog.object.extend(proto, transaction_pb);
@@ -40,8 +46,6 @@ goog.exportSymbol('proto.pactus.GetValidatorAddressesResponse', null, global);
goog.exportSymbol('proto.pactus.GetValidatorByNumberRequest', null, global);
goog.exportSymbol('proto.pactus.GetValidatorRequest', null, global);
goog.exportSymbol('proto.pactus.GetValidatorResponse', null, global);
-goog.exportSymbol('proto.pactus.GetValidatorsRequest', null, global);
-goog.exportSymbol('proto.pactus.GetValidatorsResponse', null, global);
goog.exportSymbol('proto.pactus.ValidatorInfo', null, global);
goog.exportSymbol('proto.pactus.VoteInfo', null, global);
goog.exportSymbol('proto.pactus.VoteType', null, global);
@@ -108,27 +112,6 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.pactus.GetAccountResponse.displayName = 'proto.pactus.GetAccountResponse';
}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.pactus.GetValidatorsRequest = function(opt_data) {
- jspb.Message.initialize(this, opt_data, 0, -1, null, null);
-};
-goog.inherits(proto.pactus.GetValidatorsRequest, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
- /**
- * @public
- * @override
- */
- proto.pactus.GetValidatorsRequest.displayName = 'proto.pactus.GetValidatorsRequest';
-}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -213,27 +196,6 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.pactus.GetValidatorByNumberRequest.displayName = 'proto.pactus.GetValidatorByNumberRequest';
}
-/**
- * Generated by JsPbCodeGenerator.
- * @param {Array=} opt_data Optional initial data array, typically from a
- * server response, or constructed directly in Javascript. The array is used
- * in place and becomes part of the constructed object. It is not cloned.
- * If no data is provided, the constructed object will be empty, but still
- * valid.
- * @extends {jspb.Message}
- * @constructor
- */
-proto.pactus.GetValidatorsResponse = function(opt_data) {
- jspb.Message.initialize(this, opt_data, 0, -1, proto.pactus.GetValidatorsResponse.repeatedFields_, null);
-};
-goog.inherits(proto.pactus.GetValidatorsResponse, jspb.Message);
-if (goog.DEBUG && !COMPILED) {
- /**
- * @public
- * @override
- */
- proto.pactus.GetValidatorsResponse.displayName = 'proto.pactus.GetValidatorsResponse';
-}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -1005,107 +967,6 @@ proto.pactus.GetAccountResponse.prototype.hasAccount = function() {
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * Optional fields that are not set will be set to undefined.
- * To access a reserved field use, foo.pb_, eg, foo.pb_default.
- * For the list of reserved names please see:
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
- * JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.pactus.GetValidatorsRequest.prototype.toObject = function(opt_includeInstance) {
- return proto.pactus.GetValidatorsRequest.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
- * the JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @param {!proto.pactus.GetValidatorsRequest} msg The msg instance to transform.
- * @return {!Object}
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.pactus.GetValidatorsRequest.toObject = function(includeInstance, msg) {
- var f, obj = {
-
- };
-
- if (includeInstance) {
- obj.$jspbMessageInstance = msg;
- }
- return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.pactus.GetValidatorsRequest}
- */
-proto.pactus.GetValidatorsRequest.deserializeBinary = function(bytes) {
- var reader = new jspb.BinaryReader(bytes);
- var msg = new proto.pactus.GetValidatorsRequest;
- return proto.pactus.GetValidatorsRequest.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.pactus.GetValidatorsRequest} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.pactus.GetValidatorsRequest}
- */
-proto.pactus.GetValidatorsRequest.deserializeBinaryFromReader = function(msg, reader) {
- while (reader.nextField()) {
- if (reader.isEndGroup()) {
- break;
- }
- var field = reader.getFieldNumber();
- switch (field) {
- default:
- reader.skipField();
- break;
- }
- }
- return msg;
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.pactus.GetValidatorsRequest.prototype.serializeBinary = function() {
- var writer = new jspb.BinaryWriter();
- proto.pactus.GetValidatorsRequest.serializeBinaryToWriter(this, writer);
- return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.pactus.GetValidatorsRequest} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.pactus.GetValidatorsRequest.serializeBinaryToWriter = function(message, writer) {
- var f = undefined;
-};
-
-
-
-
-
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
@@ -1621,166 +1482,6 @@ proto.pactus.GetValidatorByNumberRequest.prototype.setNumber = function(value) {
-/**
- * List of repeated fields within this message type.
- * @private {!Array}
- * @const
- */
-proto.pactus.GetValidatorsResponse.repeatedFields_ = [1];
-
-
-
-if (jspb.Message.GENERATE_TO_OBJECT) {
-/**
- * Creates an object representation of this proto.
- * Field names that are reserved in JavaScript and will be renamed to pb_name.
- * Optional fields that are not set will be set to undefined.
- * To access a reserved field use, foo.pb_, eg, foo.pb_default.
- * For the list of reserved names please see:
- * net/proto2/compiler/js/internal/generator.cc#kKeyword.
- * @param {boolean=} opt_includeInstance Deprecated. whether to include the
- * JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @return {!Object}
- */
-proto.pactus.GetValidatorsResponse.prototype.toObject = function(opt_includeInstance) {
- return proto.pactus.GetValidatorsResponse.toObject(opt_includeInstance, this);
-};
-
-
-/**
- * Static version of the {@see toObject} method.
- * @param {boolean|undefined} includeInstance Deprecated. Whether to include
- * the JSPB instance for transitional soy proto support:
- * http://goto/soy-param-migration
- * @param {!proto.pactus.GetValidatorsResponse} msg The msg instance to transform.
- * @return {!Object}
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.pactus.GetValidatorsResponse.toObject = function(includeInstance, msg) {
- var f, obj = {
- validatorsList: jspb.Message.toObjectList(msg.getValidatorsList(),
- proto.pactus.ValidatorInfo.toObject, includeInstance)
- };
-
- if (includeInstance) {
- obj.$jspbMessageInstance = msg;
- }
- return obj;
-};
-}
-
-
-/**
- * Deserializes binary data (in protobuf wire format).
- * @param {jspb.ByteSource} bytes The bytes to deserialize.
- * @return {!proto.pactus.GetValidatorsResponse}
- */
-proto.pactus.GetValidatorsResponse.deserializeBinary = function(bytes) {
- var reader = new jspb.BinaryReader(bytes);
- var msg = new proto.pactus.GetValidatorsResponse;
- return proto.pactus.GetValidatorsResponse.deserializeBinaryFromReader(msg, reader);
-};
-
-
-/**
- * Deserializes binary data (in protobuf wire format) from the
- * given reader into the given message object.
- * @param {!proto.pactus.GetValidatorsResponse} msg The message object to deserialize into.
- * @param {!jspb.BinaryReader} reader The BinaryReader to use.
- * @return {!proto.pactus.GetValidatorsResponse}
- */
-proto.pactus.GetValidatorsResponse.deserializeBinaryFromReader = function(msg, reader) {
- while (reader.nextField()) {
- if (reader.isEndGroup()) {
- break;
- }
- var field = reader.getFieldNumber();
- switch (field) {
- case 1:
- var value = new proto.pactus.ValidatorInfo;
- reader.readMessage(value,proto.pactus.ValidatorInfo.deserializeBinaryFromReader);
- msg.addValidators(value);
- break;
- default:
- reader.skipField();
- break;
- }
- }
- return msg;
-};
-
-
-/**
- * Serializes the message to binary data (in protobuf wire format).
- * @return {!Uint8Array}
- */
-proto.pactus.GetValidatorsResponse.prototype.serializeBinary = function() {
- var writer = new jspb.BinaryWriter();
- proto.pactus.GetValidatorsResponse.serializeBinaryToWriter(this, writer);
- return writer.getResultBuffer();
-};
-
-
-/**
- * Serializes the given message to binary data (in protobuf wire
- * format), writing to the given BinaryWriter.
- * @param {!proto.pactus.GetValidatorsResponse} message
- * @param {!jspb.BinaryWriter} writer
- * @suppress {unusedLocalVariables} f is only used for nested messages
- */
-proto.pactus.GetValidatorsResponse.serializeBinaryToWriter = function(message, writer) {
- var f = undefined;
- f = message.getValidatorsList();
- if (f.length > 0) {
- writer.writeRepeatedMessage(
- 1,
- f,
- proto.pactus.ValidatorInfo.serializeBinaryToWriter
- );
- }
-};
-
-
-/**
- * repeated ValidatorInfo validators = 1;
- * @return {!Array}
- */
-proto.pactus.GetValidatorsResponse.prototype.getValidatorsList = function() {
- return /** @type{!Array} */ (
- jspb.Message.getRepeatedWrapperField(this, proto.pactus.ValidatorInfo, 1));
-};
-
-
-/**
- * @param {!Array} value
- * @return {!proto.pactus.GetValidatorsResponse} returns this
-*/
-proto.pactus.GetValidatorsResponse.prototype.setValidatorsList = function(value) {
- return jspb.Message.setRepeatedWrapperField(this, 1, value);
-};
-
-
-/**
- * @param {!proto.pactus.ValidatorInfo=} opt_value
- * @param {number=} opt_index
- * @return {!proto.pactus.ValidatorInfo}
- */
-proto.pactus.GetValidatorsResponse.prototype.addValidators = function(opt_value, opt_index) {
- return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pactus.ValidatorInfo, opt_index);
-};
-
-
-/**
- * Clears the list making it empty but non-null.
- * @return {!proto.pactus.GetValidatorsResponse} returns this
- */
-proto.pactus.GetValidatorsResponse.prototype.clearValidatorsList = function() {
- return this.setValidatorsList([]);
-};
-
-
-
if (jspb.Message.GENERATE_TO_OBJECT) {
@@ -3854,7 +3555,7 @@ proto.pactus.ValidatorInfo.toObject = function(includeInstance, msg) {
sequence: jspb.Message.getFieldWithDefault(msg, 5, 0),
stake: jspb.Message.getFieldWithDefault(msg, 6, 0),
lastBondingHeight: jspb.Message.getFieldWithDefault(msg, 7, 0),
- lastJoinedHeight: jspb.Message.getFieldWithDefault(msg, 8, 0),
+ lastSortitionHeight: jspb.Message.getFieldWithDefault(msg, 8, 0),
unbondingHeight: jspb.Message.getFieldWithDefault(msg, 9, 0),
address: jspb.Message.getFieldWithDefault(msg, 10, "")
};
@@ -3923,7 +3624,7 @@ proto.pactus.ValidatorInfo.deserializeBinaryFromReader = function(msg, reader) {
break;
case 8:
var value = /** @type {number} */ (reader.readUint32());
- msg.setLastJoinedHeight(value);
+ msg.setLastSortitionHeight(value);
break;
case 9:
var value = /** @type {number} */ (reader.readUint32());
@@ -4011,7 +3712,7 @@ proto.pactus.ValidatorInfo.serializeBinaryToWriter = function(message, writer) {
f
);
}
- f = message.getLastJoinedHeight();
+ f = message.getLastSortitionHeight();
if (f !== 0) {
writer.writeUint32(
8,
@@ -4210,10 +3911,10 @@ proto.pactus.ValidatorInfo.prototype.setLastBondingHeight = function(value) {
/**
- * optional uint32 last_joined_height = 8;
+ * optional uint32 last_sortition_height = 8;
* @return {number}
*/
-proto.pactus.ValidatorInfo.prototype.getLastJoinedHeight = function() {
+proto.pactus.ValidatorInfo.prototype.getLastSortitionHeight = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 8, 0));
};
@@ -4222,7 +3923,7 @@ proto.pactus.ValidatorInfo.prototype.getLastJoinedHeight = function() {
* @param {number} value
* @return {!proto.pactus.ValidatorInfo} returns this
*/
-proto.pactus.ValidatorInfo.prototype.setLastJoinedHeight = function(value) {
+proto.pactus.ValidatorInfo.prototype.setLastSortitionHeight = function(value) {
return jspb.Message.setProto3IntField(this, 8, value);
};
diff --git a/www/grpc/gen/js/network_pb.js b/www/grpc/gen/js/network_pb.js
index 883e51521..bc2c7a39b 100644
--- a/www/grpc/gen/js/network_pb.js
+++ b/www/grpc/gen/js/network_pb.js
@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
-var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
+var global =
+ (typeof globalThis !== 'undefined' && globalThis) ||
+ (typeof window !== 'undefined' && window) ||
+ (typeof global !== 'undefined' && global) ||
+ (typeof self !== 'undefined' && self) ||
+ (function () { return this; }).call(null) ||
+ Function('return this')();
goog.exportSymbol('proto.pactus.GetNetworkInfoRequest', null, global);
goog.exportSymbol('proto.pactus.GetNetworkInfoResponse', null, global);
@@ -269,7 +275,9 @@ proto.pactus.GetNetworkInfoResponse.toObject = function(includeInstance, msg) {
totalReceivedBytes: jspb.Message.getFieldWithDefault(msg, 2, 0),
startedAt: jspb.Message.getFieldWithDefault(msg, 3, 0),
peersList: jspb.Message.toObjectList(msg.getPeersList(),
- proto.pactus.PeerInfo.toObject, includeInstance)
+ proto.pactus.PeerInfo.toObject, includeInstance),
+ sentBytesMap: (f = msg.getSentBytesMap()) ? f.toObject(includeInstance, undefined) : [],
+ receivedBytesMap: (f = msg.getReceivedBytesMap()) ? f.toObject(includeInstance, undefined) : []
};
if (includeInstance) {
@@ -323,6 +331,18 @@ proto.pactus.GetNetworkInfoResponse.deserializeBinaryFromReader = function(msg,
reader.readMessage(value,proto.pactus.PeerInfo.deserializeBinaryFromReader);
msg.addPeers(value);
break;
+ case 5:
+ var value = msg.getSentBytesMap();
+ reader.readMessage(value, function(message, reader) {
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0);
+ });
+ break;
+ case 6:
+ var value = msg.getReceivedBytesMap();
+ reader.readMessage(value, function(message, reader) {
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0);
+ });
+ break;
default:
reader.skipField();
break;
@@ -381,6 +401,14 @@ proto.pactus.GetNetworkInfoResponse.serializeBinaryToWriter = function(message,
proto.pactus.PeerInfo.serializeBinaryToWriter
);
}
+ f = message.getSentBytesMap(true);
+ if (f && f.getLength() > 0) {
+ f.serializeBinary(5, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64);
+ }
+ f = message.getReceivedBytesMap(true);
+ if (f && f.getLength() > 0) {
+ f.serializeBinary(6, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64);
+ }
};
@@ -476,6 +504,52 @@ proto.pactus.GetNetworkInfoResponse.prototype.clearPeersList = function() {
};
+/**
+ * map sent_bytes = 5;
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
+ * empty, instead returning `undefined`
+ * @return {!jspb.Map}
+ */
+proto.pactus.GetNetworkInfoResponse.prototype.getSentBytesMap = function(opt_noLazyCreate) {
+ return /** @type {!jspb.Map} */ (
+ jspb.Message.getMapField(this, 5, opt_noLazyCreate,
+ null));
+};
+
+
+/**
+ * Clears values from the map. The map will be non-null.
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
+ */
+proto.pactus.GetNetworkInfoResponse.prototype.clearSentBytesMap = function() {
+ this.getSentBytesMap().clear();
+ return this;
+};
+
+
+/**
+ * map received_bytes = 6;
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
+ * empty, instead returning `undefined`
+ * @return {!jspb.Map}
+ */
+proto.pactus.GetNetworkInfoResponse.prototype.getReceivedBytesMap = function(opt_noLazyCreate) {
+ return /** @type {!jspb.Map} */ (
+ jspb.Message.getMapField(this, 6, opt_noLazyCreate,
+ null));
+};
+
+
+/**
+ * Clears values from the map. The map will be non-null.
+ * @return {!proto.pactus.GetNetworkInfoResponse} returns this
+ */
+proto.pactus.GetNetworkInfoResponse.prototype.clearReceivedBytesMap = function() {
+ this.getReceivedBytesMap().clear();
+ return this;
+};
+
+
@@ -838,12 +912,14 @@ proto.pactus.PeerInfo.toObject = function(includeInstance, msg) {
height: jspb.Message.getFieldWithDefault(msg, 6, 0),
receivedMessages: jspb.Message.getFieldWithDefault(msg, 7, 0),
invalidMessages: jspb.Message.getFieldWithDefault(msg, 8, 0),
- receivedBytes: jspb.Message.getFieldWithDefault(msg, 9, 0),
- status: jspb.Message.getFieldWithDefault(msg, 10, 0),
- lastSent: jspb.Message.getFieldWithDefault(msg, 11, 0),
- lastReceived: jspb.Message.getFieldWithDefault(msg, 12, 0),
- sendSuccess: jspb.Message.getFieldWithDefault(msg, 13, 0),
- sendFailed: jspb.Message.getFieldWithDefault(msg, 14, 0)
+ sentBytesMap: (f = msg.getSentBytesMap()) ? f.toObject(includeInstance, undefined) : [],
+ receivedBytesMap: (f = msg.getReceivedBytesMap()) ? f.toObject(includeInstance, undefined) : [],
+ status: jspb.Message.getFieldWithDefault(msg, 11, 0),
+ lastSent: jspb.Message.getFieldWithDefault(msg, 12, 0),
+ lastReceived: jspb.Message.getFieldWithDefault(msg, 13, 0),
+ sendSuccess: jspb.Message.getFieldWithDefault(msg, 14, 0),
+ sendFailed: jspb.Message.getFieldWithDefault(msg, 15, 0),
+ lastBlockHash: msg.getLastBlockHash_asB64()
};
if (includeInstance) {
@@ -913,29 +989,41 @@ proto.pactus.PeerInfo.deserializeBinaryFromReader = function(msg, reader) {
msg.setInvalidMessages(value);
break;
case 9:
- var value = /** @type {number} */ (reader.readInt32());
- msg.setReceivedBytes(value);
+ var value = msg.getSentBytesMap();
+ reader.readMessage(value, function(message, reader) {
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0);
+ });
break;
case 10:
+ var value = msg.getReceivedBytesMap();
+ reader.readMessage(value, function(message, reader) {
+ jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readInt32, jspb.BinaryReader.prototype.readInt64, null, 0, 0);
+ });
+ break;
+ case 11:
var value = /** @type {number} */ (reader.readInt32());
msg.setStatus(value);
break;
- case 11:
+ case 12:
var value = /** @type {number} */ (reader.readInt64());
msg.setLastSent(value);
break;
- case 12:
+ case 13:
var value = /** @type {number} */ (reader.readInt64());
msg.setLastReceived(value);
break;
- case 13:
+ case 14:
var value = /** @type {number} */ (reader.readInt32());
msg.setSendSuccess(value);
break;
- case 14:
+ case 15:
var value = /** @type {number} */ (reader.readInt32());
msg.setSendFailed(value);
break;
+ case 16:
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
+ msg.setLastBlockHash(value);
+ break;
default:
reader.skipField();
break;
@@ -1021,45 +1109,53 @@ proto.pactus.PeerInfo.serializeBinaryToWriter = function(message, writer) {
f
);
}
- f = message.getReceivedBytes();
- if (f !== 0) {
- writer.writeInt32(
- 9,
- f
- );
+ f = message.getSentBytesMap(true);
+ if (f && f.getLength() > 0) {
+ f.serializeBinary(9, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64);
+ }
+ f = message.getReceivedBytesMap(true);
+ if (f && f.getLength() > 0) {
+ f.serializeBinary(10, writer, jspb.BinaryWriter.prototype.writeInt32, jspb.BinaryWriter.prototype.writeInt64);
}
f = message.getStatus();
if (f !== 0) {
writer.writeInt32(
- 10,
+ 11,
f
);
}
f = message.getLastSent();
if (f !== 0) {
writer.writeInt64(
- 11,
+ 12,
f
);
}
f = message.getLastReceived();
if (f !== 0) {
writer.writeInt64(
- 12,
+ 13,
f
);
}
f = message.getSendSuccess();
if (f !== 0) {
writer.writeInt32(
- 13,
+ 14,
f
);
}
f = message.getSendFailed();
if (f !== 0) {
writer.writeInt32(
- 14,
+ 15,
+ f
+ );
+ }
+ f = message.getLastBlockHash_asU8();
+ if (f.length > 0) {
+ writer.writeBytes(
+ 16,
f
);
}
@@ -1254,29 +1350,57 @@ proto.pactus.PeerInfo.prototype.setInvalidMessages = function(value) {
/**
- * optional int32 received_bytes = 9;
- * @return {number}
+ * map sent_bytes = 9;
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
+ * empty, instead returning `undefined`
+ * @return {!jspb.Map}
*/
-proto.pactus.PeerInfo.prototype.getReceivedBytes = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 9, 0));
+proto.pactus.PeerInfo.prototype.getSentBytesMap = function(opt_noLazyCreate) {
+ return /** @type {!jspb.Map} */ (
+ jspb.Message.getMapField(this, 9, opt_noLazyCreate,
+ null));
};
/**
- * @param {number} value
+ * Clears values from the map. The map will be non-null.
* @return {!proto.pactus.PeerInfo} returns this
*/
-proto.pactus.PeerInfo.prototype.setReceivedBytes = function(value) {
- return jspb.Message.setProto3IntField(this, 9, value);
+proto.pactus.PeerInfo.prototype.clearSentBytesMap = function() {
+ this.getSentBytesMap().clear();
+ return this;
+};
+
+
+/**
+ * map received_bytes = 10;
+ * @param {boolean=} opt_noLazyCreate Do not create the map if
+ * empty, instead returning `undefined`
+ * @return {!jspb.Map}
+ */
+proto.pactus.PeerInfo.prototype.getReceivedBytesMap = function(opt_noLazyCreate) {
+ return /** @type {!jspb.Map} */ (
+ jspb.Message.getMapField(this, 10, opt_noLazyCreate,
+ null));
};
/**
- * optional int32 status = 10;
+ * Clears values from the map. The map will be non-null.
+ * @return {!proto.pactus.PeerInfo} returns this
+ */
+proto.pactus.PeerInfo.prototype.clearReceivedBytesMap = function() {
+ this.getReceivedBytesMap().clear();
+ return this;
+};
+
+
+/**
+ * optional int32 status = 11;
* @return {number}
*/
proto.pactus.PeerInfo.prototype.getStatus = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 10, 0));
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
};
@@ -1285,16 +1409,16 @@ proto.pactus.PeerInfo.prototype.getStatus = function() {
* @return {!proto.pactus.PeerInfo} returns this
*/
proto.pactus.PeerInfo.prototype.setStatus = function(value) {
- return jspb.Message.setProto3IntField(this, 10, value);
+ return jspb.Message.setProto3IntField(this, 11, value);
};
/**
- * optional int64 last_sent = 11;
+ * optional int64 last_sent = 12;
* @return {number}
*/
proto.pactus.PeerInfo.prototype.getLastSent = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 11, 0));
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
};
@@ -1303,16 +1427,16 @@ proto.pactus.PeerInfo.prototype.getLastSent = function() {
* @return {!proto.pactus.PeerInfo} returns this
*/
proto.pactus.PeerInfo.prototype.setLastSent = function(value) {
- return jspb.Message.setProto3IntField(this, 11, value);
+ return jspb.Message.setProto3IntField(this, 12, value);
};
/**
- * optional int64 last_received = 12;
+ * optional int64 last_received = 13;
* @return {number}
*/
proto.pactus.PeerInfo.prototype.getLastReceived = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0));
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0));
};
@@ -1321,16 +1445,16 @@ proto.pactus.PeerInfo.prototype.getLastReceived = function() {
* @return {!proto.pactus.PeerInfo} returns this
*/
proto.pactus.PeerInfo.prototype.setLastReceived = function(value) {
- return jspb.Message.setProto3IntField(this, 12, value);
+ return jspb.Message.setProto3IntField(this, 13, value);
};
/**
- * optional int32 send_success = 13;
+ * optional int32 send_success = 14;
* @return {number}
*/
proto.pactus.PeerInfo.prototype.getSendSuccess = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 13, 0));
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0));
};
@@ -1339,16 +1463,16 @@ proto.pactus.PeerInfo.prototype.getSendSuccess = function() {
* @return {!proto.pactus.PeerInfo} returns this
*/
proto.pactus.PeerInfo.prototype.setSendSuccess = function(value) {
- return jspb.Message.setProto3IntField(this, 13, value);
+ return jspb.Message.setProto3IntField(this, 14, value);
};
/**
- * optional int32 send_failed = 14;
+ * optional int32 send_failed = 15;
* @return {number}
*/
proto.pactus.PeerInfo.prototype.getSendFailed = function() {
- return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 14, 0));
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 15, 0));
};
@@ -1357,7 +1481,49 @@ proto.pactus.PeerInfo.prototype.getSendFailed = function() {
* @return {!proto.pactus.PeerInfo} returns this
*/
proto.pactus.PeerInfo.prototype.setSendFailed = function(value) {
- return jspb.Message.setProto3IntField(this, 14, value);
+ return jspb.Message.setProto3IntField(this, 15, value);
+};
+
+
+/**
+ * optional bytes last_block_hash = 16;
+ * @return {!(string|Uint8Array)}
+ */
+proto.pactus.PeerInfo.prototype.getLastBlockHash = function() {
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 16, ""));
+};
+
+
+/**
+ * optional bytes last_block_hash = 16;
+ * This is a type-conversion wrapper around `getLastBlockHash()`
+ * @return {string}
+ */
+proto.pactus.PeerInfo.prototype.getLastBlockHash_asB64 = function() {
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
+ this.getLastBlockHash()));
+};
+
+
+/**
+ * optional bytes last_block_hash = 16;
+ * Note that Uint8Array is not supported on all browsers.
+ * @see http://caniuse.com/Uint8Array
+ * This is a type-conversion wrapper around `getLastBlockHash()`
+ * @return {!Uint8Array}
+ */
+proto.pactus.PeerInfo.prototype.getLastBlockHash_asU8 = function() {
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
+ this.getLastBlockHash()));
+};
+
+
+/**
+ * @param {!(string|Uint8Array)} value
+ * @return {!proto.pactus.PeerInfo} returns this
+ */
+proto.pactus.PeerInfo.prototype.setLastBlockHash = function(value) {
+ return jspb.Message.setProto3BytesField(this, 16, value);
};
diff --git a/www/grpc/gen/js/transaction_grpc_pb.js b/www/grpc/gen/js/transaction_grpc_pb.js
index 845004677..3822cf018 100644
--- a/www/grpc/gen/js/transaction_grpc_pb.js
+++ b/www/grpc/gen/js/transaction_grpc_pb.js
@@ -4,6 +4,28 @@
var grpc = require('grpc');
var transaction_pb = require('./transaction_pb.js');
+function serialize_pactus_CalculateFeeRequest(arg) {
+ if (!(arg instanceof transaction_pb.CalculateFeeRequest)) {
+ throw new Error('Expected argument of type pactus.CalculateFeeRequest');
+ }
+ return Buffer.from(arg.serializeBinary());
+}
+
+function deserialize_pactus_CalculateFeeRequest(buffer_arg) {
+ return transaction_pb.CalculateFeeRequest.deserializeBinary(new Uint8Array(buffer_arg));
+}
+
+function serialize_pactus_CalculateFeeResponse(arg) {
+ if (!(arg instanceof transaction_pb.CalculateFeeResponse)) {
+ throw new Error('Expected argument of type pactus.CalculateFeeResponse');
+ }
+ return Buffer.from(arg.serializeBinary());
+}
+
+function deserialize_pactus_CalculateFeeResponse(buffer_arg) {
+ return transaction_pb.CalculateFeeResponse.deserializeBinary(new Uint8Array(buffer_arg));
+}
+
function serialize_pactus_GetTransactionRequest(arg) {
if (!(arg instanceof transaction_pb.GetTransactionRequest)) {
throw new Error('Expected argument of type pactus.GetTransactionRequest');
@@ -61,6 +83,17 @@ var TransactionService = exports.TransactionService = {
responseSerialize: serialize_pactus_GetTransactionResponse,
responseDeserialize: deserialize_pactus_GetTransactionResponse,
},
+ calculateFee: {
+ path: '/pactus.Transaction/CalculateFee',
+ requestStream: false,
+ responseStream: false,
+ requestType: transaction_pb.CalculateFeeRequest,
+ responseType: transaction_pb.CalculateFeeResponse,
+ requestSerialize: serialize_pactus_CalculateFeeRequest,
+ requestDeserialize: deserialize_pactus_CalculateFeeRequest,
+ responseSerialize: serialize_pactus_CalculateFeeResponse,
+ responseDeserialize: deserialize_pactus_CalculateFeeResponse,
+ },
sendRawTransaction: {
path: '/pactus.Transaction/SendRawTransaction',
requestStream: false,
diff --git a/www/grpc/gen/js/transaction_pb.js b/www/grpc/gen/js/transaction_pb.js
index bea804a25..f3089bbf6 100644
--- a/www/grpc/gen/js/transaction_pb.js
+++ b/www/grpc/gen/js/transaction_pb.js
@@ -13,8 +13,16 @@
var jspb = require('google-protobuf');
var goog = jspb;
-var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
-
+var global =
+ (typeof globalThis !== 'undefined' && globalThis) ||
+ (typeof window !== 'undefined' && window) ||
+ (typeof global !== 'undefined' && global) ||
+ (typeof self !== 'undefined' && self) ||
+ (function () { return this; }).call(null) ||
+ Function('return this')();
+
+goog.exportSymbol('proto.pactus.CalculateFeeRequest', null, global);
+goog.exportSymbol('proto.pactus.CalculateFeeResponse', null, global);
goog.exportSymbol('proto.pactus.GetTransactionRequest', null, global);
goog.exportSymbol('proto.pactus.GetTransactionResponse', null, global);
goog.exportSymbol('proto.pactus.PayloadBond', null, global);
@@ -70,6 +78,48 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.pactus.GetTransactionResponse.displayName = 'proto.pactus.GetTransactionResponse';
}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.pactus.CalculateFeeRequest = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.pactus.CalculateFeeRequest, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.pactus.CalculateFeeRequest.displayName = 'proto.pactus.CalculateFeeRequest';
+}
+/**
+ * Generated by JsPbCodeGenerator.
+ * @param {Array=} opt_data Optional initial data array, typically from a
+ * server response, or constructed directly in Javascript. The array is used
+ * in place and becomes part of the constructed object. It is not cloned.
+ * If no data is provided, the constructed object will be empty, but still
+ * valid.
+ * @extends {jspb.Message}
+ * @constructor
+ */
+proto.pactus.CalculateFeeResponse = function(opt_data) {
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
+};
+goog.inherits(proto.pactus.CalculateFeeResponse, jspb.Message);
+if (goog.DEBUG && !COMPILED) {
+ /**
+ * @public
+ * @override
+ */
+ proto.pactus.CalculateFeeResponse.displayName = 'proto.pactus.CalculateFeeResponse';
+}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
@@ -636,6 +686,296 @@ proto.pactus.GetTransactionResponse.prototype.hasTransaction = function() {
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.pactus.CalculateFeeRequest.prototype.toObject = function(opt_includeInstance) {
+ return proto.pactus.CalculateFeeRequest.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.pactus.CalculateFeeRequest} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.pactus.CalculateFeeRequest.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ amount: jspb.Message.getFieldWithDefault(msg, 1, 0),
+ payloadtype: jspb.Message.getFieldWithDefault(msg, 2, 0)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.pactus.CalculateFeeRequest}
+ */
+proto.pactus.CalculateFeeRequest.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.pactus.CalculateFeeRequest;
+ return proto.pactus.CalculateFeeRequest.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.pactus.CalculateFeeRequest} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.pactus.CalculateFeeRequest}
+ */
+proto.pactus.CalculateFeeRequest.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = /** @type {number} */ (reader.readInt64());
+ msg.setAmount(value);
+ break;
+ case 2:
+ var value = /** @type {!proto.pactus.PayloadType} */ (reader.readEnum());
+ msg.setPayloadtype(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.pactus.CalculateFeeRequest.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.pactus.CalculateFeeRequest.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.pactus.CalculateFeeRequest} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.pactus.CalculateFeeRequest.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getAmount();
+ if (f !== 0) {
+ writer.writeInt64(
+ 1,
+ f
+ );
+ }
+ f = message.getPayloadtype();
+ if (f !== 0.0) {
+ writer.writeEnum(
+ 2,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional int64 amount = 1;
+ * @return {number}
+ */
+proto.pactus.CalculateFeeRequest.prototype.getAmount = function() {
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.pactus.CalculateFeeRequest} returns this
+ */
+proto.pactus.CalculateFeeRequest.prototype.setAmount = function(value) {
+ return jspb.Message.setProto3IntField(this, 1, value);
+};
+
+
+/**
+ * optional PayloadType payloadType = 2;
+ * @return {!proto.pactus.PayloadType}
+ */
+proto.pactus.CalculateFeeRequest.prototype.getPayloadtype = function() {
+ return /** @type {!proto.pactus.PayloadType} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
+};
+
+
+/**
+ * @param {!proto.pactus.PayloadType} value
+ * @return {!proto.pactus.CalculateFeeRequest} returns this
+ */
+proto.pactus.CalculateFeeRequest.prototype.setPayloadtype = function(value) {
+ return jspb.Message.setProto3EnumField(this, 2, value);
+};
+
+
+
+
+
+if (jspb.Message.GENERATE_TO_OBJECT) {
+/**
+ * Creates an object representation of this proto.
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
+ * Optional fields that are not set will be set to undefined.
+ * To access a reserved field use, foo.pb_, eg, foo.pb_default.
+ * For the list of reserved names please see:
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
+ * JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @return {!Object}
+ */
+proto.pactus.CalculateFeeResponse.prototype.toObject = function(opt_includeInstance) {
+ return proto.pactus.CalculateFeeResponse.toObject(opt_includeInstance, this);
+};
+
+
+/**
+ * Static version of the {@see toObject} method.
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
+ * the JSPB instance for transitional soy proto support:
+ * http://goto/soy-param-migration
+ * @param {!proto.pactus.CalculateFeeResponse} msg The msg instance to transform.
+ * @return {!Object}
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.pactus.CalculateFeeResponse.toObject = function(includeInstance, msg) {
+ var f, obj = {
+ fee: jspb.Message.getFieldWithDefault(msg, 1, 0)
+ };
+
+ if (includeInstance) {
+ obj.$jspbMessageInstance = msg;
+ }
+ return obj;
+};
+}
+
+
+/**
+ * Deserializes binary data (in protobuf wire format).
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
+ * @return {!proto.pactus.CalculateFeeResponse}
+ */
+proto.pactus.CalculateFeeResponse.deserializeBinary = function(bytes) {
+ var reader = new jspb.BinaryReader(bytes);
+ var msg = new proto.pactus.CalculateFeeResponse;
+ return proto.pactus.CalculateFeeResponse.deserializeBinaryFromReader(msg, reader);
+};
+
+
+/**
+ * Deserializes binary data (in protobuf wire format) from the
+ * given reader into the given message object.
+ * @param {!proto.pactus.CalculateFeeResponse} msg The message object to deserialize into.
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
+ * @return {!proto.pactus.CalculateFeeResponse}
+ */
+proto.pactus.CalculateFeeResponse.deserializeBinaryFromReader = function(msg, reader) {
+ while (reader.nextField()) {
+ if (reader.isEndGroup()) {
+ break;
+ }
+ var field = reader.getFieldNumber();
+ switch (field) {
+ case 1:
+ var value = /** @type {number} */ (reader.readInt64());
+ msg.setFee(value);
+ break;
+ default:
+ reader.skipField();
+ break;
+ }
+ }
+ return msg;
+};
+
+
+/**
+ * Serializes the message to binary data (in protobuf wire format).
+ * @return {!Uint8Array}
+ */
+proto.pactus.CalculateFeeResponse.prototype.serializeBinary = function() {
+ var writer = new jspb.BinaryWriter();
+ proto.pactus.CalculateFeeResponse.serializeBinaryToWriter(this, writer);
+ return writer.getResultBuffer();
+};
+
+
+/**
+ * Serializes the given message to binary data (in protobuf wire
+ * format), writing to the given BinaryWriter.
+ * @param {!proto.pactus.CalculateFeeResponse} message
+ * @param {!jspb.BinaryWriter} writer
+ * @suppress {unusedLocalVariables} f is only used for nested messages
+ */
+proto.pactus.CalculateFeeResponse.serializeBinaryToWriter = function(message, writer) {
+ var f = undefined;
+ f = message.getFee();
+ if (f !== 0) {
+ writer.writeInt64(
+ 1,
+ f
+ );
+ }
+};
+
+
+/**
+ * optional int64 fee = 1;
+ * @return {number}
+ */
+proto.pactus.CalculateFeeResponse.prototype.getFee = function() {
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
+};
+
+
+/**
+ * @param {number} value
+ * @return {!proto.pactus.CalculateFeeResponse} returns this
+ */
+proto.pactus.CalculateFeeResponse.prototype.setFee = function(value) {
+ return jspb.Message.setProto3IntField(this, 1, value);
+};
+
+
+
+
+
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
@@ -2355,7 +2695,7 @@ proto.pactus.TransactionInfo.prototype.setFee = function(value) {
/**
- * optional PayloadType PayloadType = 8;
+ * optional PayloadType payloadType = 8;
* @return {!proto.pactus.PayloadType}
*/
proto.pactus.TransactionInfo.prototype.getPayloadtype = function() {
diff --git a/www/grpc/gen/js/wallet_pb.js b/www/grpc/gen/js/wallet_pb.js
index 0ca50dd82..e70cefa02 100644
--- a/www/grpc/gen/js/wallet_pb.js
+++ b/www/grpc/gen/js/wallet_pb.js
@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
-var global = (function() { return this || window || global || self || Function('return this')(); }).call(null);
+var global =
+ (typeof globalThis !== 'undefined' && globalThis) ||
+ (typeof window !== 'undefined' && window) ||
+ (typeof global !== 'undefined' && global) ||
+ (typeof self !== 'undefined' && self) ||
+ (function () { return this; }).call(null) ||
+ Function('return this')();
goog.exportSymbol('proto.pactus.CreateWalletRequest', null, global);
goog.exportSymbol('proto.pactus.CreateWalletResponse', null, global);
diff --git a/www/grpc/gen/python/blockchain_pb2.py b/www/grpc/gen/python/blockchain_pb2.py
index d40d22a76..a0754a7ad 100644
--- a/www/grpc/gen/python/blockchain_pb2.py
+++ b/www/grpc/gen/python/blockchain_pb2.py
@@ -14,7 +14,7 @@
import transaction_pb2 as transaction__pb2
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x62lockchain.proto\x12\x06pactus\x1a\x11transaction.proto\"-\n\x11GetAccountRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"3\n\x19GetAccountByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\"C\n\x12GetAccountResponse\x12-\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x13.pactus.AccountInfoR\x07\x61\x63\x63ount\"\x16\n\x14GetValidatorsRequest\"\x1e\n\x1cGetValidatorAddressesRequest\"=\n\x1dGetValidatorAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"/\n\x13GetValidatorRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"5\n\x1bGetValidatorByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\"N\n\x15GetValidatorsResponse\x12\x35\n\nvalidators\x18\x01 \x03(\x0b\x32\x15.pactus.ValidatorInfoR\nvalidators\"K\n\x14GetValidatorResponse\x12\x33\n\tvalidator\x18\x01 \x01(\x0b\x32\x15.pactus.ValidatorInfoR\tvalidator\"_\n\x0fGetBlockRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x34\n\tverbosity\x18\x02 \x01(\x0e\x32\x16.pactus.BlockVerbosityR\tverbosity\"\x83\x02\n\x10GetBlockResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x12\n\x04hash\x18\x02 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x03 \x01(\x0cR\x04\x64\x61ta\x12\x1d\n\nblock_time\x18\x04 \x01(\rR\tblockTime\x12/\n\x06header\x18\x05 \x01(\x0b\x32\x17.pactus.BlockHeaderInfoR\x06header\x12\x34\n\tprev_cert\x18\x06 \x01(\x0b\x32\x17.pactus.CertificateInfoR\x08prevCert\x12)\n\x03txs\x18\x07 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs\"-\n\x13GetBlockHashRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"*\n\x14GetBlockHashResponse\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\"+\n\x15GetBlockHeightRequest\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\"0\n\x16GetBlockHeightResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"\x1a\n\x18GetBlockchainInfoRequest\"\xd5\x02\n\x19GetBlockchainInfoResponse\x12*\n\x11last_block_height\x18\x01 \x01(\rR\x0flastBlockHeight\x12&\n\x0flast_block_hash\x18\x02 \x01(\x0cR\rlastBlockHash\x12%\n\x0etotal_accounts\x18\x03 \x01(\x05R\rtotalAccounts\x12)\n\x10total_validators\x18\x04 \x01(\x05R\x0ftotalValidators\x12\x1f\n\x0btotal_power\x18\x05 \x01(\x03R\ntotalPower\x12\'\n\x0f\x63ommittee_power\x18\x06 \x01(\x03R\x0e\x63ommitteePower\x12H\n\x14\x63ommittee_validators\x18\x07 \x03(\x0b\x32\x15.pactus.ValidatorInfoR\x13\x63ommitteeValidators\"\x19\n\x17GetConsensusInfoRequest\"O\n\x18GetConsensusInfoResponse\x12\x33\n\tinstances\x18\x01 \x03(\x0b\x32\x15.pactus.ConsensusInfoR\tinstances\"\xc3\x02\n\rValidatorInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\x12\x16\n\x06number\x18\x04 \x01(\x05R\x06number\x12\x1a\n\x08sequence\x18\x05 \x01(\x05R\x08sequence\x12\x14\n\x05stake\x18\x06 \x01(\x03R\x05stake\x12.\n\x13last_bonding_height\x18\x07 \x01(\rR\x11lastBondingHeight\x12,\n\x12last_joined_height\x18\x08 \x01(\rR\x10lastJoinedHeight\x12)\n\x10unbonding_height\x18\t \x01(\rR\x0funbondingHeight\x12\x18\n\x07\x61\x64\x64ress\x18\n \x01(\tR\x07\x61\x64\x64ress\"\x83\x01\n\x0b\x41\x63\x63ountInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x1a\n\x08sequence\x18\x04 \x01(\x05R\x08sequence\x12\x18\n\x07\x62\x61lance\x18\x05 \x01(\x03R\x07\x62\x61lance\"\xc4\x01\n\x0f\x42lockHeaderInfo\x12\x18\n\x07version\x18\x01 \x01(\x05R\x07version\x12&\n\x0fprev_block_hash\x18\x02 \x01(\x0cR\rprevBlockHash\x12\x1d\n\nstate_root\x18\x03 \x01(\x0cR\tstateRoot\x12%\n\x0esortition_seed\x18\x04 \x01(\x0cR\rsortitionSeed\x12)\n\x10proposer_address\x18\x05 \x01(\tR\x0fproposerAddress\"\x97\x01\n\x0f\x43\x65rtificateInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x14\n\x05round\x18\x02 \x01(\x05R\x05round\x12\x1e\n\ncommitters\x18\x03 \x03(\x05R\ncommitters\x12\x1c\n\tabsentees\x18\x04 \x03(\x05R\tabsentees\x12\x1c\n\tsignature\x18\x05 \x01(\x0cR\tsignature\"{\n\x08VoteInfo\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x10.pactus.VoteTypeR\x04type\x12\x14\n\x05voter\x18\x02 \x01(\tR\x05voter\x12\x1d\n\nblock_hash\x18\x03 \x01(\x0cR\tblockHash\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\"\x97\x01\n\rConsensusInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x16\n\x06\x41\x63tive\x18\x02 \x01(\x08R\x06\x41\x63tive\x12\x16\n\x06height\x18\x03 \x01(\rR\x06height\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12&\n\x05votes\x18\x05 \x03(\x0b\x32\x10.pactus.VoteInfoR\x05votes*H\n\x0e\x42lockVerbosity\x12\x0e\n\nBLOCK_DATA\x10\x00\x12\x0e\n\nBLOCK_INFO\x10\x01\x12\x16\n\x12\x42LOCK_TRANSACTIONS\x10\x02*\\\n\x08VoteType\x12\x10\n\x0cVOTE_UNKNOWN\x10\x00\x12\x10\n\x0cVOTE_PREPARE\x10\x01\x12\x12\n\x0eVOTE_PRECOMMIT\x10\x02\x12\x18\n\x14VOTE_CHANGE_PROPOSER\x10\x03\x32\x8c\x07\n\nBlockchain\x12=\n\x08GetBlock\x12\x17.pactus.GetBlockRequest\x1a\x18.pactus.GetBlockResponse\x12I\n\x0cGetBlockHash\x12\x1b.pactus.GetBlockHashRequest\x1a\x1c.pactus.GetBlockHashResponse\x12O\n\x0eGetBlockHeight\x12\x1d.pactus.GetBlockHeightRequest\x1a\x1e.pactus.GetBlockHeightResponse\x12X\n\x11GetBlockchainInfo\x12 .pactus.GetBlockchainInfoRequest\x1a!.pactus.GetBlockchainInfoResponse\x12U\n\x10GetConsensusInfo\x12\x1f.pactus.GetConsensusInfoRequest\x1a .pactus.GetConsensusInfoResponse\x12\x43\n\nGetAccount\x12\x19.pactus.GetAccountRequest\x1a\x1a.pactus.GetAccountResponse\x12S\n\x12GetAccountByNumber\x12!.pactus.GetAccountByNumberRequest\x1a\x1a.pactus.GetAccountResponse\x12I\n\x0cGetValidator\x12\x1b.pactus.GetValidatorRequest\x1a\x1c.pactus.GetValidatorResponse\x12Y\n\x14GetValidatorByNumber\x12#.pactus.GetValidatorByNumberRequest\x1a\x1c.pactus.GetValidatorResponse\x12\x64\n\x15GetValidatorAddresses\x12$.pactus.GetValidatorAddressesRequest\x1a%.pactus.GetValidatorAddressesResponse\x12L\n\rGetValidators\x12\x1c.pactus.GetValidatorsRequest\x1a\x1d.pactus.GetValidatorsResponseBE\n\x11pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10\x62lockchain.proto\x12\x06pactus\x1a\x11transaction.proto\"-\n\x11GetAccountRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"3\n\x19GetAccountByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\"C\n\x12GetAccountResponse\x12-\n\x07\x61\x63\x63ount\x18\x01 \x01(\x0b\x32\x13.pactus.AccountInfoR\x07\x61\x63\x63ount\"\x1e\n\x1cGetValidatorAddressesRequest\"=\n\x1dGetValidatorAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"/\n\x13GetValidatorRequest\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"5\n\x1bGetValidatorByNumberRequest\x12\x16\n\x06number\x18\x01 \x01(\x05R\x06number\"K\n\x14GetValidatorResponse\x12\x33\n\tvalidator\x18\x01 \x01(\x0b\x32\x15.pactus.ValidatorInfoR\tvalidator\"_\n\x0fGetBlockRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x34\n\tverbosity\x18\x02 \x01(\x0e\x32\x16.pactus.BlockVerbosityR\tverbosity\"\x83\x02\n\x10GetBlockResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\x12\x12\n\x04hash\x18\x02 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x03 \x01(\x0cR\x04\x64\x61ta\x12\x1d\n\nblock_time\x18\x04 \x01(\rR\tblockTime\x12/\n\x06header\x18\x05 \x01(\x0b\x32\x17.pactus.BlockHeaderInfoR\x06header\x12\x34\n\tprev_cert\x18\x06 \x01(\x0b\x32\x17.pactus.CertificateInfoR\x08prevCert\x12)\n\x03txs\x18\x07 \x03(\x0b\x32\x17.pactus.TransactionInfoR\x03txs\"-\n\x13GetBlockHashRequest\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"*\n\x14GetBlockHashResponse\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\"+\n\x15GetBlockHeightRequest\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\"0\n\x16GetBlockHeightResponse\x12\x16\n\x06height\x18\x01 \x01(\rR\x06height\"\x1a\n\x18GetBlockchainInfoRequest\"\xd5\x02\n\x19GetBlockchainInfoResponse\x12*\n\x11last_block_height\x18\x01 \x01(\rR\x0flastBlockHeight\x12&\n\x0flast_block_hash\x18\x02 \x01(\x0cR\rlastBlockHash\x12%\n\x0etotal_accounts\x18\x03 \x01(\x05R\rtotalAccounts\x12)\n\x10total_validators\x18\x04 \x01(\x05R\x0ftotalValidators\x12\x1f\n\x0btotal_power\x18\x05 \x01(\x03R\ntotalPower\x12\'\n\x0f\x63ommittee_power\x18\x06 \x01(\x03R\x0e\x63ommitteePower\x12H\n\x14\x63ommittee_validators\x18\x07 \x03(\x0b\x32\x15.pactus.ValidatorInfoR\x13\x63ommitteeValidators\"\x19\n\x17GetConsensusInfoRequest\"O\n\x18GetConsensusInfoResponse\x12\x33\n\tinstances\x18\x01 \x03(\x0b\x32\x15.pactus.ConsensusInfoR\tinstances\"\xc9\x02\n\rValidatorInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1d\n\npublic_key\x18\x03 \x01(\tR\tpublicKey\x12\x16\n\x06number\x18\x04 \x01(\x05R\x06number\x12\x1a\n\x08sequence\x18\x05 \x01(\x05R\x08sequence\x12\x14\n\x05stake\x18\x06 \x01(\x03R\x05stake\x12.\n\x13last_bonding_height\x18\x07 \x01(\rR\x11lastBondingHeight\x12\x32\n\x15last_sortition_height\x18\x08 \x01(\rR\x13lastSortitionHeight\x12)\n\x10unbonding_height\x18\t \x01(\rR\x0funbondingHeight\x12\x18\n\x07\x61\x64\x64ress\x18\n \x01(\tR\x07\x61\x64\x64ress\"\x83\x01\n\x0b\x41\x63\x63ountInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x16\n\x06number\x18\x03 \x01(\x05R\x06number\x12\x1a\n\x08sequence\x18\x04 \x01(\x05R\x08sequence\x12\x18\n\x07\x62\x61lance\x18\x05 \x01(\x03R\x07\x62\x61lance\"\xc4\x01\n\x0f\x42lockHeaderInfo\x12\x18\n\x07version\x18\x01 \x01(\x05R\x07version\x12&\n\x0fprev_block_hash\x18\x02 \x01(\x0cR\rprevBlockHash\x12\x1d\n\nstate_root\x18\x03 \x01(\x0cR\tstateRoot\x12%\n\x0esortition_seed\x18\x04 \x01(\x0cR\rsortitionSeed\x12)\n\x10proposer_address\x18\x05 \x01(\tR\x0fproposerAddress\"\x97\x01\n\x0f\x43\x65rtificateInfo\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x14\n\x05round\x18\x02 \x01(\x05R\x05round\x12\x1e\n\ncommitters\x18\x03 \x03(\x05R\ncommitters\x12\x1c\n\tabsentees\x18\x04 \x03(\x05R\tabsentees\x12\x1c\n\tsignature\x18\x05 \x01(\x0cR\tsignature\"{\n\x08VoteInfo\x12$\n\x04type\x18\x01 \x01(\x0e\x32\x10.pactus.VoteTypeR\x04type\x12\x14\n\x05voter\x18\x02 \x01(\tR\x05voter\x12\x1d\n\nblock_hash\x18\x03 \x01(\x0cR\tblockHash\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\"\x97\x01\n\rConsensusInfo\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x16\n\x06\x41\x63tive\x18\x02 \x01(\x08R\x06\x41\x63tive\x12\x16\n\x06height\x18\x03 \x01(\rR\x06height\x12\x14\n\x05round\x18\x04 \x01(\x05R\x05round\x12&\n\x05votes\x18\x05 \x03(\x0b\x32\x10.pactus.VoteInfoR\x05votes*H\n\x0e\x42lockVerbosity\x12\x0e\n\nBLOCK_DATA\x10\x00\x12\x0e\n\nBLOCK_INFO\x10\x01\x12\x16\n\x12\x42LOCK_TRANSACTIONS\x10\x02*\\\n\x08VoteType\x12\x10\n\x0cVOTE_UNKNOWN\x10\x00\x12\x10\n\x0cVOTE_PREPARE\x10\x01\x12\x12\n\x0eVOTE_PRECOMMIT\x10\x02\x12\x18\n\x14VOTE_CHANGE_PROPOSER\x10\x03\x32\xbe\x06\n\nBlockchain\x12=\n\x08GetBlock\x12\x17.pactus.GetBlockRequest\x1a\x18.pactus.GetBlockResponse\x12I\n\x0cGetBlockHash\x12\x1b.pactus.GetBlockHashRequest\x1a\x1c.pactus.GetBlockHashResponse\x12O\n\x0eGetBlockHeight\x12\x1d.pactus.GetBlockHeightRequest\x1a\x1e.pactus.GetBlockHeightResponse\x12X\n\x11GetBlockchainInfo\x12 .pactus.GetBlockchainInfoRequest\x1a!.pactus.GetBlockchainInfoResponse\x12U\n\x10GetConsensusInfo\x12\x1f.pactus.GetConsensusInfoRequest\x1a .pactus.GetConsensusInfoResponse\x12\x43\n\nGetAccount\x12\x19.pactus.GetAccountRequest\x1a\x1a.pactus.GetAccountResponse\x12S\n\x12GetAccountByNumber\x12!.pactus.GetAccountByNumberRequest\x1a\x1a.pactus.GetAccountResponse\x12I\n\x0cGetValidator\x12\x1b.pactus.GetValidatorRequest\x1a\x1c.pactus.GetValidatorResponse\x12Y\n\x14GetValidatorByNumber\x12#.pactus.GetValidatorByNumberRequest\x1a\x1c.pactus.GetValidatorResponse\x12\x64\n\x15GetValidatorAddresses\x12$.pactus.GetValidatorAddressesRequest\x1a%.pactus.GetValidatorAddressesResponseBE\n\x11pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'blockchain_pb2', globals())
@@ -22,62 +22,58 @@
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\021pactus.blockchainZ0github.com/pactus-project/pactus/www/grpc/pactus'
- _BLOCKVERBOSITY._serialized_start=2713
- _BLOCKVERBOSITY._serialized_end=2785
- _VOTETYPE._serialized_start=2787
- _VOTETYPE._serialized_end=2879
+ _BLOCKVERBOSITY._serialized_start=2615
+ _BLOCKVERBOSITY._serialized_end=2687
+ _VOTETYPE._serialized_start=2689
+ _VOTETYPE._serialized_end=2781
_GETACCOUNTREQUEST._serialized_start=47
_GETACCOUNTREQUEST._serialized_end=92
_GETACCOUNTBYNUMBERREQUEST._serialized_start=94
_GETACCOUNTBYNUMBERREQUEST._serialized_end=145
_GETACCOUNTRESPONSE._serialized_start=147
_GETACCOUNTRESPONSE._serialized_end=214
- _GETVALIDATORSREQUEST._serialized_start=216
- _GETVALIDATORSREQUEST._serialized_end=238
- _GETVALIDATORADDRESSESREQUEST._serialized_start=240
- _GETVALIDATORADDRESSESREQUEST._serialized_end=270
- _GETVALIDATORADDRESSESRESPONSE._serialized_start=272
- _GETVALIDATORADDRESSESRESPONSE._serialized_end=333
- _GETVALIDATORREQUEST._serialized_start=335
- _GETVALIDATORREQUEST._serialized_end=382
- _GETVALIDATORBYNUMBERREQUEST._serialized_start=384
- _GETVALIDATORBYNUMBERREQUEST._serialized_end=437
- _GETVALIDATORSRESPONSE._serialized_start=439
- _GETVALIDATORSRESPONSE._serialized_end=517
- _GETVALIDATORRESPONSE._serialized_start=519
- _GETVALIDATORRESPONSE._serialized_end=594
- _GETBLOCKREQUEST._serialized_start=596
- _GETBLOCKREQUEST._serialized_end=691
- _GETBLOCKRESPONSE._serialized_start=694
- _GETBLOCKRESPONSE._serialized_end=953
- _GETBLOCKHASHREQUEST._serialized_start=955
- _GETBLOCKHASHREQUEST._serialized_end=1000
- _GETBLOCKHASHRESPONSE._serialized_start=1002
- _GETBLOCKHASHRESPONSE._serialized_end=1044
- _GETBLOCKHEIGHTREQUEST._serialized_start=1046
- _GETBLOCKHEIGHTREQUEST._serialized_end=1089
- _GETBLOCKHEIGHTRESPONSE._serialized_start=1091
- _GETBLOCKHEIGHTRESPONSE._serialized_end=1139
- _GETBLOCKCHAININFOREQUEST._serialized_start=1141
- _GETBLOCKCHAININFOREQUEST._serialized_end=1167
- _GETBLOCKCHAININFORESPONSE._serialized_start=1170
- _GETBLOCKCHAININFORESPONSE._serialized_end=1511
- _GETCONSENSUSINFOREQUEST._serialized_start=1513
- _GETCONSENSUSINFOREQUEST._serialized_end=1538
- _GETCONSENSUSINFORESPONSE._serialized_start=1540
- _GETCONSENSUSINFORESPONSE._serialized_end=1619
- _VALIDATORINFO._serialized_start=1622
- _VALIDATORINFO._serialized_end=1945
- _ACCOUNTINFO._serialized_start=1948
- _ACCOUNTINFO._serialized_end=2079
- _BLOCKHEADERINFO._serialized_start=2082
- _BLOCKHEADERINFO._serialized_end=2278
- _CERTIFICATEINFO._serialized_start=2281
- _CERTIFICATEINFO._serialized_end=2432
- _VOTEINFO._serialized_start=2434
- _VOTEINFO._serialized_end=2557
- _CONSENSUSINFO._serialized_start=2560
- _CONSENSUSINFO._serialized_end=2711
- _BLOCKCHAIN._serialized_start=2882
- _BLOCKCHAIN._serialized_end=3790
+ _GETVALIDATORADDRESSESREQUEST._serialized_start=216
+ _GETVALIDATORADDRESSESREQUEST._serialized_end=246
+ _GETVALIDATORADDRESSESRESPONSE._serialized_start=248
+ _GETVALIDATORADDRESSESRESPONSE._serialized_end=309
+ _GETVALIDATORREQUEST._serialized_start=311
+ _GETVALIDATORREQUEST._serialized_end=358
+ _GETVALIDATORBYNUMBERREQUEST._serialized_start=360
+ _GETVALIDATORBYNUMBERREQUEST._serialized_end=413
+ _GETVALIDATORRESPONSE._serialized_start=415
+ _GETVALIDATORRESPONSE._serialized_end=490
+ _GETBLOCKREQUEST._serialized_start=492
+ _GETBLOCKREQUEST._serialized_end=587
+ _GETBLOCKRESPONSE._serialized_start=590
+ _GETBLOCKRESPONSE._serialized_end=849
+ _GETBLOCKHASHREQUEST._serialized_start=851
+ _GETBLOCKHASHREQUEST._serialized_end=896
+ _GETBLOCKHASHRESPONSE._serialized_start=898
+ _GETBLOCKHASHRESPONSE._serialized_end=940
+ _GETBLOCKHEIGHTREQUEST._serialized_start=942
+ _GETBLOCKHEIGHTREQUEST._serialized_end=985
+ _GETBLOCKHEIGHTRESPONSE._serialized_start=987
+ _GETBLOCKHEIGHTRESPONSE._serialized_end=1035
+ _GETBLOCKCHAININFOREQUEST._serialized_start=1037
+ _GETBLOCKCHAININFOREQUEST._serialized_end=1063
+ _GETBLOCKCHAININFORESPONSE._serialized_start=1066
+ _GETBLOCKCHAININFORESPONSE._serialized_end=1407
+ _GETCONSENSUSINFOREQUEST._serialized_start=1409
+ _GETCONSENSUSINFOREQUEST._serialized_end=1434
+ _GETCONSENSUSINFORESPONSE._serialized_start=1436
+ _GETCONSENSUSINFORESPONSE._serialized_end=1515
+ _VALIDATORINFO._serialized_start=1518
+ _VALIDATORINFO._serialized_end=1847
+ _ACCOUNTINFO._serialized_start=1850
+ _ACCOUNTINFO._serialized_end=1981
+ _BLOCKHEADERINFO._serialized_start=1984
+ _BLOCKHEADERINFO._serialized_end=2180
+ _CERTIFICATEINFO._serialized_start=2183
+ _CERTIFICATEINFO._serialized_end=2334
+ _VOTEINFO._serialized_start=2336
+ _VOTEINFO._serialized_end=2459
+ _CONSENSUSINFO._serialized_start=2462
+ _CONSENSUSINFO._serialized_end=2613
+ _BLOCKCHAIN._serialized_start=2784
+ _BLOCKCHAIN._serialized_end=3614
# @@protoc_insertion_point(module_scope)
diff --git a/www/grpc/gen/python/blockchain_pb2_grpc.py b/www/grpc/gen/python/blockchain_pb2_grpc.py
index f9101a319..1112f0d9b 100644
--- a/www/grpc/gen/python/blockchain_pb2_grpc.py
+++ b/www/grpc/gen/python/blockchain_pb2_grpc.py
@@ -64,11 +64,6 @@ def __init__(self, channel):
request_serializer=blockchain__pb2.GetValidatorAddressesRequest.SerializeToString,
response_deserializer=blockchain__pb2.GetValidatorAddressesResponse.FromString,
)
- self.GetValidators = channel.unary_unary(
- '/pactus.Blockchain/GetValidators',
- request_serializer=blockchain__pb2.GetValidatorsRequest.SerializeToString,
- response_deserializer=blockchain__pb2.GetValidatorsResponse.FromString,
- )
class BlockchainServicer(object):
@@ -134,12 +129,6 @@ def GetValidatorAddresses(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
- def GetValidators(self, request, context):
- """Missing associated documentation comment in .proto file."""
- context.set_code(grpc.StatusCode.UNIMPLEMENTED)
- context.set_details('Method not implemented!')
- raise NotImplementedError('Method not implemented!')
-
def add_BlockchainServicer_to_server(servicer, server):
rpc_method_handlers = {
@@ -193,11 +182,6 @@ def add_BlockchainServicer_to_server(servicer, server):
request_deserializer=blockchain__pb2.GetValidatorAddressesRequest.FromString,
response_serializer=blockchain__pb2.GetValidatorAddressesResponse.SerializeToString,
),
- 'GetValidators': grpc.unary_unary_rpc_method_handler(
- servicer.GetValidators,
- request_deserializer=blockchain__pb2.GetValidatorsRequest.FromString,
- response_serializer=blockchain__pb2.GetValidatorsResponse.SerializeToString,
- ),
}
generic_handler = grpc.method_handlers_generic_handler(
'pactus.Blockchain', rpc_method_handlers)
@@ -377,20 +361,3 @@ def GetValidatorAddresses(request,
blockchain__pb2.GetValidatorAddressesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
-
- @staticmethod
- def GetValidators(request,
- target,
- options=(),
- channel_credentials=None,
- call_credentials=None,
- insecure=False,
- compression=None,
- wait_for_ready=None,
- timeout=None,
- metadata=None):
- return grpc.experimental.unary_unary(request, target, '/pactus.Blockchain/GetValidators',
- blockchain__pb2.GetValidatorsRequest.SerializeToString,
- blockchain__pb2.GetValidatorsResponse.FromString,
- options, channel_credentials,
- insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
diff --git a/www/grpc/gen/python/network_pb2.py b/www/grpc/gen/python/network_pb2.py
index 93d8a0aad..d348c90e7 100644
--- a/www/grpc/gen/python/network_pb2.py
+++ b/www/grpc/gen/python/network_pb2.py
@@ -13,7 +13,7 @@
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x06pactus\"\x17\n\x15GetNetworkInfoRequest\"\xbb\x01\n\x16GetNetworkInfoResponse\x12(\n\x10total_sent_bytes\x18\x01 \x01(\x05R\x0etotalSentBytes\x12\x30\n\x14total_received_bytes\x18\x02 \x01(\x05R\x12totalReceivedBytes\x12\x1d\n\nstarted_at\x18\x03 \x01(\x03R\tstartedAt\x12&\n\x05peers\x18\x04 \x03(\x0b\x32\x10.pactus.PeerInfoR\x05peers\"\x14\n\x12GetNodeInfoRequest\"^\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\x0cR\x06peerId\"\xc5\x03\n\x08PeerInfo\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\x0cR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x04 \x03(\tR\rconsensusKeys\x12\x14\n\x05\x66lags\x18\x05 \x01(\x05R\x05\x66lags\x12\x16\n\x06height\x18\x06 \x01(\rR\x06height\x12+\n\x11received_messages\x18\x07 \x01(\x05R\x10receivedMessages\x12)\n\x10invalid_messages\x18\x08 \x01(\x05R\x0finvalidMessages\x12%\n\x0ereceived_bytes\x18\t \x01(\x05R\rreceivedBytes\x12\x16\n\x06status\x18\n \x01(\x05R\x06status\x12\x1b\n\tlast_sent\x18\x0b \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\x0c \x01(\x03R\x0clastReceived\x12!\n\x0csend_success\x18\r \x01(\x05R\x0bsendSuccess\x12\x1f\n\x0bsend_failed\x18\x0e \x01(\x05R\nsendFailed2\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\rnetwork.proto\x12\x06pactus\"\x17\n\x15GetNetworkInfoRequest\"\xe3\x03\n\x16GetNetworkInfoResponse\x12(\n\x10total_sent_bytes\x18\x01 \x01(\x05R\x0etotalSentBytes\x12\x30\n\x14total_received_bytes\x18\x02 \x01(\x05R\x12totalReceivedBytes\x12\x1d\n\nstarted_at\x18\x03 \x01(\x03R\tstartedAt\x12&\n\x05peers\x18\x04 \x03(\x0b\x32\x10.pactus.PeerInfoR\x05peers\x12L\n\nsent_bytes\x18\x05 \x03(\x0b\x32-.pactus.GetNetworkInfoResponse.SentBytesEntryR\tsentBytes\x12X\n\x0ereceived_bytes\x18\x06 \x03(\x0b\x32\x31.pactus.GetNetworkInfoResponse.ReceivedBytesEntryR\rreceivedBytes\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\"\x14\n\x12GetNodeInfoRequest\"^\n\x13GetNodeInfoResponse\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\x0cR\x06peerId\"\xd2\x05\n\x08PeerInfo\x12\x18\n\x07moniker\x18\x01 \x01(\tR\x07moniker\x12\x14\n\x05\x61gent\x18\x02 \x01(\tR\x05\x61gent\x12\x17\n\x07peer_id\x18\x03 \x01(\x0cR\x06peerId\x12%\n\x0e\x63onsensus_keys\x18\x04 \x03(\tR\rconsensusKeys\x12\x14\n\x05\x66lags\x18\x05 \x01(\x05R\x05\x66lags\x12\x16\n\x06height\x18\x06 \x01(\rR\x06height\x12+\n\x11received_messages\x18\x07 \x01(\x05R\x10receivedMessages\x12)\n\x10invalid_messages\x18\x08 \x01(\x05R\x0finvalidMessages\x12>\n\nsent_bytes\x18\t \x03(\x0b\x32\x1f.pactus.PeerInfo.SentBytesEntryR\tsentBytes\x12J\n\x0ereceived_bytes\x18\n \x03(\x0b\x32#.pactus.PeerInfo.ReceivedBytesEntryR\rreceivedBytes\x12\x16\n\x06status\x18\x0b \x01(\x05R\x06status\x12\x1b\n\tlast_sent\x18\x0c \x01(\x03R\x08lastSent\x12#\n\rlast_received\x18\r \x01(\x03R\x0clastReceived\x12!\n\x0csend_success\x18\x0e \x01(\x05R\x0bsendSuccess\x12\x1f\n\x0bsend_failed\x18\x0f \x01(\x05R\nsendFailed\x12&\n\x0flast_block_hash\x18\x10 \x01(\x0cR\rlastBlockHash\x1a<\n\x0eSentBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x1a@\n\x12ReceivedBytesEntry\x12\x10\n\x03key\x18\x01 \x01(\x05R\x03key\x12\x14\n\x05value\x18\x02 \x01(\x03R\x05value:\x02\x38\x01\x32\xa2\x01\n\x07Network\x12O\n\x0eGetNetworkInfo\x12\x1d.pactus.GetNetworkInfoRequest\x1a\x1e.pactus.GetNetworkInfoResponse\x12\x46\n\x0bGetNodeInfo\x12\x1a.pactus.GetNodeInfoRequest\x1a\x1b.pactus.GetNodeInfoResponseBB\n\x0epactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'network_pb2', globals())
@@ -21,16 +21,32 @@
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\016pactus.networkZ0github.com/pactus-project/pactus/www/grpc/pactus'
+ _GETNETWORKINFORESPONSE_SENTBYTESENTRY._options = None
+ _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_options = b'8\001'
+ _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._options = None
+ _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_options = b'8\001'
+ _PEERINFO_SENTBYTESENTRY._options = None
+ _PEERINFO_SENTBYTESENTRY._serialized_options = b'8\001'
+ _PEERINFO_RECEIVEDBYTESENTRY._options = None
+ _PEERINFO_RECEIVEDBYTESENTRY._serialized_options = b'8\001'
_GETNETWORKINFOREQUEST._serialized_start=25
_GETNETWORKINFOREQUEST._serialized_end=48
_GETNETWORKINFORESPONSE._serialized_start=51
- _GETNETWORKINFORESPONSE._serialized_end=238
- _GETNODEINFOREQUEST._serialized_start=240
- _GETNODEINFOREQUEST._serialized_end=260
- _GETNODEINFORESPONSE._serialized_start=262
- _GETNODEINFORESPONSE._serialized_end=356
- _PEERINFO._serialized_start=359
- _PEERINFO._serialized_end=812
- _NETWORK._serialized_start=815
- _NETWORK._serialized_end=977
+ _GETNETWORKINFORESPONSE._serialized_end=534
+ _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_start=408
+ _GETNETWORKINFORESPONSE_SENTBYTESENTRY._serialized_end=468
+ _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_start=470
+ _GETNETWORKINFORESPONSE_RECEIVEDBYTESENTRY._serialized_end=534
+ _GETNODEINFOREQUEST._serialized_start=536
+ _GETNODEINFOREQUEST._serialized_end=556
+ _GETNODEINFORESPONSE._serialized_start=558
+ _GETNODEINFORESPONSE._serialized_end=652
+ _PEERINFO._serialized_start=655
+ _PEERINFO._serialized_end=1377
+ _PEERINFO_SENTBYTESENTRY._serialized_start=408
+ _PEERINFO_SENTBYTESENTRY._serialized_end=468
+ _PEERINFO_RECEIVEDBYTESENTRY._serialized_start=470
+ _PEERINFO_RECEIVEDBYTESENTRY._serialized_end=534
+ _NETWORK._serialized_start=1380
+ _NETWORK._serialized_end=1542
# @@protoc_insertion_point(module_scope)
diff --git a/www/grpc/gen/python/transaction_pb2.py b/www/grpc/gen/python/transaction_pb2.py
index 1be4295d0..e0248416a 100644
--- a/www/grpc/gen/python/transaction_pb2.py
+++ b/www/grpc/gen/python/transaction_pb2.py
@@ -13,7 +13,7 @@
-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11transaction.proto\x12\x06pactus\"c\n\x15GetTransactionRequest\x12\x0e\n\x02id\x18\x01 \x01(\x0cR\x02id\x12:\n\tverbosity\x18\x02 \x01(\x0e\x32\x1c.pactus.TransactionVerbosityR\tverbosity\"\x95\x01\n\x16GetTransactionResponse\x12!\n\x0c\x62lock_height\x18\x0c \x01(\rR\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\r \x01(\rR\tblockTime\x12\x39\n\x0btransaction\x18\x03 \x01(\x0b\x32\x17.pactus.TransactionInfoR\x0btransaction\"/\n\x19SendRawTransactionRequest\x12\x12\n\x04\x64\x61ta\x18\x01 \x01(\x0cR\x04\x64\x61ta\",\n\x1aSendRawTransactionResponse\x12\x0e\n\x02id\x18\x02 \x01(\x0cR\x02id\"]\n\x0fPayloadTransfer\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"W\n\x0bPayloadBond\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x03 \x01(\x03R\x05stake\"B\n\x10PayloadSortition\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05proof\x18\x02 \x01(\x0cR\x05proof\"-\n\rPayloadUnbond\x12\x1c\n\tvalidator\x18\x01 \x01(\tR\tvalidator\"M\n\x0fPayloadWithdraw\x12\x12\n\x04\x66rom\x18\x01 \x01(\tR\x04\x66rom\x12\x0e\n\x02to\x18\x02 \x01(\tR\x02to\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"\xc0\x04\n\x0fTransactionInfo\x12\x0e\n\x02id\x18\x01 \x01(\x0cR\x02id\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x18\n\x07version\x18\x03 \x01(\x05R\x07version\x12\x14\n\x05stamp\x18\x04 \x01(\x0cR\x05stamp\x12\x1a\n\x08sequence\x18\x05 \x01(\x05R\x08sequence\x12\x14\n\x05value\x18\x06 \x01(\x03R\x05value\x12\x10\n\x03\x66\x65\x65\x18\x07 \x01(\x03R\x03\x66\x65\x65\x12\x35\n\x0bPayloadType\x18\x08 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bPayloadType\x12\x35\n\x08transfer\x18\x1e \x01(\x0b\x32\x17.pactus.PayloadTransferH\x00R\x08transfer\x12)\n\x04\x62ond\x18\x1f \x01(\x0b\x32\x13.pactus.PayloadBondH\x00R\x04\x62ond\x12\x38\n\tsortition\x18 \x01(\x0b\x32\x18.pactus.PayloadSortitionH\x00R\tsortition\x12/\n\x06unbond\x18! \x01(\x0b\x32\x15.pactus.PayloadUnbondH\x00R\x06unbond\x12\x35\n\x08withdraw\x18\" \x01(\x0b\x32\x17.pactus.PayloadWithdrawH\x00R\x08withdraw\x12\x12\n\x04memo\x18\t \x01(\tR\x04memo\x12\x1d\n\npublic_key\x18\n \x01(\tR\tpublicKey\x12\x1c\n\tsignature\x18\x0b \x01(\x0cR\tsignatureB\t\n\x07Payload*\x83\x01\n\x0bPayloadType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10TRANSFER_PAYLOAD\x10\x01\x12\x10\n\x0c\x42OND_PAYLOAD\x10\x02\x12\x15\n\x11SORTITION_PAYLOAD\x10\x03\x12\x12\n\x0eUNBOND_PAYLOAD\x10\x04\x12\x14\n\x10WITHDRAW_PAYLOAD\x10\x05*B\n\x14TransactionVerbosity\x12\x14\n\x10TRANSACTION_DATA\x10\x00\x12\x14\n\x10TRANSACTION_INFO\x10\x01\x32\xbb\x01\n\x0bTransaction\x12O\n\x0eGetTransaction\x12\x1d.pactus.GetTransactionRequest\x1a\x1e.pactus.GetTransactionResponse\x12[\n\x12SendRawTransaction\x12!.pactus.SendRawTransactionRequest\x1a\".pactus.SendRawTransactionResponseBF\n\x12pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x11transaction.proto\x12\x06pactus\"c\n\x15GetTransactionRequest\x12\x0e\n\x02id\x18\x01 \x01(\x0cR\x02id\x12:\n\tverbosity\x18\x02 \x01(\x0e\x32\x1c.pactus.TransactionVerbosityR\tverbosity\"\x95\x01\n\x16GetTransactionResponse\x12!\n\x0c\x62lock_height\x18\x0c \x01(\rR\x0b\x62lockHeight\x12\x1d\n\nblock_time\x18\r \x01(\rR\tblockTime\x12\x39\n\x0btransaction\x18\x03 \x01(\x0b\x32\x17.pactus.TransactionInfoR\x0btransaction\"d\n\x13\x43\x61lculateFeeRequest\x12\x16\n\x06\x61mount\x18\x01 \x01(\x03R\x06\x61mount\x12\x35\n\x0bpayloadType\x18\x02 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\"(\n\x14\x43\x61lculateFeeResponse\x12\x10\n\x03\x66\x65\x65\x18\x01 \x01(\x03R\x03\x66\x65\x65\"/\n\x19SendRawTransactionRequest\x12\x12\n\x04\x64\x61ta\x18\x01 \x01(\x0cR\x04\x64\x61ta\",\n\x1aSendRawTransactionResponse\x12\x0e\n\x02id\x18\x02 \x01(\x0cR\x02id\"]\n\x0fPayloadTransfer\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"W\n\x0bPayloadBond\x12\x16\n\x06sender\x18\x01 \x01(\tR\x06sender\x12\x1a\n\x08receiver\x18\x02 \x01(\tR\x08receiver\x12\x14\n\x05stake\x18\x03 \x01(\x03R\x05stake\"B\n\x10PayloadSortition\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\x12\x14\n\x05proof\x18\x02 \x01(\x0cR\x05proof\"-\n\rPayloadUnbond\x12\x1c\n\tvalidator\x18\x01 \x01(\tR\tvalidator\"M\n\x0fPayloadWithdraw\x12\x12\n\x04\x66rom\x18\x01 \x01(\tR\x04\x66rom\x12\x0e\n\x02to\x18\x02 \x01(\tR\x02to\x12\x16\n\x06\x61mount\x18\x03 \x01(\x03R\x06\x61mount\"\xc0\x04\n\x0fTransactionInfo\x12\x0e\n\x02id\x18\x01 \x01(\x0cR\x02id\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x18\n\x07version\x18\x03 \x01(\x05R\x07version\x12\x14\n\x05stamp\x18\x04 \x01(\x0cR\x05stamp\x12\x1a\n\x08sequence\x18\x05 \x01(\x05R\x08sequence\x12\x14\n\x05value\x18\x06 \x01(\x03R\x05value\x12\x10\n\x03\x66\x65\x65\x18\x07 \x01(\x03R\x03\x66\x65\x65\x12\x35\n\x0bpayloadType\x18\x08 \x01(\x0e\x32\x13.pactus.PayloadTypeR\x0bpayloadType\x12\x35\n\x08transfer\x18\x1e \x01(\x0b\x32\x17.pactus.PayloadTransferH\x00R\x08transfer\x12)\n\x04\x62ond\x18\x1f \x01(\x0b\x32\x13.pactus.PayloadBondH\x00R\x04\x62ond\x12\x38\n\tsortition\x18 \x01(\x0b\x32\x18.pactus.PayloadSortitionH\x00R\tsortition\x12/\n\x06unbond\x18! \x01(\x0b\x32\x15.pactus.PayloadUnbondH\x00R\x06unbond\x12\x35\n\x08withdraw\x18\" \x01(\x0b\x32\x17.pactus.PayloadWithdrawH\x00R\x08withdraw\x12\x12\n\x04memo\x18\t \x01(\tR\x04memo\x12\x1d\n\npublic_key\x18\n \x01(\tR\tpublicKey\x12\x1c\n\tsignature\x18\x0b \x01(\x0cR\tsignatureB\t\n\x07payload*\x83\x01\n\x0bPayloadType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x14\n\x10TRANSFER_PAYLOAD\x10\x01\x12\x10\n\x0c\x42OND_PAYLOAD\x10\x02\x12\x15\n\x11SORTITION_PAYLOAD\x10\x03\x12\x12\n\x0eUNBOND_PAYLOAD\x10\x04\x12\x14\n\x10WITHDRAW_PAYLOAD\x10\x05*B\n\x14TransactionVerbosity\x12\x14\n\x10TRANSACTION_DATA\x10\x00\x12\x14\n\x10TRANSACTION_INFO\x10\x01\x32\x86\x02\n\x0bTransaction\x12O\n\x0eGetTransaction\x12\x1d.pactus.GetTransactionRequest\x1a\x1e.pactus.GetTransactionResponse\x12I\n\x0c\x43\x61lculateFee\x12\x1b.pactus.CalculateFeeRequest\x1a\x1c.pactus.CalculateFeeResponse\x12[\n\x12SendRawTransaction\x12!.pactus.SendRawTransactionRequest\x1a\".pactus.SendRawTransactionResponseBF\n\x12pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactusb\x06proto3')
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals())
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'transaction_pb2', globals())
@@ -21,30 +21,34 @@
DESCRIPTOR._options = None
DESCRIPTOR._serialized_options = b'\n\022pactus.transactionZ0github.com/pactus-project/pactus/www/grpc/pactus'
- _PAYLOADTYPE._serialized_start=1335
- _PAYLOADTYPE._serialized_end=1466
- _TRANSACTIONVERBOSITY._serialized_start=1468
- _TRANSACTIONVERBOSITY._serialized_end=1534
+ _PAYLOADTYPE._serialized_start=1479
+ _PAYLOADTYPE._serialized_end=1610
+ _TRANSACTIONVERBOSITY._serialized_start=1612
+ _TRANSACTIONVERBOSITY._serialized_end=1678
_GETTRANSACTIONREQUEST._serialized_start=29
_GETTRANSACTIONREQUEST._serialized_end=128
_GETTRANSACTIONRESPONSE._serialized_start=131
_GETTRANSACTIONRESPONSE._serialized_end=280
- _SENDRAWTRANSACTIONREQUEST._serialized_start=282
- _SENDRAWTRANSACTIONREQUEST._serialized_end=329
- _SENDRAWTRANSACTIONRESPONSE._serialized_start=331
- _SENDRAWTRANSACTIONRESPONSE._serialized_end=375
- _PAYLOADTRANSFER._serialized_start=377
- _PAYLOADTRANSFER._serialized_end=470
- _PAYLOADBOND._serialized_start=472
- _PAYLOADBOND._serialized_end=559
- _PAYLOADSORTITION._serialized_start=561
- _PAYLOADSORTITION._serialized_end=627
- _PAYLOADUNBOND._serialized_start=629
- _PAYLOADUNBOND._serialized_end=674
- _PAYLOADWITHDRAW._serialized_start=676
- _PAYLOADWITHDRAW._serialized_end=753
- _TRANSACTIONINFO._serialized_start=756
- _TRANSACTIONINFO._serialized_end=1332
- _TRANSACTION._serialized_start=1537
- _TRANSACTION._serialized_end=1724
+ _CALCULATEFEEREQUEST._serialized_start=282
+ _CALCULATEFEEREQUEST._serialized_end=382
+ _CALCULATEFEERESPONSE._serialized_start=384
+ _CALCULATEFEERESPONSE._serialized_end=424
+ _SENDRAWTRANSACTIONREQUEST._serialized_start=426
+ _SENDRAWTRANSACTIONREQUEST._serialized_end=473
+ _SENDRAWTRANSACTIONRESPONSE._serialized_start=475
+ _SENDRAWTRANSACTIONRESPONSE._serialized_end=519
+ _PAYLOADTRANSFER._serialized_start=521
+ _PAYLOADTRANSFER._serialized_end=614
+ _PAYLOADBOND._serialized_start=616
+ _PAYLOADBOND._serialized_end=703
+ _PAYLOADSORTITION._serialized_start=705
+ _PAYLOADSORTITION._serialized_end=771
+ _PAYLOADUNBOND._serialized_start=773
+ _PAYLOADUNBOND._serialized_end=818
+ _PAYLOADWITHDRAW._serialized_start=820
+ _PAYLOADWITHDRAW._serialized_end=897
+ _TRANSACTIONINFO._serialized_start=900
+ _TRANSACTIONINFO._serialized_end=1476
+ _TRANSACTION._serialized_start=1681
+ _TRANSACTION._serialized_end=1943
# @@protoc_insertion_point(module_scope)
diff --git a/www/grpc/gen/python/transaction_pb2_grpc.py b/www/grpc/gen/python/transaction_pb2_grpc.py
index 2e7de6507..a9bd62ab8 100644
--- a/www/grpc/gen/python/transaction_pb2_grpc.py
+++ b/www/grpc/gen/python/transaction_pb2_grpc.py
@@ -19,6 +19,11 @@ def __init__(self, channel):
request_serializer=transaction__pb2.GetTransactionRequest.SerializeToString,
response_deserializer=transaction__pb2.GetTransactionResponse.FromString,
)
+ self.CalculateFee = channel.unary_unary(
+ '/pactus.Transaction/CalculateFee',
+ request_serializer=transaction__pb2.CalculateFeeRequest.SerializeToString,
+ response_deserializer=transaction__pb2.CalculateFeeResponse.FromString,
+ )
self.SendRawTransaction = channel.unary_unary(
'/pactus.Transaction/SendRawTransaction',
request_serializer=transaction__pb2.SendRawTransactionRequest.SerializeToString,
@@ -35,6 +40,12 @@ def GetTransaction(self, request, context):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
+ def CalculateFee(self, request, context):
+ """Missing associated documentation comment in .proto file."""
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
+ context.set_details('Method not implemented!')
+ raise NotImplementedError('Method not implemented!')
+
def SendRawTransaction(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
@@ -49,6 +60,11 @@ def add_TransactionServicer_to_server(servicer, server):
request_deserializer=transaction__pb2.GetTransactionRequest.FromString,
response_serializer=transaction__pb2.GetTransactionResponse.SerializeToString,
),
+ 'CalculateFee': grpc.unary_unary_rpc_method_handler(
+ servicer.CalculateFee,
+ request_deserializer=transaction__pb2.CalculateFeeRequest.FromString,
+ response_serializer=transaction__pb2.CalculateFeeResponse.SerializeToString,
+ ),
'SendRawTransaction': grpc.unary_unary_rpc_method_handler(
servicer.SendRawTransaction,
request_deserializer=transaction__pb2.SendRawTransactionRequest.FromString,
@@ -81,6 +97,23 @@ def GetTransaction(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+ @staticmethod
+ def CalculateFee(request,
+ target,
+ options=(),
+ channel_credentials=None,
+ call_credentials=None,
+ insecure=False,
+ compression=None,
+ wait_for_ready=None,
+ timeout=None,
+ metadata=None):
+ return grpc.experimental.unary_unary(request, target, '/pactus.Transaction/CalculateFee',
+ transaction__pb2.CalculateFeeRequest.SerializeToString,
+ transaction__pb2.CalculateFeeResponse.FromString,
+ options, channel_credentials,
+ insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
+
@staticmethod
def SendRawTransaction(request,
target,
diff --git a/www/grpc/grpc-gateway.config.yaml b/www/grpc/grpc-gateway.config.yaml
index 1706218af..d0403eac9 100644
--- a/www/grpc/grpc-gateway.config.yaml
+++ b/www/grpc/grpc-gateway.config.yaml
@@ -19,9 +19,6 @@ http:
- selector: pactus.Blockchain.GetAccountByNumber
get: "/v1/blockchain/account/number/{number}"
- - selector: pactus.Blockchain.GetValidators
- get: "/v1/blockchain/validators"
-
- selector: pactus.Blockchain.GetValidator
get: "/v1/blockchain/validator/address/{address}"
@@ -45,6 +42,9 @@ http:
- selector: pactus.Network.GetNodeInfo
get: "/v1/network/node"
+ - selector: pactus.Transaction.CalculateFee
+ get: "/v1/transaction/amount/{amount}/payloadType/{payloadType}"
+
# Wallet APIs
- selector: pactus.Wallet.CreateWallet
get: "/v1/wallet/create/name/{name}/mnemonic/{mnemonic}/language/{language}"
diff --git a/www/grpc/network.go b/www/grpc/network.go
index 099061408..0c157cff4 100644
--- a/www/grpc/network.go
+++ b/www/grpc/network.go
@@ -2,6 +2,7 @@ package grpc
import (
"context"
+ "unsafe"
"github.com/fxamacker/cbor/v2"
"github.com/pactus-project/pactus/sync"
@@ -12,7 +13,7 @@ import (
type networkServer struct {
sync sync.Synchronizer
- logger *logger.Logger
+ logger *logger.SubLogger
}
func (s *networkServer) GetNetworkInfo(_ context.Context,
@@ -38,20 +39,27 @@ func (s *networkServer) GetNetworkInfo(_ context.Context,
p.Height = peer.Height
p.ReceivedMessages = int32(peer.ReceivedBundles)
p.InvalidMessages = int32(peer.InvalidBundles)
- p.ReceivedBytes = int32(peer.ReceivedBytes)
+ p.ReceivedBytes = *(*map[int32]int64)(unsafe.Pointer(&peer.ReceivedBytes))
+ p.SentBytes = *(*map[int32]int64)(unsafe.Pointer(&peer.SentBytes))
p.Status = int32(peer.Status)
p.LastReceived = peer.LastReceived.Unix()
p.SendSuccess = int32(peer.SendSuccess)
p.SendFailed = int32(peer.SendFailed)
+ p.LastBlockHash = peer.LastBlockHash.Bytes()
for key := range peer.ConsensusKeys {
p.ConsensusKeys = append(p.ConsensusKeys, key.String())
}
}
+ sentBytes := peerset.SentBytes()
+ receivedBytes := peerset.ReceivedBytes()
+
return &pactus.GetNetworkInfoResponse{
TotalSentBytes: int32(peerset.TotalSentBytes()),
TotalReceivedBytes: int32(peerset.TotalReceivedBytes()),
+ SentBytes: *(*map[int32]int64)(unsafe.Pointer(&sentBytes)),
+ ReceivedBytes: *(*map[int32]int64)(unsafe.Pointer(&receivedBytes)),
StartedAt: peerset.StartedAt().Unix(),
Peers: peers,
}, nil
diff --git a/www/grpc/proto/blockchain.proto b/www/grpc/proto/blockchain.proto
index a20c13823..8c62daea7 100644
--- a/www/grpc/proto/blockchain.proto
+++ b/www/grpc/proto/blockchain.proto
@@ -21,7 +21,6 @@ service Blockchain {
returns (GetValidatorResponse);
rpc GetValidatorAddresses(GetValidatorAddressesRequest)
returns(GetValidatorAddressesResponse);
- rpc GetValidators(GetValidatorsRequest) returns (GetValidatorsResponse);
}
message GetAccountRequest { string address = 1; }
@@ -32,8 +31,6 @@ message GetAccountByNumberRequest {
message GetAccountResponse { AccountInfo account = 1; }
-message GetValidatorsRequest {}
-
message GetValidatorAddressesRequest {}
message GetValidatorAddressesResponse { repeated string addresses = 1; }
@@ -42,8 +39,6 @@ message GetValidatorRequest { string address = 1; }
message GetValidatorByNumberRequest { int32 number = 1; }
-message GetValidatorsResponse { repeated ValidatorInfo validators = 1; }
-
message GetValidatorResponse { ValidatorInfo validator = 1; }
message GetBlockRequest {
@@ -95,7 +90,7 @@ message ValidatorInfo {
int32 sequence = 5;
int64 stake = 6;
uint32 last_bonding_height = 7;
- uint32 last_joined_height = 8;
+ uint32 last_sortition_height = 8;
uint32 unbonding_height = 9;
string address = 10;
}
diff --git a/www/grpc/proto/network.proto b/www/grpc/proto/network.proto
index aaee2c755..c91a71901 100644
--- a/www/grpc/proto/network.proto
+++ b/www/grpc/proto/network.proto
@@ -9,6 +9,7 @@ service Network {
rpc GetNodeInfo(GetNodeInfoRequest) returns (GetNodeInfoResponse);
}
+
message GetNetworkInfoRequest {}
message GetNetworkInfoResponse {
@@ -16,6 +17,8 @@ message GetNetworkInfoResponse {
int32 total_received_bytes = 2;
int64 started_at = 3;
repeated PeerInfo peers = 4;
+ map sent_bytes = 5;
+ map received_bytes = 6;
}
message GetNodeInfoRequest {}
@@ -35,10 +38,12 @@ message PeerInfo {
uint32 height = 6;
int32 received_messages = 7;
int32 invalid_messages = 8;
- int32 received_bytes = 9;
- int32 status = 10;
- int64 last_sent = 11;
- int64 last_received = 12;
- int32 send_success = 13;
- int32 send_failed = 14;
+ map sent_bytes = 9;
+ map received_bytes = 10;
+ int32 status = 11;
+ int64 last_sent = 12;
+ int64 last_received = 13;
+ int32 send_success = 14;
+ int32 send_failed = 15;
+ bytes last_block_hash = 16;
}
diff --git a/www/grpc/proto/transaction.proto b/www/grpc/proto/transaction.proto
index 4ca116ce9..fe70674d1 100644
--- a/www/grpc/proto/transaction.proto
+++ b/www/grpc/proto/transaction.proto
@@ -5,6 +5,7 @@ option java_package = "pactus.transaction";
service Transaction {
rpc GetTransaction(GetTransactionRequest) returns (GetTransactionResponse);
+ rpc CalculateFee(CalculateFeeRequest) returns (CalculateFeeResponse);
rpc SendRawTransaction(SendRawTransactionRequest) returns (SendRawTransactionResponse);
}
@@ -19,6 +20,15 @@ message GetTransactionResponse {
TransactionInfo transaction = 3;
}
+message CalculateFeeRequest {
+ int64 amount = 1;
+ PayloadType payloadType = 2;
+}
+
+message CalculateFeeResponse {
+ int64 fee = 1;
+}
+
message SendRawTransactionRequest { bytes data = 1; }
message SendRawTransactionResponse { bytes id = 2; }
@@ -58,8 +68,8 @@ message TransactionInfo {
int32 sequence = 5;
int64 value = 6;
int64 fee = 7;
- PayloadType PayloadType = 8;
- oneof Payload {
+ PayloadType payloadType = 8;
+ oneof payload {
PayloadTransfer transfer = 30;
PayloadBond bond = 31;
PayloadSortition sortition = 32;
diff --git a/www/grpc/server.go b/www/grpc/server.go
index 7480a8ed4..93f005b01 100644
--- a/www/grpc/server.go
+++ b/www/grpc/server.go
@@ -21,7 +21,7 @@ type Server struct {
state state.Facade
sync sync.Synchronizer
consMgr consensus.ManagerReader
- logger *logger.Logger
+ logger *logger.SubLogger
}
func NewServer(conf *Config, state state.Facade, sync sync.Synchronizer,
@@ -32,7 +32,7 @@ func NewServer(conf *Config, state state.Facade, sync sync.Synchronizer,
state: state,
sync: sync,
consMgr: consMgr,
- logger: logger.NewLogger("_grpc", nil),
+ logger: logger.NewSubLogger("_grpc", nil),
}
}
diff --git a/www/grpc/server_test.go b/www/grpc/server_test.go
index 24aefd71c..2e880a38b 100644
--- a/www/grpc/server_test.go
+++ b/www/grpc/server_test.go
@@ -48,7 +48,7 @@ func init() {
tCtx = context.Background()
tMockState.CommitTestBlocks(10)
- logger := logger.NewLogger("_grpc", nil)
+ logger := logger.NewSubLogger("_grpc", nil)
s := grpc.NewServer()
blockchainServer := &blockchainServer{
diff --git a/www/grpc/statik/statik.go b/www/grpc/statik/statik.go
index 28a31a1d4..50f42a320 100644
--- a/www/grpc/statik/statik.go
+++ b/www/grpc/statik/statik.go
@@ -7,6 +7,6 @@ import (
)
func init() {
- data := "PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00 \x00README.mdUT\x05\x00\x01\x80Cm8l\x91\xc1n\xdb0\x0c\x86\xefz\n\x02\xbb4@b\x17=\xee\x16\xec\xb2\x0c\x1b6 \xe9.A\x810\x12ms\xb3E\x81\xa4;dO?\xa8\x89\xbb\x1ez\x92\x00R\xbf\xf8}\xfc\x00\xfb?\xd8\xf7\xa4\xf0\xb8\x0b\xe10\xb0Ab\xa5\xe8\xa2\x17\x88\x92\x1d9\x1b|>|\xfb\xba\x86/\xf8\x8c\x16\x95\x8b\xaf\x01s\x82O\xfb=\xa0\x19\xb9\x05\x1f\xd0!]2N\x1cq\x1c/\xd0S&E\xa7\xd7\xf8$q\x9e(;:K\x86Ne\x02\x0c\xc7\xef\x85\xf2\xf6\xc7\x0e\xf6\x85\"w\x1c\xaf\xd5\x9f\xa4V\xcf\x87\xe6\xfe\xe9np/\xf6\xb1m\xed\x1a\xd4\xb0\xb4I\xa2\xb5\xf6\xf6I\xfb\xb0\xb9o\xcfh\x1c7\xe6:G\x9f\x95\xdaU\x13\x0eu\xae\x8eG\x026\xc0\xd9e\xb3\x0c\x96\xe0|\x01\x9ds\xe6\xdc\xc3i\xc2\xdf\x04E\xc5\xe5\x04\x9c\xc1\x07\x02\x15\xf1 \x1dxu\xa2T\xc4\xb8Ji\xe00\x10X\xe5\x887z@%\x88R\x98\xd2\x15\xcc\x07\n\xc7\xc4\xe6\xd0\xc9\x98H\xffC\xf4\xec\xc3|n\xa2L\x0b\xcf\x06\x0b\xbf\xdegn]\x89\xda \xcdI\xdb\x1a\xb1j\xc2\xb6s\xd2\xfa\xc1\x85s\xbf\x86\xe3ii\xe7\xcc\xce8\xf2_\xd2\xe6\x97\x9d\x9e\xee\x9a\xb7I\xefw\xad\x02\x1bP\xe2j\xc0\x05F\xc1\xf4\x82{\xeb\xbe\xcaZ(`\x94\x88#\x18\xe93)p6'L\xf0\"\x85 Q\x87\xf3\xe8P\xc8\xcdE\xa9 \xe1\xb6\xec\xc7]\xd5=r\xa4l\x94`\xce\x89\x14\xb6\x05\xe3@u\xa7K\xa5 \xff\x02\x00\x00\xff\xffPK\x07\x08a\xb7>u\x81\x01\x00\x00~\x02\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x17\x00 \x00blockchain.swagger.jsonUT\x05\x00\x01\x80Cm8\xecZ\xdf\x8f\xda\xb8\x13\x7f\xe7\xaf\xb0\xf2\xfd>V\xa5\xd7;\xddC\x9f.\xfb\xa3-\xd7\x16\x10\xd0]\x9dN\xd5\xca$\x03\xb8M\xec\xd4v\xd8\xaeV\xfc\xef\xa7\x98\x10\x1c\xe3@\xc8\x8f\xdd\xd2\xdd\x95V@\x1c\x7f23\xfe\xccxf\x9c\xfb\x0eB\x8e\xb8\xc5\xf39p\xe7\x0dr^\xbf|\xe5\xbcH\xae\x11:c\xce\x1b\x94\x8c#\xe4H\"\x03H\xc6\xa7\x01\xf3\xbey\x0bL\xe8\xcb\x883\xc9\xd4\xcd\x089K\xe0\x820\x9a\xdc\x92~E\x94I$@:\x1d\x84V\nR\xe2\xb9p\xde\xa0\x7f\xd5\x8c50B\x0e\xc5\xa1B>\xcb\x90\x1d5\xb4\xea \xf4E\xcd\xf3\x18\x15q\x08\xdb\xb9\x0e\x8e\xa2\x80xX\x12F\xbb_\x05S3\xd6\xf7F\x9c\xf9\xb1W\xf2^,\x17b\xabcw\xf9[w\xab^\x17{\x1e\x8b\xa9\xecb\xdf\xe7 D\xf7>\xfd\xb2\xcaf \xe4\xccAj?\x11rX\x04\\=\xab\xe7\xe7\x95\xbay\x07\xd2]C\xa66S\xf7s\x10\x11\xa3\x02D\x0e\x06!\xe7\xf5\xabW\xc6%\x84\x1c\x1f\x84\xc7I$SK\xbbH\xc4\x9e\x07B\xcc\xe2\x00m\x90^j\xf0j\x92\xf0\x16\x10\xe2\x1d0\x84\x9c\xffs\x98%8\xff\xeb\xfa0#\x94$\xb8\xa2\x1baO\xc6b+\xee(\x05vr\xd3W\xda\xaf\x95\xfeD\xc7\x87\x19\x8e\x03yXz\x8ab\n?\"\xf0$\xf8\x088g\xbc9%x\xe4\x8d%\x96\xb1\xd8#u\xf6]\x93\xdf\x890\xc7!H\xe0[\n\xad\xff\x0ce6\xb4MYa\xcaK\x94\x8a \xc3\xcc\x11\x0e\xdfc\xc2!\xa1\x87\xe41\x18\xa3\xf2.R\xb0BrB\xe7\x8eU\xdc/\x9a\xb89\x9fJ\xaf\x99\x9e\xa4\xe6tt\x94T\xe1\"\xca\xd38\x9c\x02\xef\xde\xaf?\xeb\x13\xfe\xec\xae\xaf\x90\x9e\x89\xff\x0b\x11\x9f\x9aK\x8a\x9a\xe0=\xa1\x12\xe6\xbb\xb03\xc6C,\xd3\x1b~\x7f\xfd\xc0~\xa1\xbev\x17@\xe6\x0b\xd9\xbd_\x7f\xae\xbaK\xe0S&\x88\xbc\xeb\xdeg_k\xf8\x8a\xfau*\x1e\xa2\x84}\xf6\x0f\xf5W\xe0\x1fk\x9a<\x86\x7f\xfc\xf9\x87S\xb4\x06\x05\xb2f\xfcmZ\xdct\x1b3F\x81\xc6\xa1aDu\xfd\xec\xe3\xe0\xfc\xc3\xcd\x85;q\x8d\x19\xd9X\xaf\xffvP46\x19\xb9\xfd\xb1{>\xe9\x0d\xfa\xe3\xfc\xe2~\xb1.n\xbb\xe1\xe2f\x81\xc5\"\x0b\x165\xc3\xc2{,\x16'\x15\x1a\x12\x81\x9f\xc3\x83\xfa\xfb\xd9\xc3\xc3\x83\xf9\xc3f\xfb\xc4bQ\xdb\x1fL\xe3\x9d\x80G(\x91\x9f}B\xfd\x15\xf9D>\xcc\xa1&<\xc2\xbe\x03m\x1dbz'\xe1\x81\xfd!\xd7Z\xa9\xe6\x00\xeaW/\xc19%\x1f\xc8\xa4~Zn\xd0(y\x968 >\x96\x8c7\xd9\x98\xba\xda\x80\x9e\n\x9d2\x81\x9f\x16\x93\x8e\x0d\xa8\xbfRsjK\xfc\xfa}\xa9\x8c>\xa7\xd6\x99z\xe6})\xde?\xa1\xdeT\xe6\x16\xa2\x01w\x10'\xe7\x07\xe2i9BE\xeadGp\x9a\x10\x99\xb4\xce\xda\xaai\xd3\xbbg$\xa7\x1b\xf2\xb3\xe9W\xf0\xb6%\x97\x13\xf1\x84R\x92\x18\xf4X\xe7\xf0\x06a\xf6\xe4\xe2\x85\x99\xb8\xae\xb5\x8f\xa5i\xdc\xda\x98i\x88(@\xb5\xb9z\xb1\xa3\xeb\xb8\x02\xbe\xc7@=h\x1ey\x8a\x03\xbc\x07x\xbf!\x8c\xba\x7f\x95\xe7\xc7\x0b\x9d\x08i\xb9\x8a}\xe0u\xc9\xb0=\x15n\xd8\x16\x11\x87\xe5\xb63V\xc9\"\xc5\xd4\x10\x12K\x181f\x06\x89\xfa\xc0\x8cK\xe5|cP{M\xa3\xe0\xc9\x1a0\x01\xdcMs\xbe\xfd\xf0\xe5\x99p\x95\xf5\x86-D0\x84\xdd\xed\xec\xda{\xba\xf6n\xee\x9e>n\xb6}j\xf1[\x87\xb6\x08\x7f\x9e\x10rF<,\xa1.\x8d\xdb\x88i\x9c\xc5\xb4\x90\x03\xd5\x1d\xc3caHd\x9a)Y\xb11\xe78\xdf\xe7w\x88\x84\xd0\xbc\xbf\xa1\xbcG\x97\x0dO\x05P \xbb \xc5\xe3\x8b&\xc8\x9cb\x19\xf3\x8a\xd1\xd5X\xe6\x8e\xfei\xb02\xc9\x1f\xa8\x88E]N\xe2#\xdd\\S\xd6\xf5$Y\x16j:e,\x00L\xedS\xd3\xaeue\xda\xe6\xf6\xa0\xf6\xbda\xc9d\x13l\xdb\x97\x8c^\xb14\xbe\xd89\xb6\x87\n\x96\x17\x0d\xea\xf0!}\xb7\xc8Pv\x9f\xe8z\xc6WV\xe2\xdd\xd3\x9d\x1a27\x16W\xcb\xc8\x9c\xef\xbf\xd7\x91\xbaI\x1f(!\xf9O'\xf3\x8b\x16VP\xc3l#\xdbW\x05\xf3\x84\x84\x85Q\xaf\x86 T\xa6|\x8c\xdf\x99 \xb6\x156\xc9p\x93\x14\xe6\x18`3\xe5\xb1\x02\xcb\x1f-G\xc4 \xc7T`O5\x1b\xaa\x06\xc6\x82\xe3\x82\x1a\x1e\x10`\x91;;l\x9c\x07\xdb\x07\xb4\xe0\x13\x92I\x1c\xa4\xf1\xbap\xf9\x0e\xcb^\xb4O*\xf8+['\xa9\xc9\x07\x0c\xd9mq\xc5}\\\xf9\xaaAo2^h\x19\xfe\xb0y\x9aq\x9f\xec9\x95\x9d'\x97c6\xe1;\x84\n\x89\xa9\xd7v*\x95\xcf\x8d\xabh\x9e\xd9.-\x82A4\xa1>\xde\x80\xd5W\xbf(=\xaf\xa2c\x13\xaae\xdd\xe3c\xb6\x99\x02\x86\x96\x95\xbb\x915\xb1\xb6\xbdQ\xb5E\xa9\xa0k\xd9\xf5\x1a\xe2\xbb\x80a\xff\x8c\xe5\xaa\x9b\xa3\xb5\x15@-9F\x11\x99r\x85\x15x@\x96\xd5\xe6\n\x89\xbf\x15&L\xc7\x05\xd4\xc3&\x1aozcu\xecT\xa3(\x8e8c\xb3j\xca\x96/FR]U\x864\xcb-\xca\xd1\xaa>\x0e%ph+2\xcb\x99\xe9xNL\xd6\xb8;6:\xdcu\xfc\xdc\xff\xd0\x1f\\\xf75Q\x1c\xd5V|{9\xba\x19\xba\xff|\x1c\xb8\x17\xfa\xd8\xd9\xa0\x7fa\xbb>\x1e\x8c&\xbdIo\xd0\xb7\x0d~\xee\x17M\xbb\xeeM\xde_\x8c\xdc\xebl,\x1d\xb2v17\xa2\x16\x9b\xe13\x9d\xd6\x8c\x1f\x85a\xbep\xcd\x0f/\xce5\x91\x0b\x9f\xe3\xdb:r\xcd8\x0bK\x8b\xa4\x19X\xb2*\xb3\x1e\x88\xbcf\xfdS\xc3>\xa4\xf1S\x826\x8a\xeb\xd6Ny\x84\xc4a\xd4\xb4\xb4\xed\x1d\xd0-q\x107\xb4_j\xa83h\x1e\xd3\x1e_\xd5\xd0\xbedH\x9ff\xc5\x95\xbb\x1b[i\xd0\xcdT+\xb0\x11\x00\xcb\x82\xaa\xbc\xcb\xce\x02K\xbaQ\x16u\x9b\xaaX\xa1c3\\\x97\xc5M\xe3\xbc\x15\xf4v7\xda\x96\x85\xcd\x02\xb5\x158\x84\xb0R0\x8d\xe2i@\xbc\x0fpWe\xf2\x83\x1d\xb7\xe4\xd3\xf7\x1a\x91\xf8T\x1a\x9d\xb5\x96\xe5\xf4\xde\x89h\xb0D\xd1PU+\x8fQ\x9f\xd0y\x9b\xdd\xc2\xbf\x19\xa1\xe0\xb7\xf5\x84u\x18jQ\x85c\x8b\xad\x8e\xfei\xb8)\xab\x7fH/\x8f\xdc\xcc\x92g\x16\xefdK&\xabUH\xd3\xb6Z\xc0M\x1e\x91\x1eX\x8a\xeau\xd7\xd5`ryc)\xbe\xd4\xf5\xe1\xe8r\xe8\x8e.m\xd7\xcf\x07\x9f>\xf5&;#\xe7\xef\xdd\xfe\xbb\xe4\x86\xc1p0\xbe\x1cm4\xb0\xd6Q\xb9G\xe7\x15\xe3L\xb2iHL\x82\xf6Zu\xda\x02k\xf7\x17\xb6\xe8:\xc9\xff\xaa\xf3_\x00\x00\x00\xff\xffPK\x07\x08w\x1c\x99v\xc4\x06\x00\x00\xfcD\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-16x16.pngUT\x05\x00\x01\x80Cm8\x00\x99\x02f\xfd\x89PNG\x0d\n\x1a\n\x00\x00\x00\x0dIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x03\x00\x00\x00(-\x0fS\x00\x00\x015PLTEb\xb14a\xb14^\xab5[\xa55W\xa07U\x9d7R\x978Q\x968/^@.]@-ZA+WA3f>4f?9o=%NC$MC$OC&MB$KB#LB!IC$KB$LB$MB%MB$NC%NC\x1cAD\x1c?E\x1fCD\x1dCD\x1fDD EC\"IC\"IC#JB'SA$LC&PA\"GB\"HC)VA+Y?$MA%MB\x146F\x154D\x152G\x113D\x125F\x101B\x0c1I\x15+@\x00$I\x003M\x0033\x00\x00\x00\x00\x00\x00\x85\xea-\x84\xe9,\x83\xe8,\x82\xe6-\x81\xe5,\x7f\xe2.\x80\xe1.}\xdd.|\xdd.v\xd20t\xd00r\xca1q\xc91p\xc81o\xc62m\xc51m\xc41l\xc32k\xc02j\xbf2i\xbe3h\xbb3h\xba3g\xb83K\x8d9J\x8a:J\x89:D\x7f;C\x7f<@y=>w=9n>8m>8n?6j?5h?3e?\x1b=E\x1b>E\x1c?E\x1c=E\x1eCE\x1fDD FD`%\x11/\x00\x00\x00;tRNS\xf4\xf4\xf5\xf5\xf6\xf5\xf7\xf6\xee\xee\xef\xf0\xea\xea\xe7\xe1\xe1\xe0\xe0\xe3\xe3\xdf\xdc\xdb\xdb\xda\xd9\xd8\xd8\xdb\xcf\xbf\xbc\xba\xac\xab\xa9\xa9\xa1\x99\x96\x94\x8e\x89\x85\x84L1$\x1e\x1d\x1f\x15\x0c\x07\n\x05\x01\x00\x07\x07\xae\xc9\x00\x00\x00\xd8IDATx\xda=\xcf\xd9.CQ\x18\x86\xe1\xcfn\x8a\x8dRi\xa9\"\x86\xb61\xcfs\xd6\xbb[\xb3\x84\x12\x1bA\x8c5\x94;u\xe0\x86\xa4\x12\xc1Z\xcdN\x9f\xa3\xff\xff\xce^\x19k.\x97Iv\x0fL-\xb9[\xc6\xac\x0fw\x94KP:N\x8c\xae\xbaac0N\xa4ih\xcd\x0e\x85\x96\xe8\xdd\xdb$\x967\x9a\xf7\xe1\xf2\x01\xeb\xf1\x1e\xda\x16T\x08\xe1}\x0bk\xe7\x0d\xc2I\xf5\x04\xf0\x1a\xe0\xbc@\xd0\xa7\x14\\\xdd\xec\x9f\x1f\x9c\x1e\x9eT. \xed\xfdI\xbfq\xff\xcb\xaf\xf9\xb5\xef\x98\xf4\xa3l\x00OE\x9c\xe7\"A\xaf\xc6C\xa8\xeebmW\xe1lB\xcb\xadp[\xc1\xba\xbb\x86\xf6E\x991\x8f\x86\xe6\x9c\xf1\x94\xca\x7f(\xf2\x99IK6p\xba\xf3\xc8\xc5\x95\x13#\xf58ke6\x9b\xec\xea\x9f\xa9\xe7\xff\x03\xcdJ9\x84\xc0\xe4\xbb\xd1\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x08\\\xa1\xa9S\xa3\x02\x00\x00\x99\x02\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00 \x00favicon-32x32.pngUT\x05\x00\x01\x80Cm8\x00t\x02\x8b\xfd\x89PNG\x0d\n\x1a\n\x00\x00\x00\x0dIHDR\x00\x00\x00 \x00\x00\x00 \x08\x03\x00\x00\x00D\xa4\x8a\xc6\x00\x00\x00\x90PLTE\x00\x00\x00\x103D\x165F\x166F\x176F\x00.:\x165F\x188E\x177F\x1aZ\xa56~\xe0.C\x80;w\xd4/_\xae59o>n\xc52?x\x03\x06\xf6i\xbf&\xaeK\xd6\xfb\x93\x0d\xcfX9\x16\xb2\xb0\xfa|T!C\xd7Y-\xf5[\x0b\x93<\xf0%\x82\xa7\xc4\x83 \x1f\xe4\xfd\xe1\x00\xac.\xf8\xf6\xf4\x860g\x1c\x8e\xf7\xf1|\xbc&\xce\xf6\xd5\xf9\xff\x00\xc6\x8cF{\xbe\xb8\x05g\x00\x00\x00\x00IEND\xaeB`\x82\x01\x00\x00\xff\xffPK\x07\x08\xa0\xd3\x9fC~\x02\x00\x00t\x02\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00 \x00index.cssUT\x05\x00\x01\x80Cm8l\x8d\xc1\n\x830\x0c\x86\xef}\x8a\xc0n\xb2\xc2\xce\xf5i\x12M5\xac6\x10;\xa7\x8e\xbd\xfb\xa8\xee2\x18\xb9\x04\xfe\xef\xe3\x1b\xcb\x94\xe0\xe5\x00\x00HW?\xcb.y\x08@j=\x9b']\xdbc\xd3\x85-&}\x06\xf0\x93\xee~\xeeLS\"\xb4\xd9/lE:L\xbf\x9c\xdf\x02\x9cP\xeb\xde\xce5W\xd7\x04\xe2\xa8\xc6\xf5\xc3X\xd8\xfeT%\x8flR\x0e\x85\xb4\xdf\xbe\xc8\x846H\x0ep;\x1b\x84\xdd}0}\xe4>\xc0%b\xbdj|\x02\x00\x00\xff\xffPK\x07\x08\xa3k\xae\x90\x8a\x00\x00\x00\xca\x00\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\n\x00 \x00index.htmlUT\x05\x00\x01\x80Cm8\xa4\x92O\x8b\xdb0\x10\xc5\xef\xf9\x14\x13\xdde\x91\x04B\x0f\xb2/\xfdC\x0b--49\xf4([\x13{\xba\x8al\xa4q\xd6\xc9\xa7_ly aY\x02\x9b\x93\x87\xf7\xfc~\x03o\xa4\x97R\xc2\xf7\xdd\xaf\x9fph\x03D6L\x15X\x8a\x1c\xa8\xec\x99Z\x0fe\xef\xadC({r\x16\xa4,\x16z\xf9\xe5\xf7\xe7\xdd\xbf?_\xa1\xe1\xa3+\x16z\xfc\x803\xbe\xce\x05zQ,\x00t\x83\xc6\x8e\x03\x80>\"\x1b\xa8\x1a\x13\"r.\xf6\xbbo\xf2\x93\x98-&vX\xfc}6u\x8d\x01\xf6?\xb4JJr\x1d\xf9'\x08\xe8r\x11\xf9\xec06\x88,\x80\xcf\x1d\xe6\x82q`U\xc5(\xa0 x\xc8E\xa6b\xa2\xc8\x9e\xb2IW\x1f\xa0\x90\xb78\xbc\x17\xa7\xaa\xf5\xafA:\x9a\x1aU\xe7\xeb\xeb\xfe\x839\x8d\x7f\xc8\xcdz\xd8\xac\xb3\xc9\x8at\xc1\x98\x8bIy\x80\xb8\xda\x0e\xab\xed\x0dqRf\xa2V\xa9\xebq,[{\x9e\xb7X:\x01\xd9\\\\k\x11\x85V\x96N\xb3\x1f\xab@\x1dC\x0c\xd5my2\x9d;\xfb\x1f\xc5\x9b\xa3\x81V)v\x8f\x11\xd9xk\\\xebQv\x01#\xf2\x038\xf2\xc4d\x1c]0\xdc\xa7h\x95*\xd0*=\xcd\x97\x00\x00\x00\xff\xffPK\x07\x08\xceDRv:\x01\x00\x00\xde\x02\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00 \x00network.swagger.jsonUT\x05\x00\x01\x80Cm8\xec\x971o\xdb<\x10\x86w\xff\x8a\x03\xbfo\x0c\xe24-:dj:\xb4\x08\x8a\x16A<\x16A\xc1\x88'\x99\x89D\n\xbc\x93S\xa3\xf0\x7f/H\xcb2\xe9Xv\x12\xcbC\xd1f\x89$\xf2\x1e\x1e\x8f/_\xd2\xbfF\x00\x82\x1eeQ\xa0\x13\x17 \xceO\xcf\xc4\x89\xff\xa6Mn\xc5\x05\xf8v\x00\xc1\x9aK\xf4\xed\x06\xf9\xd1\xba\x87\xd3\xdaY\xb6\xa1'\x80\x98\xa1#m\x8doo\x1f\xc1X\x06B\x16#\x80E\xe0\xb1,H\\\xc0\xf7\x10\xb1\xa4\x02\x08#\xab\x80\xfd\xb6\xc4\x8a\xf0}1\x02\xb8\x0dA\x995\xd4T\xb8\x0e\x14\xb2\xaeK\x9dI\xd6\xd6\x8c\xef\xc9\x1a\xd1\xf5\xad\x9dUM\xf6\xcc\xbe\x92\xa7\xb4\x9e\xddx\xf6f\xdcNl\x9c\xcc\x1b@\x14\xc8\xd1+\x80\xb05\xba\xc0\xbcRQ\xe6?>#\xb7\x8fW\x9ep\xb2\x0epH\xb55\x84\x94p\x00\xc4\xf9\xd9\xd9\xc6'\x00\xa1\x902\xa7kn\xeby \xd4d\x19\x12\xe5M +\xd2i\x84\x0fA\x94M\xb1\x92O`\x00\xe2\x7f\x87\xb9\xe7\xfc7V\x98k\xa3=\x97\xc6\xb5\xcc\xb8\xa14\xe5\x9b\x16.\x12\xc4\"z[\xc4\xa3\n\x85\xb9lJ\xde?\x03\x03\x8d\xc1\x9f5f\x8c\n\xd09\xeb\x86\x9b\x88\xab\xb3 KnhG\xd6\xdds\x94\x7f*\xc7\xf6[\"B\xffw;\x8a\x11mx\xa2\x16c\x15\xbeV-V\xe1\x1f%\x956\xdf\x7f:\xd9\xa7\x93\xce\xf3\xa2\x0c\xd6f\xb3s\xefER\xe2y\x1d\xac\xd1\xde\xddc\xc6]\x01\xbc\xcf\xd5\xe8Xo\x88D\xb0eYN\xd0\xf0\xc79?\x15\xd0\x8a\xa6\x0d\xa3\xb7\xfad\x89r\xeb*\xc9m\xf3\xdbs\xb1\xbd\x12\x9e\x7f\x83\x19\xea\x19\xaa#\x8dA,\x1d\xa3\xba\xdcTK\x87&v\xda\x14;\xc8\xef\xdfm'\xd7\x88\xae7a\xe9\x9c\x9c\xa7P\xcdXm\xf6\xdf\xb3G\xae\x11]\xd8\xd0\xdbE\x95j\xe4dS\x0c\x9b\xbb\xeb\x00%T\xd6\xe8\x87p\x9c\xef\xaa\xe1\xd62\xc9\x02\xcd\xbe\xe2\xf7\xd67X\xdc+\x96\xedn\xce\x91\x9b\xec*TW\xe2\xbf\xb7:\x11\xd5\xdf\x8e\xd0PC_p>\x80\xb6\xfb&\xd2g\x8dy\xb9\xf4\xc6\x81=`\x8a\xba\x98\xf6Vy?\xb7\xcf\x01\\k]_\x91H\x16\xc7p/mf\xb2\xd4G\x1c\xc0\x1d\xdd}\xfd 98\xb7\x94\xc4\x93\xfd;\xe7\xe5K\xea\xc1\xab\x13ip8\xa1Q\x93\xe5\x85j\xf8\x92x\xf8'\xa9\xcb\xfe\xbc_\xc8\x1e\xc5\xff;\xd3\xf4?\xd2\xee\x9a\xfc\xd2\xcc\x0fq\xcc\x0fm\xc0\xf3lo\x95I\x87\x95J\x85sR\x96\xd7\xc9\x00i\xae\xeb\x1b\xda\x01\x99f\xe9u\x1c\x0e(h\xb4X\xd5rC?\xbb\x02Q\xa8B\x96\xba\x1c\xc0\x9c{.\x1e\xd1\x02G\xfd{o\x1d\xfef:Z\x8c~\x07\x00\x00\xff\xffPK\x07\x08\xea\xbep\x1d\xb0\x02\x00\x00\xf5\x0f\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00 \x00oauth2-redirect.htmlUT\x05\x00\x01\x80Cm8\xccV\xdfo\xfa6\x10\x7f\xe7\xaf\xb8\xfa\xa1 \"\x0b\xda\x1eSR\xf4U\xd7\x87N\xeb*};\xf6RU\x95\xb1\x8f\xc4k\xb0\x83\xed\x80\x18\xf0\xbfON\x02I \xd5\x98\xb4\x87\xf9\x01\x12\xfb\xee\xe3\xfb\xf1\xb9\xcbMn\xb8bv\x9b#\xa4v\x99\xdd\x0f&\xee\x0f2*\x93\x98\xa0\xfca\xf6J\xdc\x1eR~?\x00\x00\x98Xa3\xbc\x7f\xdd\xd0$A\x0d\xb3\xa7\x08^\xbe\x156\xfd \xbe#\x17\x1a\x99\x9d\x8c+\x91\xc1d\\\xa9M\xe6\x8ao\xef\x07\x13\xc3\xb4\xc8m\x05\xe3\x15\x06\xc1X-\x98\xf5\xee\xca\x9dE!\x99\x15J\x82.$\xf8C\xd8\x95\xbbn\xad\xa9\x06E\xcb;b\xd8\x08\xc9\xd5&T9J\xd4\xa1\xa9\xcc\x98=\x1d/\x7f)\xe5\xee:\xba\x06\xa5}\xb5\xd4\"\xc45Nh\xdckWJ\xd7\x083\x9d5r\xad\xcd\xae\xb40\x7f\xd0L\xf0\x00Vy\x00T\xeb\xbb\xc1\xe9X,\xc0\x1f3\xc5qo\xd5'\xca=j\xad\xf48\xb4h\xac_[\x9f)F\x9d\xafaJM:l\xfb\xea\xd6*o\xfc\xecH\x86\xa6\x98\xbb\x98\xc9\xc4\xffq\x18j\xcc3\xca\xd0\xf7\xa6^\x00\xde\xad7l,<\x00f\x06\xfb`Ox\x06\xa9f]\xc4\x96~\xe3\x0d\xd5\x1abX\xe5\xa1\xc93a}rKZrT\xebp\xa1\xf4#e\xa9\x7f\xca\x9f\xbf\x0eD\xf0A\xb5\x1e\xc2\x0e\xdc\xff\x9bx\x87\x18<\xe2\xc1\x08\xd6\x8d\xd9\xb13\x9bD\xc4\x1b\xc2\xc8\x9d\xde\x1dZ\xc8\xa5\xb1\xab\x1c\xa6\xf0\xcb\xeb\xcboaN\xb5A\xdf\xdb9\x08w\xe9\x9fJH\xbf\xd4;xA\xc7KhS\xc9\xff\xc4m\x00k\x9a\x15x\x1e\xe4\xe3\xd2h\x0b-\xe1\x13\xb7\x10\xc71\x10\x02\xd3J\x01\"\xe0\xe8\xd28\xfb\xfe\xf4\xa0\x96\xb9\x92(\xad_a\xdd]@\x1dN;C\x88`wh\xf3\xa1\xa2J\x1d\xc5\x8a\x87q\xdc\xb0\xf2\x8c:~\x0b\xbbf\xa1\xfb\x0d\x0dKqI\xc3\x04\xadO\x16\x99\xda\x90ae0e\x0c\x8dyP\x1c \xec\xf7\xffV\xb9\xb0\xa9\xd2\xe2\xaf\x92\x13\xff\x05\xc6\x87\x8b\x18i\x05\xe3\xf6\x16n\xda(\xee\xfc<\x17\xce\xed\x9b:L}y\xaa\xf5Q\xeb\x87\xb9\xdf\x9fF'\xf1\xc4\xa3\x8e\xc1\x92.\xf1\x92\x1cn\x19Uh\x86Qe;\xe9\x97\xc9p\x8dY\x04dC\xb5\x142\xf9Bj\x89\xc6\xd0\xc4A}k\x87\x01\x96t\x0bs\x84B\x1a\xba\xc0\x00rj\x0cr\xa8\xb2\xbf\xa1\x06XJe\x82\x1c\x84\x04\x83z\x8d:\x84\xdfS\xbc\x90\x93\x9e\xad\x19\x8a\x1c\x16Z-KG\x8f*\xe4\x92\x86g\xd4l\x152\xd4\x81^\xe5\xbd9p\x8bc\x86\x16\xbf\xe8\x91\xc7u\x9e\xcc\x8a\xd7\xee\xe9KYF\xb3lN\xd9\xa7\xbfs\xef\x9d$\x05\xed\xbe\x1b\xb5_.\\\xe9\xebiP&\xcaV\x88\x8f\xae\xd1>\x9b\xe4\xd2\x8e\xda\xef\xb2\x13\x7f\xd5\x08:\x10\x10\x03y#\xa3\xa3\xce\x88\xbcG@`\xd4\xab\xe8\xd6 \xfd\x83c\xf5\x99s$\x98B\xdf\xf6\x08H\x08\x04\" RAS\xbd\xa0\x91\xa1X\x1f\xf3lS<1\x83\x0c\xaf\xba\xba\xd0\x02\xa6@\x9e\x95F\x10r\xa1\"h<(\x0f# \xa4\xb7w\xfd\xbf*\xae4\xf8\x9f\xea\xad\x9b\xae\xfd\x1e\xc8[\xb7\x02\x17Td\xc8\xdf#\xb82\xca\xd7\x14\xd3\xe9\xa9\x8f\x8b\xd7\x90\xbd\x9c\x08\xa2rh\xa8\xfb]\xd4\x8c\x12\xd7TBcC= \xb0L\x19\xf4k\x89:\x93\x8e\xee\\\xb1b\x89\xd2\x86\x1a)\xdfV\xe3\xcfM\x1c\x83\x97)\xca\x85L\xbcv\x1d\xe8B\x9e \xce];\x01Q\xce\x1f\xd7(\xed\xaf\xc2X7|\xf9\xde\xcf/\xcf\x0fJZ\xb7\xa7(G\xee\x05\xadO\xefy\x9d\xb5\xee\x80Vp\x0f\x83\xc9\xf88\x18N\xc6\xf5\xa48\xaeF\xd1\xbf\x03\x00\x00\xff\xffPK\x07\x08v\xdf\xba\xbe\xa8\x03\x00\x00\x9b\n\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x16\x00 \x00swagger-initializer.jsUT\x05\x00\x01\x80Cm8|\x91?k\xdd@\x10\xc4{}\x8aA)l\xc3{R/\xfb\xb9\xb0\xd3\x04\\\x04\x8c\xab\x10\xc2\xe9n%m\xdefW\xdc\x1f\x84 \xfe\xee\xe1I\"1.R\xde\xcdof\x07fa\x0d\xb64\xa6b.\xe0\x84\xa1\xa8\xcflz}\x83\xdf\x15\xd0\xb6w\x148[<\x0e&\x01\x81\x92?\xd5\x8f\x93\xd3\x91\\/\x84G\xd3\x81\xc7\x12\xdd\xc5\x83\x071\x7f\xae\xef\xab\xd5\x88<\x11\x06\x13\xb1\x85u\x84\xb0R\xc2\xc2\"\xe8 \x91fq\x9e\x02\xfaW\x04\xf3g\x8a\xad\xff\x1be\xf1\x80e\"\x05g\xc4\xa2 \xacp;v\xf4\xa6\xd9\xb1R\xac\x80\xbd|a\x9c\xf0\xbc\xb8q\xa4\xf8\xf2\xe5\xa1h\x10\xba\xbe\xb4\x07J\x94\x0eu\x7f\xe9\xe5'\xc7\xda\xa4\x0dk~&\xd3\xfa\xb02\xc1~\xfd\xe0\xd0\xe1\xea\xd3.\x1e\x0b_\xed\x12\xd1\xfc\xc4zf\x1d;\xe4Xh\xfb\x9e#%\xca\xa9\xc3\xb7\xf5\x89\x8f\xc7\x9b\x1dh\xdc\xcc\xe9\xf0\x91y\xceN\x83\x13S\xfa\xbab\xab\xfe}O\x962\xb2\xfe/y\x03\x9a\xcf\xb6\xac\x93\xbdDy\xef\x17\xf7j%w\xa8\xff\x1dyZ\xbf\xea\nx\xbb\xb9\xdd\xa6\xb9k\xdf\x8dz_\xbd\xddV\x7f\x02\x00\x00\xff\xffPK\x07\x08\x97\xbf\xe0\xe8/\x01\x00\x00\x07\x02\x00\x00PK\x03\x04\x14\x00\x08\x00\x08\x00\x00\x00!(\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00 \x00swagger-ui-bundle.jsUT\x05\x00\x01\x80Cm8\xcc\xfd[\x93$\xc7\x95\x1f\x88\xbf\xff?Eu\x12S\xcc`EW\xe5\xa5\xf2\xdaL\x96\xf2RiC\xb3!\x00#\x00\xd1L]E\xc8#\xc23\xd2+#\xc2\xa3\xdd=2+\xbbO\xc9\x08\x80\x18b\xc8\xa1F#\x0d\x87\x1a\x92\xa3!\xa5\x1e\x00\xc4\x10 \xc0\xcb\x10\x17\x12|\xf8\xbf\xcb\x1ak&S\xb7\xf6\xa5\xb4@7\x88\x95\xf6;\xac\x9d\xe3\x91YYU\xd9\x00\xc8\xd1\xae\xedCy\x86\xdf\x8f\x1f?\xfe;\x97\x88\x8a\xd8\xf9\xdc\x95\x8d\xa1T\x1b\x91\xf0y\xa2\xf9\x86HFR\xc5\xcc\x08\x99l\xa4\x11g\x9aoh\xce7\xf4\x8c\x85!WW3q\xd5\xcb\x92 \xe2\xdbGz\xfbO\xbe\xd8\xdf\x7f\xf4\x89\xfdmsl6>\xb7\xf3\xff\xbb2\xca\x12\x1f;\x16\xb9k\x9c[\x05\xe9\x1dq\xdf\x14:\x1d3O\xb9\x1cm\xf0\xe3T*\xa377/\xd5\xc42\xc8\"\xbeg\x7f\xb6\xf3v\x1dSt\xda\x85\xc5\x98g\x8d\x03>\x12 \xdf\xdc\xb4\xbf\xdb,\x0e\xf6\xece\xf1\xfa\xa1k\x9c\xf6\xc3\xe6\xdd\xcb\x7f\xb7\x9f\xb0ky\xea\x8b=Z \xcd\xc3\xd7\x95\x9e\x14\xcdXh\xb7\xb8\\\x97sKq\x93\xa9\xa4Xt:_\xb85ej\x83wn\x95\x1b\xadz\xa3Mk\xee|\xe1V!C\x8e\x19%|S\xb8f\xb6\x1f\xedL\xa5\x086J\xd7\xb0\xb1\xea\xec|\xb5x\xfd\xab\x07\xb3\xc3\xcf9\xc5#6e\xdaW\"5\x100\xc3`\xea\xd9\x9c\xb3#b7\xe9\xecl~\xa6x0\xdbr\x8a_=\x98\xc15go'teg\xe7\xfaAV*\x95JW\xf1\xa7<\xc4\xb41\xa4Lkx\x90UlM\xa5T\x1a\x1cd\xc3\xfd\xe1\xf0p'\x14\xb1\xcb\xec\xac\xed\xc3-\xa7\xbd\x13\xc6\xae\xe8\\/l\x17\xdc\xc2N\xe1\x90\x08<\xdb5\x87\x96d\\\xdd)\x9a\x0e\x07(\x14\\\xb3\xadx\x1a1\x9f\x17\x93\x15>\xd0\xfeZVlF\xd8\xb4m\x01\xebq%S\xae\xcc\xbc\xc8\xddd{\xc2\xe7n\xe2\x9c\x9cQ\x19\xe6R\xb8\xdc\x9c\x0d\x91l\xf0\xbd\x87\x8d`\xdc[4q[\xb9g$\xb6\xaf\x94\xdcU\xfa0\xbf\xa0\xa7}\xa5t\xe2\xb4\xf9us\xd8Q.?\x9bwj\xb9c9\x93\xcf6\xe1s]\xe4t\xb6\xf2\x92\x90\x9b\xc7f\xc9b~\xbb\xc3z\xc1\xb7\x8fk\x83\xc3\x18dL'\xd9\x1e\x89\xc8pU<;\xf6g\xb0\xb2v\x88\x01\xb7\x18)\x15\xd1\xb8\xb2\x17\x887\xae\xdaN3=\xdefi\x1a\xcd\x8b\n\xb9\xb98\xf1g\xab\x9b\xa3D/v\xdet\xca\xd7\xcc\xe7\x99\n\xb3\x98'F/$\xc0,$@u\x92,\x8a\xaet\x96-\xae\x9b\xc3\xbd\xd5L\xfb\xd6\xc95\xf3G\x95\xbdiQ\xb9WJ\xce\xf6H\xaa}\xe6\x8f\xcf\xaf(\xdf\xc8\xeb\xe6\x10a\xb1\xfd +\xd3kwXp]\xe4\xee'u-*\xc7iO\x8b\xea!\x84<\\t>\x89\xdb\xca5\x0e\x12\xbf`\xe8\x8a\xb8x+\x10\xe1-v^s\xf3\xf8\xe2\xb4?6\xda;\x1b~\xa5t-\xc6l?\xfd4\xc1\xc4\xd3O\x03\xac\xed\x850\xe1z\xe7\xc0bvN\x1f\xcd\xd6\xd3\x00\xb0V{\xadL\xd81.?q\xed`g\x83\xef\xaf6\xbfb\x00\x16\xe6\xc5\x95\x05\x02\x9aU\\<+=\x87\xafbT\xb4v@\xa7\xd3\xe1+\x08\xf6e>\xe2\x8a'\xfe\x02\xc6\xd0\xde\xd8\x183\x9d|\xd6lx\x9c'\x1b\"\x11F\xb0Hh\x1el\\\xdd\xd0Y\xcaU\xd19\xd7\x02!\x8f\x07\x05\xe7\xdark\x8a\xdci\x9b\x13\x94\xdf\xe3\xce\xad\x933\xd5\xf1\xf4\x05@Y\xc3\x7f\x14\xf7N\x87\x86\xd8S\xeb6\xc8\x9e\x87\x0e_5\xe2:\x88\xddk\x95\x03\xc7\xcd{H\xcd\x98i\x9a\x86\xae\x8a\x06/Bn\x8a\xc6i\xab\xf6\x98\xe9\x159\xdc\xc6%\xd26\xec!Z\xb5WN\xf3\x13\x8b%-Nt\xd2)]K\xaet:K4w\xc4\xa8X\xe4\x1dZ\xfb\xf5dk\xeb\xd0=v\x9cN\xa7s\xbc\xb0\x10\xd4\xb5\xcb2\xdd]\xdaB\x9d\x8b\xe0\xf0\x85\xf2\xe6\xa6\xdd\xca+\x9d\x15\\(\xaf\xe2B\x19q\xc1U\x97\xfbV\xd6\xf6\xad\xac\xf6\xadP\xdf\xa43)\xe2\xba\\\x89v\xd8*\x08\xcf\x8b8\xb4{\xeb\x04O\xe4\x82t\xb9\xcd\xa7\\\xcd\x8b\xc9\x8a\xe0N\xce\xc9\xf9r+\x15 cA\x93\xd5v\xb6\x1f*gG\xb1\xe4\x8e\xb6\x85v\x8a\xa8\xfa\\~]\x1d\x12\xe8w\x95b\xf3m\xa1\xe9\x17Q\xe6B\xeb',\xb5\xb8\x1d\xcaq\xae\xadU\xd1_L\xa6,\x12\xc1\xc6\x84\xcf\xdbh\x93s\xdf\xf0`\x83F\xdc\x90j\xc3R\xd4\xde(l)\xe7\x84\xa4\xb7\x7f\xce4].\xcc,\xcd\xf0\x8d\xc0\x1a\xe8\xc6q\xf7\xed\x95W4N\x8e\xff\x94_\xf2\xd5qhH\xe5&\xae\xbcvI\xfes[c\xdd1\xde\xdc\xccE\xde\xac7<\x9e\xc0#\x89\xcbQ\\k2.2m6\xb80c\xae6z\x82\xda\xd9U\xdc\x8a\xb8\xb9\xa5S\xee?\xc1#\x8e\x9c\xd0ms\xd29\xdb\xe7\xc5\x993\xdb#\x91\x04\x83%\xf5\xa8\xc8\xc9\xacH\x02\xd4l4L\xc8\xcdr\x97\xda\xdc\xa5,\n\xb9n\x1b\xf7\xfc\x14\x89kim3W\xf1\x1b\x99P*\xe4\xee\xf1\xe6\xe6|s\xb3\xa8\xed\xdc\xab\"S\x9c;\x8e{\x85\xd9z\xb6\xac_n\x06z\xc6\xee\x15\xb6\xd0mi\x0e+\xfb\x11GI,\x16t\xca\x92\x82{\x8bd\x98\xb8P\x88q\xe8\x0dJ\xaf\x1aa\"^8q?m7\xdb\xe1\xe9\xa7\x0d?6\x85\x13\xd7\x07\xd0\xce\xe5\xce\"\x0e\x0b\xee-\xad\xfc\xb6*Vj\xe5\x86\xe3\x8e\xb9\x08\xc7\xa6]\xa8\x94\xd2\xe3\x82;\x13\x81\x19\xe7\x99\x13gq,\xbdN\xb2-\xf4c\xdd'\xaaEg\xc9\xa4\x80\xa7\x8a\xfb\xcc\x90\xbd\xa3g\x02=\xfe\xa8\xb3\xc4\xa3h/j_\xb92w\xa7+|E\x18@L\x99\xbaS\xe7\x96\xcf4_p\xbf\xfd\x10\x1e\x05\xae,:\xc5\xd5\xb5\xe6\x1dNVa\xeb\xd6\x8aT\x9d\x17\xd0\x85@\xe6RxFr\xdb[\x8a\xe4\xa7\x92\xc4\x8d\x93\x13\x04\xa5\xc7\xdd\x02\x0e\x8bZY\xa3\xa8\xd9\xfe~\xd1)~\xb1\xe88\xdb\xc8u\xdb\xc9=7\xed\x93Eg\x1b5\xde\xa5\x06\x96\x90u\xd5\xe7\xe1\x07[X\xe1XmCTc\x95\xb5h\xce\x81\xceJ\xb1\x95\x05,\xf0\xa4\x8c\xce\xd6\xb5,\xe1\xc7)C\xa8L\xcd\x98\n\x93,\xf6\xb8Bn\x9c/XJ\xe2\x17\x8b\xcev$\xf49b.\xee\xe1r\xf4K[\xb9\xa89qN\xdcZ\xbdR\xfdTA\xb0\xd1J\x10,\x0fx\x9d\x0b\x82U\x9a\x95J\xe5B\x10,\x0fnE\x1dUl\xee\xd6\xea\xbb\x14\x06\xdbN\x8a\x11\x05\xc1\x8a\xadRe\xb7b\xc3`\x95F\xad\xb4\xbb\xd0\xb8\xa3\xa5\xc6\xd5gJ\xfc\x9c\xee%3\xce\xaa_\xbc$\xb1[\xea\xab3\x95\xf3\x94\x8a\n\xae\x8d\xe0^VZ|\x9d\xd2J\xf8\xac\x98\x15\x1d\xa7\xc8\xb73\x15\x15\x11\xe3\xfe\xc5v$}\x8a\x92;\xdbF\xda\x18h\x11U\xd9\xb5\xa5\x06\xb3R\xa4N:\x9c\"3\"`F\xaa\xa7T\xd4NN:\xaa\x88F\xf2\xc2\x9c\xe9\xdc\xcaT\xd4^\x80\xf99J\x8b\x8e{\xae\xef\xd2\x8bL\xf6\nccR\xdd\xde\xd9Y6\xd8\xce\xa3\xf4\xdbB\x9e\x15\x16\xda\xc9\xc9\xc9S\x8f>\xd1\x1d\xee?\xbd\xd4\xf2_\x11Q\xf4e\xees1\xa58\x80F\x83\xef\x02\xe1\xe62\xe1\xea\xa4c\x96\x84sC\x96W\xf1\x0f\xa0]}z\xda\xd5\xc9:\xe3\xc0Rxn\xaf,\"\x13\xd5E4y\x8b%\xd7\xdf~4\xb6\x12`\xd9\xbc\xbdJ\xcd\xc2w\xbat\xb7\xc0ln\x92\xa1\xe3\xe4\x16\xef\x1eZ\xf0\xed\x95Q2\x15mn\xd2\xf0\xe3\xaf<|\xf8\xf5M2\x159{\xfa\x93\xd5\xeb(\x92\xcc\\U\xa8&\x0b'\xee\xa5\x0e\xac\xe0\xde2L\x85\xdc\xb4\x0bO\xdb\xe8\xb5\xabx\xd4.$R\xa6<\xe1j#\x91\x8a\x8f\xb8R\\\x15\xdc\xb1\xe2\xa3\xf6\xbf|\xe4\x96:\xd9 \xb8\x97\x85{\x99\x8a:\x8f\xdc\xe2\x89/\x03\xfe\xd4\x97\xbf\xb8o\xdeR+\x7fEH1\xfb\xa9\xce\xa2\x18\x15\xa9/\xfa\x9d\xe7z/(7+\x94\x9bOM\xb9\xf9\xd4\x94\x1b\xa2\x9ch89;\x80\x0b#\xfelw\xa9\xcfe\x89\xb66\x1f\xed9\xf9\xc9\x85\x13g\xf5\x08Y\xa2\x1e\xd6\x0d\xe5\xeb\xfc\xaaIzV\x8aXdN\x16\x12s\xe26\xeb\xa5r\xebS\xa9\xab\x98\xbb\x9a.B\xbe\xaa\xb8\xacB\x92\xa8\x90Z\xadJc\xe5n\x0b[\xc6\x06l\x04d\xe9Y.nJ9\xcb8\xe2\xe2.\x95q\xae\xad\xdcXp\x93\x0e_\xdeX\xf8|B7\x17ps\xaf\xab\xc3N\xa7c.\x06\xa1\xae\x96\xcf\x028\xe2\xe2]\x8a\xc5@W\xcb\xd7\xd4\x17:\xa5k\xea\xeaU\xe7\n\xe2\xa9\xa1\xf1\x9c\xcdM\xbe\xad\xd3H\xf8\xbc\xa8\xdc\xf2J(\x88D\xea,z\x91G.\x9eJ\xc6, \"\x1el\xa0\x99\xb91\x92j\xc3F\x016>[\xd8\xe2[\x85\xcf\x16l\xcc$:\x0b\xc3\xacDa8\xc5\x08\x961\xcd\xcd\xcd\"\xef\xdc:\xc9\x0f\xa3a!\xe2X\xa7P\xb0yf\x8c\xd2\x9d\x85 (\x92\x84\xab?~\xf2K\x7f\xb2\xac\x9f\x8d\x85\xe1:e>\xff2\x0f\xf9qg\xe7@o\xed\x9c\x1f\x8a/\xae\xecm\xc9\xb3Q\xb9\xfd\x05\xb8<<\xcf\xafM\x1c\x01\xf0\xb3\n\x1cb\x19\xc9^\xd9S\xcd\xcd\x93\xf9tkB\x9f\xe7\xc9\xa1\xb9\xf0\x84\x9fu\x0f\xd7t_\xdb\x9b\xe6w/\xcc\xdc5Fu\xd6\xc6\xa8\x17\xca\x15[\xe8\xa2s\x9d\x1fv\xcc\xfa\xe9/\x8c\xf11#\xac\x9d^\xaf\xeb\x9b\xc7\xa7\x98\xd6\"L\x8a\x17Frs\xf8]K\x89~\x18\x1b\xf2\x0d+\x9e\x93\x0d\xe7\x12I}\xd4\x05\x0f]NNs\xb1@*\xa3\xe0\xf2\x0b\x03\xb0 \xb8<\xc0\xf2\xc6\x8f\xab\x96\xce3\xb5*:n\xd2Y'\x8b\x08\x0b{\x8a\xce\x95)&N\xfb\xfa\xa1+:|\x99\xbff:b[\x8f\xc5\x08\x0d#\xe7j\xb9\xd3\xe9\xb0\xa2t\x8d\xb3\xb9)\xe9n\x14\xe2\xc1\xfa]\xd8&\xc2;r\xfbH\x8a\xa4X\xd8(\xacc\xa5\xe2\xb1\x9c\xf2\xff7\x16\"st\xd9\xdc,\xae\xac\xc9\xb9f#\x81:_\xd65\x8a2i\\]\x0e5\x1a\xa1\xe6\x9f\xb0\xc2\xf0\xd2F?Ll\xedp\x97\x0f\xcf\x98\xe9\x87\x89\nQ\x8b3o]`\xd2\x16R\xb3\xc4ll\xc0\xa9\xe8\x92\x10~q\x89&\x0f\x13\xc4\x15\xbcY\xb3\xbc\xe5\x10&\x8e>N\x96\x97\xf3\x14/\nr\xb8\x96\x88\x87\xd0p\x99;\xe1Z\x02.\xf1\xf8l\xfe\x0b\xd3\x1b\xd9M\xfc\xb1T\xd6\xc7Y\x1d\xc1>\xff\xb2\x18 \x87\xbe\xa2\xe3\x1a[\xe6e\"\nh\xeb\x9e0\xe8\xef\xd8 \xaf\x17>_p9\xb6\xd9\xa3mi\x17\nn\xe1\x0b9\xa2\xaf\xd2Zt\xdc\xc2\xe7w\xb0m\xe1\x0b\x85\xc3\\\x84.n\xd0\xb99Vi\x13\xa3\xe2\x953xY\xfb\x8aH\x029\xeb\\)\xe7zPe\x89O&n\xae\xe6\x96\xde\xc2R\x8b\x9eu\xe2g\xd7\xf4\x90\xc2\xf9\x11\xf8\xf2\xf2Li\x9e\x8d\xc6\xcf\xae\x1f\xa6'\x89\xeb\xeb\x84\x19\xad\x8b\xa8x+Wsm\xf4S\x88\xff\xd6v\xb3\xc6\x9e\xe59w\xdc\xa5n^Zv>\xd7\xda\n\xdb\x93\xfc\xd8\x14\xad\"9\xcb;\xceE%\xb12\xe2\xe5\xc7\x98:\xb7\xc8\xf1Y\x19\xe5\x8f\x15\x1f\xa1x\xe7\x90i{\xf7\xb5E\x8f\"_n\xa3B\x0c\xcc\xc1K]\xdc\x11\xaa\xb3\xceWg\xe9|\x99m\xc5\xa3\xceZ\xf7\xcb9\xcf\xfd\xcd\xcds\xd9%\xe8\xae+\xfd\xfc%\x0e\xac`\xf46\x05_;\x97\x96\xe7\xb8f\x1d\x93\x16\xcb\\\xc3\xa7\xf3\x02pM\xa0\x0d\xbbbv^7\x87d\xc5\"x\xe6\x83<\x91\x8dF\xe2\x98\xe3\xd1\x91\x9d\x92\xcb:\xc9\xc2\xc6\x95\x9fg\xd7\xe4\xd6\x96\xa3r\xe5\xb7U\xb8Z\xd8J\xae\xcb\xc33\xe6\xae\x9c\x91\xc5\xb1\x90>:\x0e\xf4\xfc\xa85\x00 \xf0x@\xf6\xcc\xc2b\x97\xa3\x91\xe6\xa6SZ\x86\xbazhYse\xa3]y\xe6rw\xbe\x9a;7\x12\xcf/\xd6Y\xed!7_Z\x19\xe4!\xae\xe0\xca\xc8\x97\x1c\xd9\xc7\xec$\xab\x1a\xf5\xdc\xe4\x97\x1c\xcf\x8b\x1d\xceO\x95\x93z)\x1ap\xc1\xc8\xbc\xdc\xfd\xfa\xd2\xe7\x9c\xa7\xbc\xe8\x1c\xae\xf1 \x9fd\xe1\xc7\x04\xe1r\xce\xda\xa6\x14\x86Zlr\xba>\x04\x97>\xec\xa1\xd2[\xcb\xc7G\xdb\xd7\x0fOV\x1eT\xa7x\xf1\xe6\xe6\xf9\xd1\xce=mzr\xf1\x91\xd4s\x0e\xa8q\xcc:\x07\xd4F\x8e\xcduu\xe8\x9c\xb8\xa9}\xca\xeb,\\=\xca\x07Z\xe4U1\xdf\xa1\xd5g\xf3\xf9\x89\xed\xb7\xca\xb4\x8e=0\x1d\xb3w\xe1q4\xa7\xbd\xfa\x87}\x08\x11\x00/\xce\xfc\x1c\x1e3\x11\xe1Y_\\\x1a\xfb\xeb\xaa\xc5\xf1\x1c\xd9\x07\xf4\xcc\x85 2r\xfa\x12C\x0b\xd4\xb7pr\xb1\xf5>\x0d\xfd\x10Y\xa7>\x97\xba\x9c\xb9\x8bk\xa6\xc1\x1eF\xb6\xf3\x88\xd9\xc7\x0d\xf0q0\xb2\xe8wR\xf4\x1d7\xfc'2Rs5\x15>_\x04;\x14n\xf4\xd8\xb0\xd0fVk\xcdjn\xa5\xa1Y\\\xfd\x81\xbc\xcf{_\xe6\xfe\x13+\x93?\x84\x15+\x14]\xea\xfe\xc79}\x0f\xe9\x9aO\xfb)7p%\xb6\xb5\xca\x85\xdc\xd9\xcd\xc7Z<6\xc5\xf3\xa7\xa1\xccL\x18\xc3\xd5\xe2\xf9\xa2\xe5\x8d\xf9\xbc|\xdb\x97\xf1N\xdeu\xa7\xb0e\xec#I#\xe6sO\xca\xc9\xa5^\xb3\xd9l{Q\xb9\xbe+Ad\xa8X|\xa9\xef\xb2\x86:\xf2\xe34\x92\x8a\xef\x18\x16j\xea\xbdx\xcah\xcd}\xacI\"g\xc9F\xbe\xe6\x8d\x84\xc5|\xc3\xc8\x8dT\x8a\xc4l\xe4\x04l\x18\xd9\xde(lq\xe7\xe4\xf7\x12f\xb4Z/\xec\x04I\xf4\xf4\x7f\xa5D/\xb6\xc0U\xdb\x08@B&V\xb0\x17\x19\xb3\xb8\xfaxa\xff\x83\x04;\x1f\xf9\xb2`\x7f)\x9f\xfcaf\x82\xad\xfe_}\x1e\xd6\x0bv.\xb2\x17{\xff\x1e\x12\x9c\xefbN\xf5\xef'\x89\xeb\xfaj\x99%\x81\x1f\xc9,\xb8\xd4\xf9\xacj]\xef?P\x8a\xf3\xee\xb9\x14_b\xc4\xef)\xd4\xff\xec\x1ag\x8fQ\x1ae\xfa \x11&\x9d+ewYc\x16O\xcf\xad\xd4\x9b\xe5\xe5\x1fx\x98\xd2\xb1L\xf8\xe5\xa3\xf48\x16?j\xe7}\xc8\x99\xb0\xc4\\\xea\xf9\xf1\x9d\xce\x0f]t>\xe5i\xca\x895\xae\xf8H\x1cw\xec#\xa3\xf6\xbf#g\xb3\xf6\x95\xd2\xc9\xa2\xc1\x93\x8a\x89H$\xe1\x13\x11\xd3\xe3\xce\x95\x92\xab\xb6\x03\xee\xcb\x80?\xce\x95\xcf\x13\xb3\x9f\xf82\x10Ih\xab\xec0v\xd0\xfcI\x86\xaf\x16 \x18\xf6(\xb2\xe8\xec\xed\x08Wm\xcff\xb3\x8fkS\xa4XT\xde\xf6\xe2\n\x16](P\xb9R\xff\xb8\xe2)O\x02\x1e\xd8\xd5\x9dc\x939\x97\xb5\xb5\xb6p\x1d\xe3\xcc\xa5\xa2\x872\xd2\xac/\xbf\xc0]\xb3\x9a[\xcfX\xb3\xa6\xf0\xa1\xac6\xeb\xcb\xff\xc0C\x9b\xa95F\xf5S\xab\xec{\x88\x94\xaf\xf2t\xdd\x00\x0f1\xcd2\x15\x9d{ `-\x07\xad\xf8_\xda\x88\x0b\xc5\xcb=\x07(\x9e\x8d\xde!U\xd4\xde\xd9)lqw}{\xfaW\xe4O\xab}/@\x0e=\xd8y\x168\xdddqzm't\x0b\x9b\x85\x87\x01\xd0E\xa8\x98\x9e\xbb\x07\xbb\x12\x93(:\x9f\xcc\x19\xbaOj\x15\xa0\x15\xaa\xf3m\xac\x90\x15\xb9\xb3|,p)y\xcb`\xe0\xb9\x01\x9eX9\xb2\xeb\xbb\xcdf\xb3\x0b}\xbe\xb28\xbf\x17:\x9c\x13\xdf\xb3>\xf6\x19\x8es\x95g\x1d\xd7\x8a\xf2\xc5\xbe\x17\xaa\xa9\xf7\x85\xed\xbb\xb4\x98s\x80\x9b\xb3\xf5\xec\xdf~,\xd1\x17\xe1\xca-\\\xdc\xc4\xf3\xeb\xfd\x14c\x9e\xc76\xb7\xf0Hy\xed\x90\xeb\xf7\xedS\x8c\xbf\x16\x0f/\xd3\xbd\x86\xe7k\x06/\xec\x14:\x1d\xd4\xa5\xfbT\xd4-SZ\xa5\xcc\xb0Fi\x033\xbb\xcd2\xa54d\xad\x82\x83\xd5\xaae\xca\xd4\xea\x94\xb60\xad\xdb\xa2&\xce_\x1b\x10a\xb5}\x9c\xa66\xb4\x99a\xe5 +\xd5+\x94\xa9\xefbM\xbd\xbeO)\x0eYoP\xff\xfa\xa0J)\xce_\xdf\xb7i\x9dRj\xbaOM\x87DJ}\xd8\xa7\x14\x8b\x1a\xe5\x12\xa5\x15\xach\x10\x8d\x8d\xdd\x01e\xba8H\xa3\x87kh\xf4\xa9c\x83\xc8j\x0cw)\xa5\xea!\x964\xed\x0bj\x9a\xe5\x1a\xa5TT\xd9\xa5\xb4\x89\xe9\xae\xad\xaeQ\xa6k3=\xaa\xef\xd5m\x06\xd9\xdd*\xedb\xa6UmQJE\xb5\x12\xa5\xc4\xfbV\x1dIi\xd9\xe5\xb6\x9aT\xd3\xac\xd9L\x9fR\xa4\xbe\xd5\xa2\x8a\x16mG\xab\xdb\xa4\x94\xa8o\xf5\xa8\xa6W\xa1\xb4n\x8bh.;}\x1f\x19\xd5\x1a\xd0P\x03*\x19\xd0\xabvZ\xfb4\xef\x90z\x0f\xf1\xba[\xa2i\xbb\xa5.\xa58m\x97\xf8\xd8-\xd3\xb4]Zv\xb7B\xd3v\xabTS\xadPZ\xa5\xb4Fi\x9dRjJk\xee\xd6Z\xd4\xa1\xd6\xa7\x14\xc9\xe96hc\xba$\xa8]\xbb\xdans@)\x11\xd7m\x11Av\xb9]Zn\xd7.\xb7K\xcb\xed\xd2r\xbb=\x9a\xb7g\xfb\xd3\xa2\xbb\xb4\xe8\xee\x80\x1a\xed\xdb\x94\x86\x1abm\xcf\xae\xb0W\xeaS\x8a+\xec\xd1\n{v\x85=Za\xcf\xae\xb0G+\xec\xd1\n{\xb4\xc2^\xd5v\xa7e\xf5h+{\xb4\xaa^\xcd^\x13\xed=\xda\xd0^\x83\xd2&\xf5\xb3+\xec\xd1)\xeb\xd9\xf3\xd5\xa3\x0d\xed\xb5*6S\xa3\x94\xc6mQ\xab\x16\x8d\xdb\xda\xa7\x94\x08\xed\xd2P\xdd]JItz]j\xda\xb5\x03\xd2\xfa{\xb4\xf2\xbe]g\x9f\xd6\xd9/Q}\x9f\x16\xda\xb7G\xa2O\x0b\xed\xdb\x85\xf6i=}ZO\xdf\ne\xbf\x86#\xf7\xeb\xd4\x85\xd6\xd3'\xc9\xec\xdb\x95\xf4I2\xfbv%}ZI\xdf\xae\xa4O{\xd5\xb7{\xd5\xa7\xfd\xe9\xdb\xfd\xe9\x13}}\xda\x9f\xfe\x00\xd7\xd5\xa7\xfd\xe9\xd3\xfe\xf4\x876Ef\x0f,\xf5\x03\xa2~`\xa9\x1f\x10\xf5\x03K\xfd\xa0\xda\xa5\x14\x87\x1a\xec\xe2P\x83\x1a\x1d\xb2\x01\x01\xd0\xc0\xee\xc3\x80\xe8\x1eX\xe8\x1b\x10\xe8\x0d,\xf9\x83\x165k\xd9\x1a\x82\x82A\xafj3=Ji\xe4>\x1d\xe9A\x1f\x1b\xef\x97\xe8|\xee\x93L\xec\x93L\xec\x93L\xec[\x14\xd8\xdf\xa5V\x04\x8d\xfbM\xaan\xeeR\xda\xa0\xb4Ii\x97R\x1c|\xbfE\x04\xef\xb7\xa8\xba\xd5\xb2\x19\xa4q\xbfkg\xa2\xed\xde'\xb4\xda\xefR+\xda\xed\xfdn\x8fR\x02\xb3}:\x0c\xfbt\x18\xf6\x89\xd9\xfbD\xfa\xbe%}\xbfO$\xd8\x05\x0c\xfaT4\xc09\x86%\xec7\xb4\xa4\x0fw\x1b\x94\x12\x0d\xc3:2}h\xd5\xc2\x10\xb7\xb9l\xdf\xc6U.U\xba\x98V\x87\x98\xd6lQ\xadFi\xd7f\x06\x98\"\xd3\xcb\xa5:U\xd4\xeb\x94\xeeSu\xa3Di\x8d2Mj\xd5\xdc\xc7\xb4k\xc7\xeaS\x97~\x83R\x1aj`+\x864\xef\x10\xc9/Wv\x9b\x94vm\x06\x9bU,-\x15\xdc\xfar\xa5F\xf5\x96\xa2\nQT\xa9\xdb\xfa&\xd54mM\x93jZ\xb6\x06\x99X\xae\xf4*6S\xa3\xb4i3H`\xa5O\xf5}[OdV\xfa\xb6~@s\x0e(SE -WIB\xcbU\xd4\x19\xe5j\xd9\xd6\xe0a*W\x9b4[\x15\xe1\xbc\\\xb5\x8b&\xbdZ\xae\x0em\xb3!\x12\xb5K\x82V\xae\xe3>\x94\xeb\xf5!ePx\xcb\xf5\xa6\xadA|(\xd7\xed\x00\xf5}\xca\x0cm\xcd\x10\x97\xd8\xb0\xdb\xd5\xc0\xd3Sn\xd0\xe9)7\xca\xc8\xefF\xc5\xd6T)\xb3k35\xcaX\x1e5h\xd2\x86\xdd\xb0\x06mX\xc3R\xdd@\xe1*7\x06\x0dJ\xb1U\xd3\x0e\xd6D\xfb\xa2\xdc\xb4\xad\x9a(\xf2\xe5f\xb3A\x19D\x82r\x13\x85\xb6\xdc\xec\xd9zZn\xcb\x12\xd8*#s[v\xf7Zu\\{\xaba3\xa8\x16\xca-;f\x0b\xe5\xbd\xdc\xb2\x03\xb4\xfa\xad\x83\xac\xdc\xb5\x03t\xcb\xc8\xfd\xae\xa5\xa3[\xc3>]<(e\x8b\xf2e\xc2\xecro\xd7fvq\x98^\xb3J\x99n\x89\xd2}J\x91\xb7\xbd\x1e\xc9E\x0f-\x8cr\xdf\x8e\xdf\xaf`\xff>\x99\x0d\xe5\xfe.6\xeb[\xc1\xea\xa3\x1dU\xee[\x02\xfb$X\xfd\xfd\x16e\xd0\x1a+\xf7\xf7\x89\x83\x84i\xe5>-\xba?Db\x07v\xe4A\x0f\x07\xdb\xb7\x99!\x89\xca\xd0\x8a\xca\xb0\x8c#\x0f\xed\x9a\x86\xbbT\xb3kkH\xd8\x87\x96]\xc3Z\x83\xd2\x16\xa5=Jm5\xc9\xcb\x90\xe8\x1bZ\xfa\x86h\x92\x94\x87d\x19\x94\x87\xbd>\xa5\xb8\xf2\xa1\x95\xe8a\x9f\xea\xfb\xb6\xbeO\xf5\xf6\xe4\x0d\xd1\xf6*\x0f\x07\xb6f@\xd3\xec\xdb\x1aZ\xe6ph\x07\x18\xd2\x00C\xdb\x0c\x8d\xb0J \x95_\xa5\xd4\xa0\x97\xf9\xd1)\xab\x94P\xa1U\xca\xa5\n\xa5\x0dJ\x91\x99\x95r\xb9Ji\x8d\xd2\x96-\x1a`\x8a\xb6V\xa5\\\xa9S\xda\xa4\xd4\xf6\xa8\xd8\xea!ePyU\xca\xd5\xbe\xcd\xe0\x8ce\xda\xf2Jy\x97jP?T\xcaM\x9a\x04\xe5\xb3b\xb7\xb7\xd2\xaf`E\xbfj35\xca\xd4mf\x9f\x9a\xed\xf7l\x86jP1U\xfaC\x1c\xc5nbeP\xa9Q\xda\xa0\x14)\x1a\xd8\xb1\x06u*B+\xb62h\xda\"T8\x95A\xd7f\xba6\xd3\xb4\x19\x1c~\xd0\xb35=\xaa\xe9\xd9\x9a\x1e\xd5\xf4mM\x9fj\xfa\xb6\xa6O5\x03[3\xa0\x9a\x81\xadA\xbdZ\xd9G{\xb7Z*\xd5(\xadcJ\xf6y\xb5T\xa5\xa2j\x8f\xd2>\xa6\xbb\xb6\xa2E\xadZ\x03\x9b\xa1\xee][\x83\xe8[\xb5\xe8[-\xa1m]-\xd3\xf1\xaa\xd2.T\xcbv\xe42By\xb5L\x0b\xac\x96{\xd8\xa7<\xb4\x19\xea\xb3K<\xdb\x1d \xba\xeeZ\xc1o\x0d\xd1\xa8\xefZ\xed\xd2\xddEU\xd3\xdd\x1d\xd8\x0c\"a\xb7fk\xea\x08d\xddz\xd9f\xcaCLQ\x15u\xeb\x95\x1e\xa6\xbb\xb6\x02]\x87n\x9d\xde\"\xd9\xad\xb7\xb0\xbf\x85\xc8.y\x0d\xddF\x19A\xa9\xdb\xa0\xfe\x8dJ\x852xr\xbb\x8df\x8f2\xb8\x11\xdd\x06mD\xb7\xd1k`J\xfeN\xb7Y*SZ\xb5\x99\x1a\xa5yM\x97\xd2>e*\x15L-9\xcdF\x15\xd3&\xcd\xd3\xecQfh3\xc3\x06\xa5=J\x91\xce\x16\x9d\x83n\x0b\xe5\xa9\xdb\"\x19\xea\xb6\xd0\x9c\xe8\xb6\xea6\xd3@\x0e\xb4\x9a\xbb\x94Ae\xdfm\xf5q\x1d\xad}[\x8f\xf2\xdam\xed\xd7m\x86j\x86v\xcc!.\xca\xe2e\x97\xcc\xf7n\xd7\x12\xd8\xdd\xadP\xbak3HM\xd7\xce\xd6E\xbf\xb1\xdbmt)\xdd\xa7\"\xc4\xc8n\x17\x0d\xa5n\x17\xb7\xb0\xdb\xedQ\xa3^\x8b\xaa\xd1\xe6\xe8vQMv\xbb}\x1aw@<\xed\x0e\xa8\xc2R\xd9\xdd\xa7\x11-\x17\xba\x88\x19\xdd\x1e\xe9\xban\x0fe\xb4\xdb+\xb5l\x06I\xee\x95mM\x99j\x08\x0e\xbb\xbd\x8a\xcd4m\x86\x9aYn\xf5P\xc1v{5\xda\x87\x1e\xda\x1e\xdd^\xc3\xd6\xec#9\xf6\xc4\x0f\x1ahR\x0d\xec\x16\x0f\x1ax\xa2\x06\x8d~\x8f2\xb8\x1dC\xab\x98\x86]\xd4E\xc3n\xc3f\x06\xad\x83l\xd8\xb35D\xe8\xd0\xfa\n\xc3^\xb9A\xe9\x80\xd2!\x15!\x87\x87\xd6}\x18\xf6\xaa\xd4\xb8\xda\xb4\x99>\xa5\xfb\x98\xee\x96(-SZ\xa5t\x97\xd2:5\xedQ\xc5\x80&!\x1bw8 \xd4\x1f\x0e\xd0t\x18\x0e\xc8\xd0\x1e\x0e\xd0R\x1a\x0e\x86\xb6\x86\xe8\xdf\xb7$\xef\xa3\xfa\x1c\xee7h\xb4}\xc4\xe3\xe1\xb0\x82\xec\x1c\x0e\xd1n\x1e\x0ewm\xa6F\x99:5#\x8d0\xb4\x1aa8\xa4\xa1\x87\xe4\x1c\x0f\x87(i\xc3\xe1\xc0\xd6\x0c\xa8f`k\x06\xfd\x9dm-3\xe5s\xf7\xb1N\x7fk\xe7 \xabX\xe3\xa3\xd2\xf0F\x07Y\x10p\x1c;\x08F\x98\xb1\xcet\xe0Q\xc6\xb7\x99\x11fF\xbc\xc4)\x1d\x1dd\xa5\xaau\xb9\xabu\xaa\xa0}\x1fq\xd4\xc3\x95R@#\x97F%\x1c\xac\xeaSwo9J\xa5T\n\x0e\xb2j\x05]\xa8j\x05\xad\xeaj\xa9\x1aPZ:\xc8*\xbb~e\xd9- 6\x05\x01\xea\xa8 hp\x9b!\x82\x9b\x1c\xd3V\x99\x8aZ\xec\xe2\x1a8\xc9k\xc0Q\x89\x05\xbc\x8c\xf5\xbcB\x15\xd5\nUT\xa9\x88v+\xe05\xd2\x818e\xa5D\xaa\xa8\xc6\xd8U\xfa\xf10\xf5\x10\xb7k>RW\xa3\x85Tj#~\x90\x95J\xacE)'\x1dWY\xa8\xb8\xc0/\xa1V\xaa[\x06S\x94\xa3\xe2!\x18U<\x94\xca\x8aG:\xd5+{\x94\xe2\xa4^\xadD)\xb6\xa9\"\xb1\x95*\xd5VI\x97V}\xe4Z\x95\x93\xc2\xad\x8e\xaa\x946m\x06W\xe1S}\x0b5F\xa5U%Ml\x15yy4Zl;n\xf9\xd9\x96\x0d)*Dn\xd4n\x93B@-\x1b\x02\"\x97\xa4\xd6\xa3@\x11E\xb3j\x08\x12\xa5\x1ay'54\xa8K5\x14\xb9\x92\x05\xf9R\x9dB-\xf5\xdd\x1eej6\x1aT\xa20\x10\x857\xea\x14\xcc\xa8\xdb0F\x9d\xa2`\xf5}\xea\xbf\xdf\xa4\xd4\x86\x83\xf6\x07\x14\x02\xa2@\x0f\xe1D\xa9AQ\xa6F\x97Fi\x90\xef\xd4 -_j\xa0f/5\xcb6nSnQJ5\xcd\n\xd5Tj6\xd3\xa0\xb4e3\x03\n\xff\xd8\x0cZa\xa5\xe6\x80\xbc\xba&\xb9\xb4\xcd}\x1b\xac)U)\xf0c\x835U\x8a\xc3T\xc9\xa7m\xedRd\xa7f#?h\xd2\x95Zu\n\xe3\xd4\xa9K3\x0f Q\xa6G\x1d{\xb6#q\xaeEd\x9f|\xc8>\x050\xfaC\\\xa7u|\xca\x03\xf2\x9e\x07\xc3\x9e\xcd\x90Ci\x1d\x9f\xd2\xb0D\xee\x19y\x81\xe4jW(\xc8W\x19\x90\xbdY\xa1\xc6\xd5\x12\x19c\xd5\x92u\x89\xc8:(\xb5\xc8{\xa8[W\x017\xa3[o\xec\xda\x0c\xf9\x0d-r%Z\xe4i\xe0$\xdd\xfa\xd0z\x00d\xe0\x93\xb1\xda,\x91\xfd^\xb1>A\x85L\xfaf\x89RjJ\xdb\xdam\xf6\xc9Y\xb0\xf6o\x93\x06iU\xac\x95^!\xcb\x9f\x8eQ\xb7\x85b\xd1\xb5\xf1\x8e.\xc1}\xb7E\xe1\xc8n\x8bl\xea\x16y0\xdd\x8a5\xb6\xabdy\xa3\xdd\xd8\xed\xee\xf6)%+\xbbaMnZ\x02\x05\xc9\xbb\xdd\x9e\xb5\xb5{\xbb\x946(%\x1f\xa0GnA\x8f\xac\xfa>Y\xf5\xfb\xb679\x0f\xdd!\xcd7$s\x9b\x94X\xb7G\xc6{\x0f\xdd\xfeno\xdf\x9a\xbch1ZWn\xb8_B#q\xbfb3\x95\xe1\xd2.<\xea\xec\x94\xae\xb6\xe8\xa6\x8eU\xedu\xca\xd8;@u\x8a\xc97l\xac\xb2A\xaa\xa2U\xb770\xc8\x98\xb0\x1eM\x89<\x9aR\xd7\xd6t\xa9\xa6kk\x88\xdcR\xcf\xd6\xf4\xa8\xc6Jb\xa9G5}[\xd3\xa7\x9a\xbe\xad\xe9S\xcd\xc0\xd6\x90\x93^\x1a\xd8\x9a\x01\xd5\xec\x93\xf5V\xda\xa7\x9bX\xfb\xf6\xbe\xd5\xfe\x80\xd0\xc9\xde\xaa\x1aV\x08Kl\xf8\x8c\x0c\xbb\xb2\x0dq\x94I\xbc\xca\x0d\x1b\"i\xecc\xa6I\x16M\x99,\x8ar\x8b \xbbLj\xbf\xdc\xb2\x07\xa35\xa0\x88\x96=Y\xdd&e\xech]\x1a\xadg\x03>=\x02\xb0\x9e=\xb4\x14\xe9/\xf7-\x05}\xa2\xa0o\x9b\xf5\xb1Y\xd7\xdeS\xeb\xd6\x91\xd0n\xd3\xba\xd4M\x9c\xa7k=\x9cn\xabD\x19[\xd3\xb25C\x9b\xc1-\xe9vi\xb4n\x97F\xeb\xd9\x9a\x1e\xd6\x0c\x87\xb4\x9e\xe1\xb0\xdcZn\xf1\x17;\x8fm\x1d\xb9\x8fR\xfad\xa7P\xdck_/l\x1dm\x15\x0eo\x95\xdd\xea\xc9\xc1\xc1\xb6s\xabz\xb2ZTp\x1f\xef\x14\xae\x17\xb6\x1e\xdd*\x1c\xda\xd6\x8fn\x15\x0e\x0e\xae\x1e\xde*\xb9\xf5\xf2I^\xe3\xec\x15\xdc/\xaf\xbb\xd5]\xdc\xeb\x14\x0b[\x8fo\x15\x1c\xe7\xe0\xa0\xb0\xc5O\xdc/\xado\xd6.l}\xb9\xc8\x9d-\xbc<8\xd8\xa6\xdcV\xd9\xd9*8\xb7Jn\xb9R?\x81\xc2\xd6\x93[\x05\xa7p\xe2\x0e:E\xfb\x16\xebp\xff8-\xe6\xc4m#M\x9f;#\xaf\xe0\xb8\x97\x1b\x1d\x16\x1c\xc7\xfd\x93\xceNq\xaf}\x9c\\\xbd:\xe5*\x0ey\xa2=\xae\x98\xc9\x92\xf0j:\xf3\xe0R\x05WW}c\xcb\xfd\xc8\x1f\xfb%\xceJ^%\xac\xb0V\xe8\x07T<\xdbU\xcd\x1a\x8f\x9a\xa3qV\x0b\x12\xc5 \x91\xca\x8cg\\\x1b\xae\x9283\x19\x8b\xc0(6\xe5\x11WZ$:S,\xf19\xe0,\xff\xff\x7f\\%\x80F\xab\xca\x1b\xe5\xe64j\xa6I\xb5\xce\xa8\xa4\xa6\xb3\xea\xeeQ\xabZ\xf7Bm\xdbx\xfe\xa4\xec\xb5X-P|\xd7\xa7\x928\xf4\x98h\xb1\x9b\xe1\x8d\xb4~\xb4(\xe1*\xdde\xb5`\x97)*9\x9e\xf8\x95 \xaa\xb2\x1a\xe7\xa5\xf1\xc5\xe9\xb9m3\xba9\xd7\xcd\xa0\xde\xca\xa6a\xbc\x1c\xb8\xe1\x97)\xb1\xe5(,\xaa\x8e\xe7\xbc\xc2\x80\xc5\\ \x9f%\xf9\xab\x88a\xc2\x95\x9a\xa7\xcb\xb7\xc7\x83fI0\x15\x13_*\x19\xb3\xc4\xd0\x00\xa2\xec\xd5\xbd2\xab\xb3\n\xa7\xfc\xc4W\xc7\x8dFP>\xde\xb5\x13D\xa1\xe71SfAs\xb9\x10Ve\xbb\xa3r\xce\x0e\xcc\xb3\x89\xdf\x08\xa6\xa3E\xde/\xb1\x16\xbb\xe9[\xe6$7\xa6\x8d\x91.\x95x\xcc\x80\x8dX,\xa2\xb9/\xe3\x94%\xf3%\xb9\xb6\x14<\x96\xb0\x84)\x9ef^$|\xf0q[\x94\xe2\x9a3\xe5\x8f\xc1\x97r\"\x92\xd0\x1f\xb3$\xe1\x91]Z$C\xa1\x8d\xf05\xcc83c\xae\x16\xb5\xb4O\xbb^cdX\xc9\xb7[R\xbfq\xa3\xd5\xac{\xd5c[\xdb,\xb1\x1b\xdc\x0fT\xd9\xae\xc2\xdb\x9d\xd5K\xb5\x11WV\x86F\xe2F\xa5\xd2\xf4kcM\xd9q\xc5S<\xac\xf2\xa9e\xd1Qt\xa3^\xceZ\xb3\x86\xb7\xc2\x91*?2g\x0c\x89\x1b\xac9^f\xe7\xe3F\x98.\xd9\xe5\xb5F^*\x97}\xbdq\x995\xca|\xc9<\xd6\x08n\x06r\x91\x15\xbb\xdc\xe7\xc7\xe9\"{\xbc\xeb\x07%f\xfb\xaa\xa9_\xe6%\x16W9\x88\x04\x85\x9b\xfe%\x9dE\x10\x89\x11?\x13l\x9d*\xce\x02\x8f\x1b#\x920\x97\xfc\x05\x9ff22\\\xe9I\x94\xcdr\x89\xe3\xfed\x1a\x18\xbf\x95\xf3!\xf5\xd5Q\xcb\xaf\xe6\xb9\x9b~\xc5o\xf1\x8a\xbfd\xcaQ\xcbo\xda\x9c\x117v[\xc77\xe6VH\xe6#%wE\xbda\x971\x0f=Qaq|\x0c\xcb\xffA\x122\x81(\x8dF\"a\x89/X\x04\xda\x1f\xcb\x88)=\x16\xa9\xc6\xc3\xa0\x85?\xe6jy\ny\xc9k\x94\x1a\x96I\xbb5O\xd5\xfc\xf9r\x1f\x83\xe3\xf1D/2\x9a\x8f\x03\xcb\x9e\xe6\xbc\xc4J\xf5\xaae{\xe8OTuTZ\x8ah\x8b\xcd\xbce\x86y\x15/Xd\xc2\xacYYnU\x1aUF\xcbm4\xd5`\x9c7\x9b\x94\xbdl7?\xebI\xe8\xf95v3Xdx\x8b\xe7gS\x86^:j\x8e,\xa17\xfc +\xa7\xb1\x0f\xcc\xf7e\x96\x18\x96\x18\x0d\x1eS~\xc4\xe6>S\x01x\x11\xf3'#%\x026\x07/\x92\xfe\xc4\xcb\x10\xb2\xc0S\"\x08\xb962\xe1\xe0\xb3h*\x92I\xc4E\x82\xbc4\x8a\xd1++\xc1W<\x10&K\x90\xad< E\xc2\xb9\xc2\xdd\xe6(\x17\xa9\x12\x9ak\x18I\x19$\xdc\xcc\xa4\x9a\x80H\xa6\\\x1b\xfaW'{\x92\xc6\xd2\xf0HC\xc4bO\xaap,\x12\x01\xb14R\xf9s?\xe2\x1ad\xc4\xe6, \x95\xccRH\xc7\xd2\xc8P\xb1t<\x874bsmH\xee U2\xb0;\xab\xf1:\xa4\x97\xa1O9(\x1ed\xb1\xa7x\x141\xa0\xb7\x1923\x961\x87\x99\x88\"\xc1\xe2\xb1\x88,\x83\xcaeow!ie\x7fR\xe1e\xbb\x8f\xe5\x1b7f\x95|\x1b+\x9a\xe4\xd1\xca\x84\xa7M\xa9da\xb1\x1a\xe8\xdd\xddj.+\xe3\xb36\xbb\x15\xbf\x12\xb4\xd8Rl\x16\xe5\xb5\xda\x8d\xd9n\xc5\xb6\xaf\x8f\xd4\xcdf~\xdd,1Y\xc9!\xa15Q\xa6\x94\xef\xa4\xefO*^5W;7U\xbd\xb5k\xaf\x832\xf3\x8f\xf2r>\x9a\xce\x9b\xf9\xa1\xe7\xdaL\x1b5;\xe6\xc87\xbb\x95\xd6\xc4^\x1f\xddhT\xf21G\xd1\xacZ\xcb\xcf}X9>\xde\xcdOR\xc8\xcf\xe8\x0f'Uf\xf26\xf9y\xb3\xd7\xc7\xa6Y\xde\xb5\xe5\"V\xb5r5\xa1\xeb\xa3\xfa\xac\xdc\xca\xf9p4U\xe5f\xcb\xf2g\x92\xaaY9\xe7\xed$U\xf3Zcq\x9d5\xca\xf5\xe5A@(Z\\\x9b\xe3J\x0eQ\xe2\xb8\xd9*\xdb6\xc9\xfc\xc6\xbc\x92\x03\xbf4Y\xa3U\xb7\xe3\xa4\x9ei5\x1a\x96\xb64\xf4t)\xb0|\xb8\xd1:\x9a{\xf99Q\xe3\x1b\xd3V\xdd\xd2\xa6\xe44k6\xed\xf8\xbau\xb6.\xcdu\xad\xb6k\xdb\x98z\xc9\xab\xe5sM\xb3\x1b\xcdz.\x0f\xb3]\xa5wKVf\x8e\xc77j\x95\xbc\xfc\xe6H\x95\xeb\xbb\x1e\x9c\xbe\xf6\xbd\xd3\xd7~{\xfa\xda\xdf\x9c\xfe\xf4\xdb\xa7\xaf}\xe7\xf4\xb5W\xe8\xe2\x95\xd3\x9f>{\xfa\xda\xeb\xa7?\xfd\xf6\xca \x04\x962\x95\x9f\x03\xa6\xb5\xf4\x053\x1c\x8f\xa5\x9ep\xe3\xb1(\x02/IS\xa6\x84\xc74x\x92\x8f\xf1Tq\x05>K\x85a\x11\x1dI\x99\xe8,\"l\xb5\xa7\x90\x0e\xb3\x9f -\x12\x92y\x9e)9\x15\x9a\x8e\xe6\xb1Q\x8c^\xc7\x05#\x99%\x81=8c\xce\"3\xf6\x99\xe2 \xe2Xz\"\x12<\x01\x91\x04\x996\n\xd5v\xcc\x12\x16\xd2\xeb\x11!\x16Fg\x9e\xd0c\x01\x16\xeeg\"\xe0\x90\xf0\xd9XF\x11K\x02H\xf8\xb1 \x84\xe2\xbe\x01\x99\xcce\xa646X\xb1\x01R%\x0d\xf7\xf3\x13\x9b\x05<1\x08\xbf\x8a\xb3\x88\xd3\x8b\x19a\xa1\x80Y\x02\n\x8bP\x8d\x18\xc4g\xc6G\xa3\x88+\xd0312\xbe\x9cr\x05\x86\x19F8\xa1\xc1p\x7f\x9c\xc8H\x86s0<\xe2#\x99\x08\x9fA\x96\x08\x02s3\x87\xa9\xd0\x86\xa5J$\x06\xa6\x11cI\xc0\x15O`*\xa3\x89\x9e\xb1\x90[\x01\xae\x96\x94j\xcc\xedez\x9c5\xed\xb1\xd9\xad\xdd(\x97\xf3\x13\x1dzJX\xa1\xae\xd5n\x1c\xd7\xac\xfc\xd5\xcc\xcd\xb8\xb6<\xc2zf/[%Ve\xb6[+\xf0n\xe4\xb0\xde\xe2\xa6V\xc9\xe8\xd2\xafx\xaaa\xdb\xfa\xe1\xae7\x11\xf6\xf2\xa6\xd2%\xb3\xb8\xcc*K\x93\xa0\x9e\x9f\xfa\x91\xb8\xa1\x9bzqy\xb3e/\x85,\xb1\x86\x1da\x92f\xa6j/\xe3cs\xa3l\xe9\x95U\x7f\xb6k\xcfE\xaa\xf5<\xa7!K\xb2t\xd7\xaex\x16z\xe3|\x99\xb3\xd0\x8br\xd9\x9f\xb7X\x95\xdd@\xa1\xe5\x89\xc9\x14\x07\x16\x8d\x98\x921\x97\xc0\"\xabAo\x02\x8bQW\x04,\x06\x96\xb0hN6\x11\xbb\x911\x84]Nj\x86G2a\xa8Xd\xecq\x15\x82?VB\x9b\x98i\xf0e\x1cg n\x91\x15\x1c\xa9\xe6\xc0\x83\xcc\xbe\xe1\x06\xf8\x8dL\xa4${#&\xd4L$\x81\x863\xb5=\x12*WM#\xb4\xd4\x12\x91i\x18)\x99\x98@J\x05\xa3\xecH\x1cs%\x8fa\x94\xa9D\x10\xf5\xa1\x8c\x02\xfa\x87&\x18\x0b\xcdH\x9e\x01\xf5A\xc0Si\xe8*\x942\xd0t\xa5y\xa29\x8ce\xc2\xe73\x1eE \x12m\x84\xc9\x0c\x1a<\x0b\xf3f\x92\xc9\x89UL\x11\x0b<%'\x1c\xd5X\xe23R\x9ex&\x14\x89*\x1aE\xda\xcc#\x0e1S\x13N\x076F\x83\x83E\x91\x86\x98G\x9e\xccT\xc2!\x16\xbe\x92Z\x8e\x0c\xa4,a\x1a\xc5\x18R\xa65\x8a(\x9e\x9e\xdch\x05%\xfc1SA$@\xfbGr\x9ch\x99\x80\x1e\xa3\x92\x14\x11\x03-\xa3\xcc\xaaB:T\x1eK&\xf6j\xc4T\x0c\xdaH\x7f2\x96Q|\xe6\x88\xc0\x94Y\x86\xeb\x85\xe8\n{\xe5\x97\xd9\xd4\x8ahPf\x91\x85a^f9\xa8\x8e\xc6\x1e\xb7\x82vTf|\xb4\xb8\x8a\xad\x98Ee\xe6/\x8d\x14ul\xaf\xd0\x1e\xb7BXf\xbe\xbd2\xfedf\x95\xc9t|#\x9b\xc2\\\x06\xd2c\x082\xcc\xcb\x821\xf3\x040\xa1FR\xf9(}\x91\xc5 f\x8cT \x9f/\x8c\x18\xb2f\xf8HJ\x83\x17!\x13 \x01)\xb70*3#nd\x1c<\xc5\x02\xae} \x9e\x92,\x98\xa1\xad\xa32\xad\xd1\xf8\xf0\xb2\x80\xa5\\\x1b\xf0\xec#\xc3X\x82 \xaa5\xe2-7r\x96\x80\x8f\xae\x11a-Z\x11\xe4&\x8c\xd5\\#,\xf9\"U\x82%\x02|a\xe6\x9c\x19\x0d~\xc4YB\x8d#\x91\xd0\xec~$\xcd\x98Jd\x1c\xd3\xa6\xa0/\x92\xa1\xa4\x04\x10\x9a4\x87\xbd@\xa9\n\xe4\x8c\xde\xbb\xbb\xb4\xba\x00\xa5C\xa30\xf0\x85\x84r#4\x8b\x98\x01>\xe5\x8a&\xe5\xc7h\x80\x87\x1cF\x9c\x07\x1e\xf3'0\x128\xbf\x99\xe3\x81\x8a\x03\x16\xa1\x82\x90V\x03\xd1q\x12\\\x01\x9e\x8b9g\nB\xc5\xac\x1a\"+\x0c\x8fz\x981\x15\x08\x96\xc08\x18\xf94\xc5\x98GZ$\x13\x01c\x19\x05\" \xf1@iRZ \x12\xfb\x82n\x10\xa9P, \x19 2'^\x16\xc1Q\x1aK\x15\xb2\x04\"4\xd4\x90QQ\x96\x04\x1e\xf7'xV\x94\x90\xc6@\xcc4z\xa8\x02b\x7f\"\x12\xcd\xe7\x10\xf3X*D\x83\x98+\x7f\x12\xeb\x00b\xa9L\xc8B\x0e\xb1$\xd8W =\xcd\x15r\x0c\x15n\x82\x9b\x9b\x8e\x99\x8a\x99?\x87T\xf8\x88\x0c\x1a\xd2(\x8b=\x9c4WWs\xb4\x1d-\xba(\x1e \xeb\xcd0\xa6H\xd1i\x16k?\xca<\xd0\xdc\xcf\x14\xb2.\xffoH\x0dz,\xd3\x14\xc7\xd1c93\"\xe6\x80\xe7\xd9\x9eA923\xd4\xb4\xda\xf8\x165t\x96\xa6\x119\xc7s\xf4\x89\xb9\x8fgR\x90\xd8d\xbeL\x12\xd4\xa4S\x96\x10\x87aj!\x98<\x14A\xaf4\x98!X\xa1\x8a\xcdO\xad\xbdHd^\x92\x96\x99=\x9e7\x8eY\x0cs9\x91c\x163\xb8\xfb\xd2\xbd\xaf\xdf\xfd\xf9\xdd\xb7\xee\xbdp\xf7\xa7\xf7\xbey\xf7\xc7\xc0<\x19\xb2@\x02\xf3Y\xc0\xe39\xb0\x90M\xc6,\x01\x16 \x8fy\x0c\x08\xc6D\x00\xcc\x8c#n\x18\xb0\xdc\x87bY \xbc\x88\x03\xcbt*\xb5\x016E61\xf2\xa5c~\x0c\x1e\xcb\xc6,\xd3\xe0\xf1\xc4DxV\xb96^6\x07\xcfz\xd3x\n\xd1o\x06/\x0b\x991ba\xd8\x80\xcf\x14\x9b2\xe4\xb9?\x16\x89at\xe6X\x80\xe5Q\xe6\xc5<\x00_F\x11\x0f\xd1:\x8adHVR\x8c\x88\x0c\x0b\xd7\x9f~\x15YO\x86\xf9f\xe1\xdd\x83/\xd1\xf3c@\xc7La\xbb,EL\xf4\xd1\x92\xe1\xe8\xe8\x08\x7f\xc2\x0d\xf8*#\xa7\x86\xec\x17\x8d\x072$\xba\x03\x19\x13\xf0\xf0\xe3Tj\x1e\xc0\"\x12\x82\xb0\x8b\xeb\x18!\xaa\xc9\x04F\\)\xa6\x04\xd8\x17\xf4\xc9\\\xa3q\x18\xa1i\x95\x840\x12\x86\x80gD\x07\x01\x7f%\xaaK\xfc\x9d\xd18Ri:\xa5J\x86,\xd1\xa4\xe9P\x93\x85,\x8a\x10DB\xa4+ !\x94\x01\x0b\x829\x84J\xfaT\x9e \xc3\x94\x861\x8b\xbdL\x85\x800 3\xd4\x85\x86\xf9c:\xad\xe4\x00\x8e\xa5\xa6\xfe\xe4\x97q<\xbc&f\"\x82\xf1\x1c\xcdF\x01B\xd3\xe7\n@h,\x16p\xc4g