*: remove duplicate functions producing verification script
Drop wif.GetVerificationScript(), drop smartcontract.CreateSignatureRedeemScript(), add GetVerificationScript() directly to the PublicKey and use it everywhere.
This commit is contained in:
parent
8d4dd2d2e1
commit
138e125646
6 changed files with 15 additions and 50 deletions
|
@ -8,7 +8,6 @@ import (
|
|||
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
||||
"github.com/CityOfZion/neo-go/pkg/crypto/hash"
|
||||
"github.com/CityOfZion/neo-go/pkg/crypto/keys"
|
||||
"github.com/CityOfZion/neo-go/pkg/smartcontract"
|
||||
"github.com/CityOfZion/neo-go/pkg/util"
|
||||
"github.com/CityOfZion/neo-go/pkg/vm"
|
||||
gherr "github.com/pkg/errors"
|
||||
|
@ -309,11 +308,7 @@ func (ic *interopContext) checkHashedWitness(hash util.Uint160) (bool, error) {
|
|||
// checkKeyedWitness checks hash of signature check contract with a given public
|
||||
// key against current list of script hashes for verifying in the interop context.
|
||||
func (ic *interopContext) checkKeyedWitness(key *keys.PublicKey) (bool, error) {
|
||||
script, err := smartcontract.CreateSignatureRedeemScript(key)
|
||||
if err != nil {
|
||||
return false, gherr.Wrap(err, "failed to create signature script for a key")
|
||||
}
|
||||
return ic.checkHashedWitness(hash.Hash160(script))
|
||||
return ic.checkHashedWitness(hash.Hash160(key.GetVerificationScript()))
|
||||
}
|
||||
|
||||
// runtimeCheckWitness checks witnesses.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue