当前位置: 首页>>代码示例>>Golang>>正文


Golang account.PubKey类代码示例

本文整理汇总了Golang中github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/account.PubKey的典型用法代码示例。如果您正苦于以下问题:Golang PubKey类的具体用法?Golang PubKey怎么用?Golang PubKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PubKey类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: AddInput

func (tx *SendTx) AddInput(st AccountGetter, pubkey acm.PubKey, amt int64) error {
	addr := pubkey.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return fmt.Errorf("Invalid address %X from pubkey %X", addr, pubkey)
	}
	return tx.AddInputWithNonce(pubkey, amt, acc.Sequence+1)
}
开发者ID:alist,项目名称:mint-client,代码行数:8,代码来源:tx_utils.go

示例2: NewCallTx

func NewCallTx(st AccountGetter, from acm.PubKey, to, data []byte, amt, gasLimit, fee int64) (*CallTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewCallTxWithNonce(from, to, data, amt, gasLimit, fee, nonce), nil
}
开发者ID:alist,项目名称:mint-client,代码行数:10,代码来源:tx_utils.go

示例3: NewPermissionsTx

func NewPermissionsTx(st AccountGetter, from acm.PubKey, args ptypes.PermArgs) (*PermissionsTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewPermissionsTxWithNonce(from, args, nonce), nil
}
开发者ID:alist,项目名称:mint-client,代码行数:10,代码来源:tx_utils.go

示例4: NewNameTx

func NewNameTx(st AccountGetter, from acm.PubKey, name, data string, amt, fee int64) (*NameTx, error) {
	addr := from.Address()
	acc := st.GetAccount(addr)
	if acc == nil {
		return nil, fmt.Errorf("Invalid address %X from pubkey %X", addr, from)
	}

	nonce := acc.Sequence + 1
	return NewNameTxWithNonce(from, name, data, amt, fee, nonce), nil
}
开发者ID:alist,项目名称:mint-client,代码行数:10,代码来源:tx_utils.go

示例5: AddInputWithNonce

func (tx *SendTx) AddInputWithNonce(pubkey acm.PubKey, amt int64, nonce int) error {
	addr := pubkey.Address()
	tx.Inputs = append(tx.Inputs, &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    pubkey,
	})
	return nil
}
开发者ID:alist,项目名称:mint-client,代码行数:11,代码来源:tx_utils.go

示例6: NewPermissionsTxWithNonce

func NewPermissionsTxWithNonce(from acm.PubKey, args ptypes.PermArgs, nonce int) *PermissionsTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    1, // NOTE: amounts can't be 0 ...
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &PermissionsTx{
		Input:    input,
		PermArgs: args,
	}
}
开发者ID:alist,项目名称:mint-client,代码行数:15,代码来源:tx_utils.go

示例7: NewNameTxWithNonce

func NewNameTxWithNonce(from acm.PubKey, name, data string, amt, fee int64, nonce int) *NameTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &NameTx{
		Input: input,
		Name:  name,
		Data:  data,
		Fee:   fee,
	}
}
开发者ID:alist,项目名称:mint-client,代码行数:17,代码来源:tx_utils.go

示例8: NewCallTxWithNonce

func NewCallTxWithNonce(from acm.PubKey, to, data []byte, amt, gasLimit, fee int64, nonce int) *CallTx {
	addr := from.Address()
	input := &TxInput{
		Address:   addr,
		Amount:    amt,
		Sequence:  nonce,
		Signature: acm.SignatureEd25519{},
		PubKey:    from,
	}

	return &CallTx{
		Input:    input,
		Address:  to,
		GasLimit: gasLimit,
		Fee:      fee,
		Data:     data,
	}
}
开发者ID:alist,项目名称:mint-client,代码行数:18,代码来源:tx_utils.go


注:本文中的github.com/eris-ltd/mint-client/Godeps/_workspace/src/github.com/tendermint/tendermint/account.PubKey类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。