Skip to content

Commit

Permalink
rebase develop
Browse files Browse the repository at this point in the history
  • Loading branch information
kingpinXD committed Nov 7, 2023
1 parent fa5a475 commit 336a219
Show file tree
Hide file tree
Showing 10 changed files with 263 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
shows a NodeAccount

```
zetacored query observer show-node-account [index] [flags]
zetacored query observer show-node-account [operator_address] [flags]
```

### Options
Expand Down
1 change: 1 addition & 0 deletions docs/cli/zetacored/zetacored_tx_observer.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ zetacored tx observer [flags]
* [zetacored tx observer update-client-params](zetacored_tx_observer_update-client-params.md) - Broadcast message updateClientParams
* [zetacored tx observer update-crosschain-flags](zetacored_tx_observer_update-crosschain-flags.md) - Update crosschain flags
* [zetacored tx observer update-keygen](zetacored_tx_observer_update-keygen.md) - command to update the keygen block via a group proposal
* [zetacored tx observer update-observer](zetacored_tx_observer_update-observer.md) - Broadcast message add-observer

52 changes: 52 additions & 0 deletions docs/cli/zetacored/zetacored_tx_observer_update-observer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# tx observer update-observer

Broadcast message add-observer

```
zetacored tx observer update-observer [old-observer-address] [new-observer-address] [update-reason] [flags]
```

### Options

```
-a, --account-number uint The account number of the signing account (offline mode only)
--aux Generate aux signer data instead of sending a tx
-b, --broadcast-mode string Transaction broadcasting mode (sync|async|block)
--dry-run ignore the --gas flag and perform a simulation of a transaction, but don't broadcast it (when enabled, the local Keybase is not accessible)
--fee-granter string Fee granter grants fees for the transaction
--fee-payer string Fee payer pays fees for the transaction instead of deducting from the signer
--fees string Fees to pay along with transaction; eg: 10uatom
--from string Name or address of private key with which to sign
--gas string gas limit to set per-transaction; set to "auto" to calculate sufficient gas automatically. Note: "auto" option doesn't always report accurate results. Set a valid coin value to adjust the result. Can be used instead of "fees". (default 200000)
--gas-adjustment float adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored (default 1)
--gas-prices string Gas prices in decimal format to determine the transaction fee (e.g. 0.1uatom)
--generate-only Build an unsigned transaction and write it to STDOUT (when enabled, the local Keybase only accessed when providing a key name)
-h, --help help for update-observer
--keyring-backend string Select keyring's backend (os|file|kwallet|pass|test|memory)
--keyring-dir string The client Keyring directory; if omitted, the default 'home' directory will be used
--ledger Use a connected Ledger device
--node string [host]:[port] to tendermint rpc interface for this chain
--note string Note to add a description to the transaction (previously --memo)
--offline Offline mode (does not allow any online functionality)
-o, --output string Output format (text|json)
-s, --sequence uint The sequence number of the signing account (offline mode only)
--sign-mode string Choose sign mode (direct|amino-json|direct-aux), this is an advanced feature
--timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height
--tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator
-y, --yes Skip tx broadcasting prompt confirmation
```

### Options inherited from parent commands

```
--chain-id string The network chain ID
--home string directory for config and data
--log_format string The logging format (json|plain)
--log_level string The logging level (trace|debug|info|warn|error|fatal|panic)
--trace print out full stack trace on errors
```

### SEE ALSO

* [zetacored tx observer](zetacored_tx_observer.md) - observer transactions subcommands

3 changes: 0 additions & 3 deletions docs/spec/observer/messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

## MsgAddObserver

AddObserver adds in a new observer to the store.It can be executed using an admin policy account
Once added, the function also resets keygen and pauses inbound so that a new TSS can be generated.

