Remove unnecessary this in sample code + minor changes to contract paragraph

This commit is contained in:
Tommy Lillehagen
2017-10-06 10:29:29 +01:00
parent c176c81a71
commit 045891cc15
3 changed files with 27 additions and 27 deletions

View File

@ -28,7 +28,7 @@ class CommercialPaperTest {
transaction {
attachments(CP_PROGRAM_ID)
input(CP_PROGRAM_ID) { inState }
this.verifies()
verifies()
}
}
}
@ -43,7 +43,7 @@ class CommercialPaperTest {
input(CP_PROGRAM_ID) { inState }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
attachments(CP_PROGRAM_ID)
this.verifies()
verifies()
}
}
}
@ -58,7 +58,7 @@ class CommercialPaperTest {
input(CP_PROGRAM_ID) { inState }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
attachments(CP_PROGRAM_ID)
this `fails with` "the state is propagated"
`fails with`("the state is propagated")
}
}
}
@ -73,9 +73,9 @@ class CommercialPaperTest {
input(CP_PROGRAM_ID) { inState }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
attachments(CP_PROGRAM_ID)
this `fails with` "the state is propagated"
`fails with`("the state is propagated")
output(CP_PROGRAM_ID, "alice's paper") { inState.withOwner(ALICE) }
this.verifies()
verifies()
}
}
}
@ -92,11 +92,11 @@ class CommercialPaperTest {
// The wrong pubkey.
command(BIG_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
timeWindow(TEST_TX_TIME)
this `fails with` "output states are issued by a command signer"
`fails with`("output states are issued by a command signer")
}
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
timeWindow(TEST_TX_TIME)
this.verifies()
verifies()
}
}
}
@ -112,11 +112,11 @@ class CommercialPaperTest {
// The wrong pubkey.
command(BIG_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
timeWindow(TEST_TX_TIME)
this `fails with` "output states are issued by a command signer"
`fails with`("output states are issued by a command signer")
}
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
timeWindow(TEST_TX_TIME)
this.verifies()
verifies()
}
}
// DOCEND 7
@ -138,7 +138,7 @@ class CommercialPaperTest {
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
attachments(CP_PROGRAM_ID)
timeWindow(TEST_TX_TIME)
this.verifies()
verifies()
}
@ -149,7 +149,7 @@ class CommercialPaperTest {
output(CP_PROGRAM_ID, "alice's paper") { "paper".output<ICommercialPaperState>().withOwner(ALICE) }
command(ALICE_PUBKEY) { Cash.Commands.Move() }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
this.verifies()
verifies()
}
}
}
@ -171,7 +171,7 @@ class CommercialPaperTest {
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
attachments(CP_PROGRAM_ID)
timeWindow(TEST_TX_TIME)
this.verifies()
verifies()
}
transaction("Trade") {
@ -181,7 +181,7 @@ class CommercialPaperTest {
output(CP_PROGRAM_ID, "alice's paper") { "paper".output<ICommercialPaperState>().withOwner(ALICE) }
command(ALICE_PUBKEY) { Cash.Commands.Move() }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
this.verifies()
verifies()
}
transaction {
@ -189,10 +189,10 @@ class CommercialPaperTest {
// We moved a paper to another pubkey.
output(CP_PROGRAM_ID, "bob's paper") { "paper".output<ICommercialPaperState>().withOwner(BOB) }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
this.verifies()
verifies()
}
this.fails()
fails()
}
}
// DOCEND 9
@ -213,7 +213,7 @@ class CommercialPaperTest {
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Issue() }
attachments(CP_PROGRAM_ID)
timeWindow(TEST_TX_TIME)
this.verifies()
verifies()
}
transaction("Trade") {
@ -223,7 +223,7 @@ class CommercialPaperTest {
output(CP_PROGRAM_ID, "alice's paper") { "paper".output<ICommercialPaperState>().withOwner(ALICE) }
command(ALICE_PUBKEY) { Cash.Commands.Move() }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
this.verifies()
verifies()
}
tweak {
@ -232,13 +232,13 @@ class CommercialPaperTest {
// We moved a paper to another pubkey.
output(CP_PROGRAM_ID, "bob's paper") { "paper".output<ICommercialPaperState>().withOwner(BOB) }
command(MEGA_CORP_PUBKEY) { CommercialPaper.Commands.Move() }
this.verifies()
verifies()
}
this.fails()
fails()
}
this.verifies()
verifies()
}
}
// DOCEND 10
}
}