X-Git-Url: http://git.osdn.net/view?p=bytom%2Fvapor.git;a=blobdiff_plain;f=protocol%2Fvm%2Fvmutil%2Fscript_test.go;h=623bccf774cde3d183e5f530a4f5dd4e98198c2e;hp=7160c1fb09d267e734ab1042731b4f1e313be1bf;hb=089cb9074ed375e28850d2ff8b5e91164a04046d;hpb=53784d9c76f1056423b57915f7e064a6f551100c diff --git a/protocol/vm/vmutil/script_test.go b/protocol/vm/vmutil/script_test.go index 7160c1fb..623bccf7 100644 --- a/protocol/vm/vmutil/script_test.go +++ b/protocol/vm/vmutil/script_test.go @@ -188,35 +188,3 @@ func TestP2SPMultiSigProgramWithHeight(t *testing.T) { } } } - -func TestGetIssuanceProgramRestrictHeight(t *testing.T) { - tests := []struct { - issuanceProgram string - wantHeight int64 - }{ - { - issuanceProgram: "", - wantHeight: 0, - }, - { - issuanceProgram: "ae20ac20f5cdb9ada2ae9836bcfff32126d6b885aa3f73ee111a95d1bf37f3904aca5151ad", - wantHeight: 0, - }, - { - issuanceProgram: "01c8cda069ae20f44dd85be89de08b0f894476ccc7b3eebcf0a288c79504fa7e4c8033f5b7338020c86dc682ce3ecac64e165d9b5f8cca9ee05bd0d4df07adbfd11251ad7e88f1685152ad", - wantHeight: 200, - }, - } - - for i, test := range tests { - program, err := hex.DecodeString(test.issuanceProgram) - if err != nil { - t.Fatal(err) - } - - gotHeight := GetIssuanceProgramRestrictHeight(program) - if gotHeight != test.wantHeight { - t.Errorf("TestGetIssuanceProgramRestrictHeight #%d failed: got %d want %d", i, gotHeight, test.wantHeight) - } - } -}