txscript: Rename removeOpcodeByDataRaw func.

This renames the removeOpcodeByDataRaw to removeOpcodeByData now that
the old version has been removed.
This commit is contained in:
Dave Collins 2019-03-13 01:13:00 -05:00 committed by Roy Lee
parent 64aeab7882
commit 9d1d6d59a6
3 changed files with 5 additions and 5 deletions

View file

@ -2063,7 +2063,7 @@ func opcodeCheckSig(op *parsedOpcode, vm *Engine) error {
} else {
// Remove the signature since there is no way for a signature
// to sign itself.
subScript = removeOpcodeByDataRaw(subScript, fullSigBytes)
subScript = removeOpcodeByData(subScript, fullSigBytes)
hash = calcSignatureHashRaw(subScript, hashType, &vm.tx, vm.txIdx)
}
@ -2236,7 +2236,7 @@ func opcodeCheckMultiSig(op *parsedOpcode, vm *Engine) error {
// no way for a signature to sign itself.
if !vm.isWitnessVersionActive(0) {
for _, sigInfo := range signatures {
script = removeOpcodeByDataRaw(script, sigInfo.signature)
script = removeOpcodeByData(script, sigInfo.signature)
}
}

View file

@ -318,7 +318,7 @@ func isCanonicalPush(opcode byte, data []byte) bool {
return true
}
// removeOpcodeByDataRaw will return the script minus any opcodes that perform a
// removeOpcodeByData will return the script minus any opcodes that perform a
// canonical push of data that contains the passed data to remove. This
// function assumes it is provided a version 0 script as any future version of
// script should avoid this functionality since it is unncessary due to the
@ -332,7 +332,7 @@ func isCanonicalPush(opcode byte, data []byte) bool {
// NOTE: This function is only valid for version 0 scripts. Since the function
// does not accept a script version, the results are undefined for other script
// versions.
func removeOpcodeByDataRaw(script []byte, dataToRemove []byte) []byte {
func removeOpcodeByData(script []byte, dataToRemove []byte) []byte {
// Avoid work when possible.
if len(script) == 0 || len(dataToRemove) == 0 {
return script

View file

@ -4136,7 +4136,7 @@ func TestRemoveOpcodeByData(t *testing.T) {
return nil, err
}
return removeOpcodeByDataRaw(script, data), nil
return removeOpcodeByData(script, data), nil
}
for _, test := range tests {