auth

package
v1.0.0-rc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAuth        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuth          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Account

type Account interface {
	GetAddress() sdk.AccAddress
	SetAddress(sdk.AccAddress) error // errors if already set.

	GetPubKey() crypto.PubKey // can return nil.
	SetPubKey(crypto.PubKey) error

	GetAccountNumber() uint64
	SetAccountNumber(uint64) error

	GetSequence() uint64
	SetSequence(uint64) error
}

Account is an interface used to store coins at a given address within state. It presumes a notion of sequence numbers for replay protection, a notion of account numbers for replay protection for previously pruned accounts, and a pubkey for authentication purposes.

Many complex conditions can be used in the concrete struct which implements Account.

type BaseAccount

type BaseAccount struct {
	Address       github_com_irisnet_service_sdk_go_types.AccAddress `` /* 127-byte string literal not displayed */
	PubKey        []byte                                             `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"public_key,omitempty" yaml:"public_key"`
	AccountNumber uint64                                             `protobuf:"varint,3,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty" yaml:"account_number"`
	Sequence      uint64                                             `protobuf:"varint,4,opt,name=sequence,proto3" json:"sequence,omitempty"`
}

BaseAccount defines a base account type. It contains all the necessary fields for basic account functionality. Any custom account type should extend this type for additional functionality (e.g. vesting).

func (*BaseAccount) Convert

func (acc *BaseAccount) Convert() interface{}

Convert return a sdk.BaseAccount

func (*BaseAccount) Descriptor

func (*BaseAccount) Descriptor() ([]byte, []int)

func (*BaseAccount) GetAccountNumber

func (acc *BaseAccount) GetAccountNumber() uint64

GetAccountNumber Implements Account

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() sdk.AccAddress

GetAddress Implements sdk.Account.

func (BaseAccount) GetPubKey

func (acc BaseAccount) GetPubKey() (pk crypto.PubKey)

GetPubKey - Implements sdk.Account.

func (*BaseAccount) GetSequence

func (acc *BaseAccount) GetSequence() uint64

GetSequence Implements sdk.Account.

func (*BaseAccount) Marshal

func (m *BaseAccount) Marshal() (dAtA []byte, err error)

func (*BaseAccount) MarshalTo

func (m *BaseAccount) MarshalTo(dAtA []byte) (int, error)

func (*BaseAccount) MarshalToSizedBuffer

func (m *BaseAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*BaseAccount) ProtoMessage

func (*BaseAccount) ProtoMessage()

func (*BaseAccount) Reset

func (m *BaseAccount) Reset()

func (*BaseAccount) SetAccountNumber

func (acc *BaseAccount) SetAccountNumber(accNumber uint64) error

SetAccountNumber Implements Account

func (*BaseAccount) SetAddress

func (acc *BaseAccount) SetAddress(addr sdk.AccAddress) error

SetAddress Implements sdk.Account.

func (*BaseAccount) SetPubKey

func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error

SetPubKey - Implements sdk.Account.

func (*BaseAccount) SetSequence

func (acc *BaseAccount) SetSequence(seq uint64) error

SetSequence Implements sdk.Account.

func (*BaseAccount) Size

func (m *BaseAccount) Size() (n int)

func (BaseAccount) String

func (acc BaseAccount) String() string

func (*BaseAccount) Unmarshal

func (m *BaseAccount) Unmarshal(dAtA []byte) error

func (*BaseAccount) XXX_DiscardUnknown

func (m *BaseAccount) XXX_DiscardUnknown()

func (*BaseAccount) XXX_Marshal

func (m *BaseAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BaseAccount) XXX_Merge

func (m *BaseAccount) XXX_Merge(src proto.Message)

func (*BaseAccount) XXX_Size

func (m *BaseAccount) XXX_Size() int

func (*BaseAccount) XXX_Unmarshal

func (m *BaseAccount) XXX_Unmarshal(b []byte) error

type QueryAccountRequest

type QueryAccountRequest struct {
	// address defines the address to query for.
	Address github_com_irisnet_service_sdk_go_types.AccAddress `` /* 127-byte string literal not displayed */
}

QueryAccountRequest is the request type for the Query/Account RPC method.

func (*QueryAccountRequest) Descriptor

func (*QueryAccountRequest) Descriptor() ([]byte, []int)

func (*QueryAccountRequest) GetAddress

func (*QueryAccountRequest) Marshal

func (m *QueryAccountRequest) Marshal() (dAtA []byte, err error)

func (*QueryAccountRequest) MarshalTo

func (m *QueryAccountRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAccountRequest) MarshalToSizedBuffer

func (m *QueryAccountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAccountRequest) ProtoMessage

func (*QueryAccountRequest) ProtoMessage()

func (*QueryAccountRequest) Reset

func (m *QueryAccountRequest) Reset()

func (*QueryAccountRequest) Size

func (m *QueryAccountRequest) Size() (n int)

func (*QueryAccountRequest) String

func (m *QueryAccountRequest) String() string

func (*QueryAccountRequest) Unmarshal

func (m *QueryAccountRequest) Unmarshal(dAtA []byte) error

func (*QueryAccountRequest) XXX_DiscardUnknown

func (m *QueryAccountRequest) XXX_DiscardUnknown()

func (*QueryAccountRequest) XXX_Marshal

func (m *QueryAccountRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAccountRequest) XXX_Merge

func (m *QueryAccountRequest) XXX_Merge(src proto.Message)

func (*QueryAccountRequest) XXX_Size

func (m *QueryAccountRequest) XXX_Size() int

func (*QueryAccountRequest) XXX_Unmarshal

func (m *QueryAccountRequest) XXX_Unmarshal(b []byte) error

type QueryAccountResponse

type QueryAccountResponse struct {
	// account defines the account of the corresponding address.
	Account *types.Any `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
}

QueryAccountResponse is the response type for the Query/Account RPC method.

func (*QueryAccountResponse) Descriptor

func (*QueryAccountResponse) Descriptor() ([]byte, []int)

func (*QueryAccountResponse) GetAccount

func (m *QueryAccountResponse) GetAccount() *types.Any

func (*QueryAccountResponse) Marshal

func (m *QueryAccountResponse) Marshal() (dAtA []byte, err error)

func (*QueryAccountResponse) MarshalTo

func (m *QueryAccountResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAccountResponse) MarshalToSizedBuffer

func (m *QueryAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAccountResponse) ProtoMessage

func (*QueryAccountResponse) ProtoMessage()

func (*QueryAccountResponse) Reset

func (m *QueryAccountResponse) Reset()

func (*QueryAccountResponse) Size

func (m *QueryAccountResponse) Size() (n int)

func (*QueryAccountResponse) String

func (m *QueryAccountResponse) String() string

func (*QueryAccountResponse) Unmarshal

func (m *QueryAccountResponse) Unmarshal(dAtA []byte) error

func (*QueryAccountResponse) XXX_DiscardUnknown

func (m *QueryAccountResponse) XXX_DiscardUnknown()

func (*QueryAccountResponse) XXX_Marshal

func (m *QueryAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAccountResponse) XXX_Merge

func (m *QueryAccountResponse) XXX_Merge(src proto.Message)

func (*QueryAccountResponse) XXX_Size

func (m *QueryAccountResponse) XXX_Size() int

func (*QueryAccountResponse) XXX_Unmarshal

func (m *QueryAccountResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Account returns account details based on address.
	Account(ctx context.Context, in *QueryAccountRequest, opts ...grpc.CallOption) (*QueryAccountResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
	// Account returns account details based on address.
	Account(context.Context, *QueryAccountRequest) (*QueryAccountResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Account

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL