(t *testing.T)
| 528 | } |
| 529 | |
| 530 | func TestScriptStandardPush(t *testing.T) { |
| 531 | for i := 0; i < 67000; i++ { |
| 532 | s := script.NewEmptyScript() |
| 533 | s.PushInt64(int64(i)) |
| 534 | if !s.IsPushOnly() { |
| 535 | t.Errorf("Number %d is not pure push.", i) |
| 536 | } |
| 537 | if VerifyScript(nil, s, script.NewScriptRaw([]byte{opcodes.OP_1}), |
| 538 | 0, 0, script.ScriptVerifyMinmalData, NewScriptRealChecker()) != nil { |
| 539 | t.Errorf("Number %d push is not minimal data.", i) |
| 540 | } |
| 541 | } |
| 542 | for i := 0; i <= script.MaxScriptElementSize; i++ { |
| 543 | s := script.NewEmptyScript() |
| 544 | s.PushSingleData(bytes.Repeat([]byte{'\111'}, i)) |
| 545 | if !s.IsPushOnly() { |
| 546 | t.Errorf("Length %d is not pure push.", i) |
| 547 | } |
| 548 | if VerifyScript(nil, s, script.NewScriptRaw([]byte{opcodes.OP_1}), |
| 549 | 0, 0, script.ScriptVerifyMinmalData, NewScriptRealChecker()) != nil { |
| 550 | t.Errorf("Length %d push is not minimal data.", i) |
| 551 | } |
| 552 | } |
| 553 | } |
| 554 | |
| 555 | func TestIsPushOnlyOnInvalidScripts(t *testing.T) { |
| 556 | s := script.NewEmptyScript() |
nothing calls this directly
no test coverage detected