```proto
message MsgAddObserver {
string creator = 1;
Expand Down
20 changes: 20 additions & 0 deletions typescript/observer/observer_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ export declare enum ObservationType {
TSSKeySign = 4,
}

/**
* @generated from enum zetachain.zetacore.observer.ObserverUpdateReason
*/
export declare enum ObserverUpdateReason {
/**
* @generated from enum value: EmptyObserverUpdateReason = 0;
*/
EmptyObserverUpdateReason = 0,

/**
* @generated from enum value: Tombstoned = 1;
*/
Tombstoned = 1,

/**
* @generated from enum value: AdminUpdate = 2;
*/
AdminUpdate = 2,
}

/**
* @generated from message zetachain.zetacore.observer.ObserverMapper
*/
Expand Down
59 changes: 59 additions & 0 deletions typescript/observer/tx_pb.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,70 @@

import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf";
import { Message, proto3 } from "@bufbuild/protobuf";
import type { ObserverUpdateReason } from "./observer_pb.js";
import type { HeaderData } from "../common/common_pb.js";
import type { CoreParams } from "./params_pb.js";
import type { Blame } from "./blame_pb.js";
import type { BlockHeaderVerificationFlags, GasPriceIncreaseFlags } from "./crosschain_flags_pb.js";

/**
* @generated from message zetachain.zetacore.observer.MsgUpdateObserver
*/
export declare class MsgUpdateObserver extends Message<MsgUpdateObserver> {
/**
* @generated from field: string creator = 1;
*/
creator: string;

/**
* @generated from field: string old_observer_address = 2;
*/
oldObserverAddress: string;

/**
* @generated from field: string new_observer_address = 3;
*/
newObserverAddress: string;

/**
* @generated from field: zetachain.zetacore.observer.ObserverUpdateReason update_reason = 4;
*/
updateReason: ObserverUpdateReason;

constructor(data?: PartialMessage<MsgUpdateObserver>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.MsgUpdateObserver";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MsgUpdateObserver;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MsgUpdateObserver;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MsgUpdateObserver;

static equals(a: MsgUpdateObserver | PlainMessage<MsgUpdateObserver> | undefined, b: MsgUpdateObserver | PlainMessage<MsgUpdateObserver> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.MsgUpdateObserverResponse
*/
export declare class MsgUpdateObserverResponse extends Message<MsgUpdateObserverResponse> {
constructor(data?: PartialMessage<MsgUpdateObserverResponse>);

static readonly runtime: typeof proto3;
static readonly typeName = "zetachain.zetacore.observer.MsgUpdateObserverResponse";
static readonly fields: FieldList;

static fromBinary(bytes: Uint8Array, options?: Partial<BinaryReadOptions>): MsgUpdateObserverResponse;

static fromJson(jsonValue: JsonValue, options?: Partial<JsonReadOptions>): MsgUpdateObserverResponse;

static fromJsonString(jsonString: string, options?: Partial<JsonReadOptions>): MsgUpdateObserverResponse;

static equals(a: MsgUpdateObserverResponse | PlainMessage<MsgUpdateObserverResponse> | undefined, b: MsgUpdateObserverResponse | PlainMessage<MsgUpdateObserverResponse> | undefined): boolean;
}

/**
* @generated from message zetachain.zetacore.observer.MsgAddBlockHeader
*/
Expand Down
7 changes: 4 additions & 3 deletions x/observer/keeper/msg_server_update_observer_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package keeper_test

import (
"math/rand"
"testing"
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
"github.com/stretchr/testify/assert"
keepertest "github.com/zeta-chain/zetacore/testutil/keeper"
"github.com/zeta-chain/zetacore/testutil/sample"
"github.com/zeta-chain/zetacore/x/observer/keeper"
"github.com/zeta-chain/zetacore/x/observer/types"
"math/rand"
"testing"
"time"
)

func TestMsgServer_UpdateObserver(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions x/observer/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var (
ErrNoParentHash = errorsmod.Register(ModuleName, 1120, "no parent hash")
ErrInvalidTimestamp = errorsmod.Register(ModuleName, 1121, "invalid timestamp")
ErrBlockHeaderVerificationDisabled = errorsmod.Register(ModuleName, 1122, "block header verification is disabled")
ErrLastObserverCountNotFound = errorsmod.Register(ModuleName, 1122, "last observer count not found")
ErrUpdateObserver = errorsmod.Register(ModuleName, 1123, "unable to update observer")
ErrNodeAccountNotFound = errorsmod.Register(ModuleName, 1124, "node account not found")
ErrLastObserverCountNotFound = errorsmod.Register(ModuleName, 1123, "last observer count not found")
ErrUpdateObserver = errorsmod.Register(ModuleName, 1124, "unable to update observer")
ErrNodeAccountNotFound = errorsmod.Register(ModuleName, 1125, "node account not found")
)
3 changes: 2 additions & 1 deletion x/observer/types/message_update_observer_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package types_test

import (
"testing"

sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/stretchr/testify/require"
"github.com/zeta-chain/zetacore/testutil/sample"
"github.com/zeta-chain/zetacore/x/observer/types"
"testing"
)

func TestNewMsgUpdateObserver(t *testing.T) {
Expand Down
Loading

0 comments on commit 336a219

Please sign in to comment.