forked from TrueCloudLab/neoneo-go
Merge pull request #2384 from nspcc-dev/rpc/rules
rpc: add Rules signer scope to request parameters
This commit is contained in:
commit
3db8dffa3c
1 changed files with 10 additions and 7 deletions
|
@ -429,6 +429,7 @@ func (p *Param) GetSignerWithWitness() (SignerWithWitness, error) {
|
||||||
Scopes: aux.Scopes,
|
Scopes: aux.Scopes,
|
||||||
AllowedContracts: aux.AllowedContracts,
|
AllowedContracts: aux.AllowedContracts,
|
||||||
AllowedGroups: aux.AllowedGroups,
|
AllowedGroups: aux.AllowedGroups,
|
||||||
|
Rules: aux.Rules,
|
||||||
},
|
},
|
||||||
Witness: transaction.Witness{
|
Witness: transaction.Witness{
|
||||||
InvocationScript: aux.InvocationScript,
|
InvocationScript: aux.InvocationScript,
|
||||||
|
@ -481,21 +482,23 @@ func (p *Param) IsNull() bool {
|
||||||
// signerWithWitnessAux is an auxiluary struct for JSON marshalling. We need it because of
|
// signerWithWitnessAux is an auxiluary struct for JSON marshalling. We need it because of
|
||||||
// DisallowUnknownFields JSON marshaller setting.
|
// DisallowUnknownFields JSON marshaller setting.
|
||||||
type signerWithWitnessAux struct {
|
type signerWithWitnessAux struct {
|
||||||
Account string `json:"account"`
|
Account string `json:"account"`
|
||||||
Scopes transaction.WitnessScope `json:"scopes"`
|
Scopes transaction.WitnessScope `json:"scopes"`
|
||||||
AllowedContracts []util.Uint160 `json:"allowedcontracts,omitempty"`
|
AllowedContracts []util.Uint160 `json:"allowedcontracts,omitempty"`
|
||||||
AllowedGroups []*keys.PublicKey `json:"allowedgroups,omitempty"`
|
AllowedGroups []*keys.PublicKey `json:"allowedgroups,omitempty"`
|
||||||
InvocationScript []byte `json:"invocation,omitempty"`
|
Rules []transaction.WitnessRule `json:"rules,omitempty"`
|
||||||
VerificationScript []byte `json:"verification,omitempty"`
|
InvocationScript []byte `json:"invocation,omitempty"`
|
||||||
|
VerificationScript []byte `json:"verification,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// MarshalJSON implements json.Unmarshaler interface.
|
// MarshalJSON implements json.Marshaler interface.
|
||||||
func (s *SignerWithWitness) MarshalJSON() ([]byte, error) {
|
func (s *SignerWithWitness) MarshalJSON() ([]byte, error) {
|
||||||
signer := &signerWithWitnessAux{
|
signer := &signerWithWitnessAux{
|
||||||
Account: s.Account.StringLE(),
|
Account: s.Account.StringLE(),
|
||||||
Scopes: s.Scopes,
|
Scopes: s.Scopes,
|
||||||
AllowedContracts: s.AllowedContracts,
|
AllowedContracts: s.AllowedContracts,
|
||||||
AllowedGroups: s.AllowedGroups,
|
AllowedGroups: s.AllowedGroups,
|
||||||
|
Rules: s.Rules,
|
||||||
InvocationScript: s.InvocationScript,
|
InvocationScript: s.InvocationScript,
|
||||||
VerificationScript: s.VerificationScript,
|
VerificationScript: s.VerificationScript,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue