[#1100] *: Adopt new SDK's owner.ID
API
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
4b5404047c
commit
fee2f5a330
21 changed files with 32 additions and 134 deletions
|
@ -52,17 +52,7 @@ func (cp *Processor) checkKeyOwnership(ownerIDSrc ownerIDSource, key *keys.Publi
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: need more convenient way to do this
|
||||
w, err := owner.NEO3WalletFromPublicKey(&ecdsa.PublicKey{
|
||||
Curve: key.Curve,
|
||||
X: key.X,
|
||||
Y: key.Y,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if ownerIDSrc.OwnerID().Equal(owner.NewIDFromNeo3Wallet(w)) {
|
||||
if ownerIDSrc.OwnerID().Equal(owner.NewIDFromPublicKey((*ecdsa.PublicKey)(key))) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -319,13 +319,5 @@ func ownerFromKey(key []byte) (*owner.ID, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
n3wallet, err := owner.NEO3WalletFromPublicKey((*ecdsa.PublicKey)(pubKey))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
o := owner.NewID()
|
||||
o.SetNeo3Wallet(n3wallet)
|
||||
|
||||
return o, nil
|
||||
return owner.NewIDFromPublicKey((*ecdsa.PublicKey)(pubKey)), nil
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"math/big"
|
||||
"sync"
|
||||
|
||||
"github.com/mr-tron/base58"
|
||||
"github.com/nspcc-dev/neo-go/pkg/encoding/address"
|
||||
"github.com/nspcc-dev/neo-go/pkg/util"
|
||||
"github.com/nspcc-dev/neofs-node/pkg/innerring/processors/settlement/common"
|
||||
|
@ -85,16 +84,12 @@ func bankOwnerID() (*owner.ID, error) {
|
|||
u := util.Uint160{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // todo: define const
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
|
||||
|
||||
d, err := base58.Decode(address.Uint160ToString(u))
|
||||
o := owner.NewID()
|
||||
|
||||
err := o.Parse(address.Uint160ToString(u))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var w owner.NEO3Wallet
|
||||
copy(w[:], d)
|
||||
|
||||
o := owner.NewID()
|
||||
o.SetNeo3Wallet(&w)
|
||||
|
||||
return o, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue