mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-25 13:47:19 +00:00
Merge pull request #3394 from nspcc-dev/better-notary-actor
rpcclient: make default Notary actor options customizable
This commit is contained in:
commit
c81ed22698
2 changed files with 6 additions and 6 deletions
|
@ -88,8 +88,8 @@ type RPCActor interface {
|
||||||
|
|
||||||
// NewDefaultActorOptions returns the default Actor options. Internal functions
|
// NewDefaultActorOptions returns the default Actor options. Internal functions
|
||||||
// of it need some data from the contract, so it should be added.
|
// of it need some data from the contract, so it should be added.
|
||||||
func NewDefaultActorOptions(reader *ContractReader, acc *wallet.Account) ActorOptions {
|
func NewDefaultActorOptions(reader *ContractReader, acc *wallet.Account) *ActorOptions {
|
||||||
opts := ActorOptions{
|
opts := &ActorOptions{
|
||||||
FbScript: []byte{byte(opcode.RET)},
|
FbScript: []byte{byte(opcode.RET)},
|
||||||
FbSigner: actor.SignerAccount{
|
FbSigner: actor.SignerAccount{
|
||||||
Signer: transaction.Signer{
|
Signer: transaction.Signer{
|
||||||
|
@ -132,8 +132,8 @@ func NewActor(c RPCActor, signers []actor.SignerAccount, simpleAcc *wallet.Accou
|
||||||
|
|
||||||
// NewTunedActor is the same as NewActor, but allows to override the default
|
// NewTunedActor is the same as NewActor, but allows to override the default
|
||||||
// options (see ActorOptions for details). Use with care.
|
// options (see ActorOptions for details). Use with care.
|
||||||
func NewTunedActor(c RPCActor, signers []actor.SignerAccount, opts ActorOptions) (*Actor, error) {
|
func NewTunedActor(c RPCActor, signers []actor.SignerAccount, opts *ActorOptions) (*Actor, error) {
|
||||||
return newTunedActor(c, signers, opts.FbSigner.Account, &opts)
|
return newTunedActor(c, signers, opts.FbSigner.Account, opts)
|
||||||
}
|
}
|
||||||
|
|
||||||
func newTunedActor(c RPCActor, signers []actor.SignerAccount, simpleAcc *wallet.Account, opts *ActorOptions) (*Actor, error) {
|
func newTunedActor(c RPCActor, signers []actor.SignerAccount, simpleAcc *wallet.Account, opts *ActorOptions) (*Actor, error) {
|
||||||
|
@ -174,7 +174,7 @@ func newTunedActor(c RPCActor, signers []actor.SignerAccount, simpleAcc *wallet.
|
||||||
reader := NewReader(invoker.New(c, nil))
|
reader := NewReader(invoker.New(c, nil))
|
||||||
if opts == nil {
|
if opts == nil {
|
||||||
defOpts := NewDefaultActorOptions(reader, simpleAcc)
|
defOpts := NewDefaultActorOptions(reader, simpleAcc)
|
||||||
opts = &defOpts
|
opts = defOpts
|
||||||
}
|
}
|
||||||
var notarySA = actor.SignerAccount{
|
var notarySA = actor.SignerAccount{
|
||||||
Signer: transaction.Signer{
|
Signer: transaction.Signer{
|
||||||
|
|
|
@ -54,7 +54,7 @@ func ExampleActor() {
|
||||||
panic("deposit failed")
|
panic("deposit failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
var opts notary.ActorOptions
|
var opts = new(notary.ActorOptions)
|
||||||
// Add high priority attribute, we gonna be making committee-signed transactions anyway.
|
// Add high priority attribute, we gonna be making committee-signed transactions anyway.
|
||||||
opts.MainAttributes = []transaction.Attribute{{Type: transaction.HighPriority}}
|
opts.MainAttributes = []transaction.Attribute{{Type: transaction.HighPriority}}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue