diff --git a/docs/build/html/_sources/protocol-state-machines.txt b/docs/build/html/_sources/protocol-state-machines.txt index 69705fe896..3cc0149344 100644 --- a/docs/build/html/_sources/protocol-state-machines.txt +++ b/docs/build/html/_sources/protocol-state-machines.txt @@ -353,7 +353,7 @@ OK, let's do the same for the buyer side: // the state we are being offered! For now, just assume validity! // Generate the shared transaction that both sides will sign, using the data we have. - val ptx = PartialTransaction() + val ptx = TransactionBuilder() // Add input and output states for the movement of cash, by using the Cash contract // to generate the states. val wallet = serviceHub.walletService.currentWallet diff --git a/docs/build/html/_sources/tutorial.txt b/docs/build/html/_sources/tutorial.txt index d649e35247..7b77bc6846 100644 --- a/docs/build/html/_sources/tutorial.txt +++ b/docs/build/html/_sources/tutorial.txt @@ -662,19 +662,19 @@ a method to wrap up the issuance process: .. sourcecode:: kotlin - fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): PartialTransaction { + fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): TransactionBuilder { val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate) - return PartialTransaction(state, WireCommand(Commands.Issue, issuance.party.owningKey)) + return TransactionBuilder(state, WireCommand(Commands.Issue, issuance.party.owningKey)) } We take a reference that points to the issuing party (i.e. the caller) and which can contain any internal bookkeeping/reference numbers that we may require. Then the face value of the paper, and the maturity date. It -returns a ``PartialTransaction``. A ``PartialTransaction`` is one of the few mutable classes the platform provides. +returns a ``TransactionBuilder``. A ``TransactionBuilder`` is one of the few mutable classes the platform provides. It allows you to add inputs, outputs and commands to it and is designed to be passed around, potentially between multiple contracts. .. note:: Crafting methods should ideally be written to compose with each other, that is, they should take a - ``PartialTransaction`` as an argument instead of returning one, unless you are sure it doesn't make sense to + ``TransactionBuilder`` as an argument instead of returning one, unless you are sure it doesn't make sense to combine this type of transaction with others. In this case, issuing CP at the same time as doing other things would just introduce complexity that isn't likely to be worth it, so we return a fresh object each time: instead, an issuer should issue the CP (starting out owned by themselves), and then sell it in a separate transaction. @@ -687,7 +687,7 @@ The returned partial transaction has a ``WireCommand`` object as a parameter. Th that implements the ``Command`` interface, along with a key that is expected to sign this transaction. In this case, issuance requires that the issuing party sign, so we put the key of the party there. -The ``PartialTransaction`` constructor we used above takes a variable argument list for convenience. You can pass in +The ``TransactionBuilder`` constructor we used above takes a variable argument list for convenience. You can pass in any ``ContractStateRef`` (input), ``ContractState`` (output) or ``Command`` objects and it'll build up the transaction for you. @@ -697,13 +697,13 @@ What about moving the paper, i.e. reassigning ownership to someone else? .. sourcecode:: kotlin - fun craftMove(tx: PartialTransaction, paper: StateAndRef, newOwner: PublicKey) { + fun craftMove(tx: TransactionBuilder, paper: StateAndRef, newOwner: PublicKey) { tx.addInputState(paper.ref) tx.addOutputState(paper.state.copy(owner = newOwner)) tx.addArg(WireCommand(Commands.Move, paper.state.owner)) } -Here, the method takes a pre-existing ``PartialTransaction`` and adds to it. This is correct because typically +Here, the method takes a pre-existing ``TransactionBuilder`` and adds to it. This is correct because typically you will want to combine a sale of CP atomically with the movement of some other asset, such as cash. So both craft methods should operate on the same transaction. You can see an example of this being done in the unit tests for the commercial paper contract. @@ -719,7 +719,7 @@ Finally, we can do redemption. .. sourcecode:: kotlin @Throws(InsufficientBalanceException::class) - fun craftRedeem(tx: PartialTransaction, paper: StateAndRef, wallet: List>) { + fun craftRedeem(tx: TransactionBuilder, paper: StateAndRef, wallet: List>) { // Add the cash movement using the states in our wallet. Cash().craftSpend(tx, paper.state.faceValue, paper.state.owner, wallet) tx.addInputState(paper.ref) @@ -740,10 +740,10 @@ an exception is thrown. And then we add the paper itself as an input, but, not a from the ledger permanently). Finally, we add a Redeem command that should be signed by the owner of the commercial paper. -A ``PartialTransaction`` is not by itself ready to be used anywhere, so first, we must convert it to something that +A ``TransactionBuilder`` is not by itself ready to be used anywhere, so first, we must convert it to something that is recognised by the network. The most important next step is for the participating entities to sign it using the ``signWith()`` method. This takes a keypair, serialises the transaction, signs the serialised form and then stores the -signature inside the ``PartialTransaction``. Once all parties have signed, you can call ``PartialTransaction.toSignedTransaction()`` +signature inside the ``TransactionBuilder``. Once all parties have signed, you can call ``TransactionBuilder.toSignedTransaction()`` to get a ``SignedWireTransaction`` object. This is an immutable form of the transaction that's ready for *timestamping*. .. note:: Timestamping and passing around of partial transactions for group signing is not yet fully implemented. diff --git a/docs/build/html/protocol-state-machines.html b/docs/build/html/protocol-state-machines.html index 77df6d618a..7a74d2ea37 100644 --- a/docs/build/html/protocol-state-machines.html +++ b/docs/build/html/protocol-state-machines.html @@ -466,7 +466,7 @@ forms.

// the state we are being offered! For now, just assume validity! // Generate the shared transaction that both sides will sign, using the data we have. - val ptx = PartialTransaction() + val ptx = TransactionBuilder() // Add input and output states for the movement of cash, by using the Cash contract // to generate the states. val wallet = serviceHub.walletService.currentWallet diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 7f6007c84a..619e0c4659 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({envversion:46,filenames:["data-model","getting-set-up","index","inthebox","messaging","protocol-state-machines","roadmap","tutorial","visualiser"],objects:{},objnames:{},objtypes:{},terms:{"0_xx":1,"1mb":5,"8u45":1,"abstract":5,"boolean":7,"break":7,"byte":[0,3,5],"case":[0,4,5,7],"catch":[1,5],"class":[2,4,5],"default":[1,7],"final":[4,5,6,7],"function":[0,2,3,4,5],"import":[0,1,4,7],"instanceof":7,"int":7,"long":[4,5,7],"new":[0,1,2,3,5,7],"null":7,"public":[0,3,4,5,6,7],"return":[4,5,7],"short":[4,7],"static":[5,7],"super":5,"switch":[5,7],"throw":[5,7],"transient":5,"true":[0,4,7,8],"try":[0,5,7,8],"var":7,"void":7,abil:[0,4,7],abl:4,about:0,abov:[4,5,7],accept:[0,4,5,7],acceptablepric:5,access:[4,5],accident:7,accord:5,account:0,achiev:4,across:5,act:4,action:7,actor:[5,7],actual:[4,5,7],adapt:6,add:[4,5,7],addarg:[5,7],addinputst:[5,7],addit:7,addition:5,addmessagehandl:4,addoutputst:[5,7],address:[0,4,7],administr:3,affection:7,after:[0,3,5,7,8],again:[4,7],against:[5,7],agre:[1,5],agreement:0,algorithm:[0,3,7,8],alic:[7,8],aliceaddr:4,alicegetsback:[7,8],alicenod:4,aliv:5,all:[0,1,4,5,6,7],allow:[3,5,6,7],allpossiblerecipi:4,almost:7,along:[3,4,5,7],alreadi:7,alright:5,also:[0,1,4,5,7],alt:7,alter:[5,7],although:[0,4,7],alwai:[0,7],amount:[3,5,6,7],ani:[0,4,5,7],annot:7,anoth:[5,7],anyon:7,anyth:[0,4,5,7],anywher:[4,7],apach:[4,6],api:[2,3,6],appear:7,appendix:2,applic:0,approach:[0,5,6,7],arbitrari:[0,7],arbitrarili:3,area:4,aren:[5,7],arg:[5,7,8],argument:[0,4,5,7],around:[0,4,5,7,8],arrai:[0,3],arrang:5,arriv:5,articl:[0,4,5],artifact:7,ask:7,assembl:0,assert:[5,7],asset:[2,3,5],assetforsal:5,assetmismatchexcept:5,assettosel:5,assettypenam:5,assist:[5,7,8],associ:[0,7],assum:[5,6,7],atom:[5,7],attach:[0,7],attempt:[0,1,2,4,5],attent:5,audit:[0,5,6],authenticatedobject:7,author:[0,4],authoris:5,auto:7,autom:7,automat:[4,5,7],avail:[4,7],avoid:5,awkward:5,back:[5,6,7],backend:[4,6],background:[0,4],backtick:7,bad:[5,7],balanc:7,bankrupt:7,bankruptci:0,base:[0,2,4,5,6],basic:[0,3,4,6,7],bear:[5,7],beauti:8,becaus:[1,4,5,7],becom:7,been:[0,7],befor:[0,3,5,7],begin:[0,5,7],behav:7,behaviour:3,behind:[5,7],below:5,benefit:[5,7],best:6,beta:1,better:[2,3,7,8],between:[5,7],beyond:[0,7],big:[5,7],bill:7,bind:0,bit:[5,7,8],bitbucket:1,bitcoinj:5,blank:7,block:[0,2,4,5,6,7],blockchain:5,blue:8,bob:7,bobaddr:4,bobnod:4,bond:7,bookkeep:[3,7],boost:3,borrow:8,both:[0,3,4,5,7],bound:5,briefli:8,bring:6,broadcast:4,brows:3,bug:3,build:[1,3,5,6,7],builder:7,built:[5,7],bunch:7,bundl:0,busi:[0,3,4,5,7],buyer:2,buyerimpl:5,buyerinitialarg:5,buyersessionid:5,bytearrai:4,bytecod:[0,5,7],calcul:[5,7],calibr:0,call:[0,3,4,5,7],callback:[4,5],caller:7,can:[0,1,3,4,5,6,7,8],cannot:[0,7],canon:6,capabl:[6,7],care:[4,5],carefulli:3,cash:[3,5,7,8],cashkt:7,cashsigningpubkei:5,cashstat:5,caus:7,center:7,certain:[3,7],cev:1,chain:[0,5,7],chanc:5,chang:[4,5,6,7,8],channel:5,chat:5,check:[1,2,3,5],checksufficientsignatur:5,choos:[1,7],circl:8,claim:[0,3,7],classload:5,clean:5,clear:5,clearer:[4,5],click:[1,8],cluster:6,cmd:7,code:[0,1,3,4,5,6,7],codebas:7,collect:7,collector:5,com:[1,5],combin:[2,7],come:[3,5],command:[0,1,2,5],commerci:[2,3,5],commercial_pap:7,commercialpap:[3,7,8],commercialpapertest:[7,8],common:[5,7],commonli:7,commun:1,companion:[5,7],compar:[0,4],compil:7,complet:[0,4,5,7],complex:[0,5,7],complic:5,compos:[6,7],comput:5,concept:[0,7],conceptu:5,concern:[5,7],condit:5,confid:6,configur:1,conflict:[0,2,6],confus:5,connect:7,consensu:6,consid:[0,7],consist:[0,3,5],constant:7,construct:[4,5,7],constructor:7,consum:0,contact:5,contain:[0,5,6,7],content:[1,4,7],continu:5,contract:[0,2],contractst:[7,8],contractstateref:7,contrast:[0,5],contribut:7,control:[0,1,7],conveni:7,convert:7,convinc:5,copi:[5,7],core:[4,6,7],correct:7,correctli:[0,5,7],correspond:7,cost:7,could:[5,7],counter:5,coupl:5,cours:7,cover:[0,5,7],cp_program_id:7,craft:2,craftissu:7,craftmov:7,craftredeem:7,craftspend:[5,7],creat:[0,4,5,7],createmessag:4,creation:[2,7],crisp:7,crop:0,crowdfund:3,currenc:[3,7],current:[0,3,4,5,7,8],currentwallet:5,curv:3,dai:[7,8],dashboard:6,databas:3,date:7,debug:5,decid:7,declar:[4,5,7],defin:[0,3,4,5,7,8],definit:7,delet:7,deliv:4,deliveri:[4,5,7],demonstr:6,denomin:3,depend:[1,5,7],deploy:6,deposit:3,depth:7,deriv:7,describ:[2,5,7],deseri:5,design:[0,2,3,7],desir:[5,7],despit:[5,7],destin:4,destroi:[0,7],destroypaperatredempt:[7,8],detail:[0,4,5,7],develop:[0,3,4,5],diagram:8,diamond:8,didn:7,differ:[0,5,7],difficult:[4,5],digit:[0,5,7],direct:7,directori:[1,7],dirti:7,disallow:7,discuss:4,disk:5,disprov:[2,6],disput:7,distinguish:7,distribut:[0,3,5,6],distrust:5,doc:7,document:[0,2,3,7],doe:[0,3,4,5,7],doesn:[0,4,5,7],dollar:[7,8],domain:[7,8],don:[0,1,3,4,5,7],done:[0,5,7],doubl:[5,6,7],doubt:3,down:7,download:[1,6],drag:8,drive:0,dsl:[6,7,8],due:[3,5,7],dummi:7,dummy_pubkey_1:7,duplic:7,durat:7,dynam:7,each:[0,3,4,5,7],earli:[7,8],eas:4,easi:7,easier:[5,7],easili:5,edit:1,editor:1,effect:7,either:[5,7],element:0,ellipt:3,els:7,emb:7,embed:0,emit:7,empti:[5,7],enabl:7,encapsul:5,encount:3,end:[3,5,7],enforc:[6,7],engin:7,english:7,enorm:5,enough:[4,5,6,7],ensur:[0,4,5,7],enter:7,entir:[0,4,7],entiti:[0,5,7],entri:[0,7],envisag:7,equal:7,equival:7,error:5,especi:8,essenti:7,etc:7,even:[3,4,5,6,7],event:[0,6],everi:[0,5,7],everyth:[4,7],evolv:7,exact:7,exactli:[0,4,7],examin:[0,7],exampl:[0,4,5,6,7,8],except:7,exchang:[5,7],execut:[0,7],executor:4,exercis:7,exist:[0,2,7],expect:[3,4,5,7],expectfailureoftx:7,experi:6,experiment:[5,6],explain:[4,5,7],explicit:5,explicitli:[0,7],explor:[1,2,3,6,7],exploratori:4,expos:[4,5],express:[0,3,5,6,7],extend:[3,7],extens:7,extern:3,extract:[0,7],extrem:7,face:[3,7,8],facevalu:7,fact:[0,5,7],factor:0,fail:[4,7],failur:[5,7],fairli:5,fake:7,fals:[4,5,7],familiar:[0,7],far:[5,7],fast:4,favour:7,featur:[7,8],feel:7,few:[3,4,5,7],field:[5,7,8],file:[4,5,7],fill:[5,7],filterisinst:7,finalis:5,financ:5,financi:[0,2,5],find:[0,5],finish:[4,5],firm:7,first:[1,2,5,6,7],firstli:[5,7],fit:0,fix:[0,4,5,6],flesh:6,flexibl:0,flow:7,follow:[1,2,4,5,7,8],foo:4,fooutil:7,forget:7,form:[5,7],formal:7,format:0,forth:5,found:[1,5],four:7,frame:5,framework:[3,5,8],free:[0,5,6],freeform:7,frequent:5,fresh:7,freshkei:5,freshli:7,from:[0,1,3,4,5,7,8],front:7,full:[5,7],fulli:[4,5,7],fullysign:5,fun:[5,7],fundament:[2,7],fungibl:[2,3],funni:5,futur:[0,2,5,6,7,8],gain:3,game:5,garbag:5,gather:7,gcd:0,gener:[5,7],get:0,getclass:7,getcommand:7,getfacevalu:7,getinput:7,getissu:7,getlegalcontractrefer:7,getmaturityd:7,getoutput:7,getown:7,getprogramref:7,getsign:7,getter:7,gettim:7,getvalu:7,git:1,give:[0,6,7],given:[0,4,7],global:[0,7],glue:5,goal:[2,3,5],gone:7,good:[5,6,7,8],got:5,gradl:[1,3],gradlew:1,graph:[0,7,8],green:1,group:[0,4,7,8],groupstat:7,guava:3,hack:0,had:7,hand:[5,7],handl:[0,4,5,6,7],handler:[4,5],happen:[5,7],happi:5,hard:5,hash:[0,3,7],hashcod:7,hassl:5,have:[0,3,4,5,6,7],haven:7,heap:5,heart:7,heavili:0,held:7,hell:5,hello:5,help:4,helper:[4,7],her:[7,8],here:[3,4,5,7,8],high:5,higher:[1,7],highlight:7,hit:1,hold:[0,4],holder:7,home:1,hotspot:6,how:[0,2,3,4,5,6],howev:[5,7],http:[1,7],hub:5,hundr:5,hypothesi:2,idea:[0,1,3,5,7],ideal:[5,7],ident:[0,5,7],identifi:[0,3,4,5],identityless:0,identityservic:5,ignor:7,illegalargumentexcept:7,illegalstateexcept:7,imagin:[5,7],immedi:7,immut:[0,7],impl:5,implement:[0,2,3],impli:5,implicitli:7,impos:[5,7],improv:[0,6,7,8],inbackground:4,includ:[0,2],incorrect:5,increas:4,independ:7,index:[0,7],indic:[5,7],individu:[4,7],industri:[2,3],infer:7,infix:7,info:5,inform:[0,7],infrastructur:0,inherit:[4,5,7],initi:[4,5,7],inmemorymessagingtest:4,inoutgroup:7,input:[0,5,7,8],insert:4,insid:[0,4,5,7],instal:1,instanc:[0,5,7],instant:7,instanti:[0,5],instead:[0,3,7],institut:3,institutionrefer:7,instruct:7,insufficientbalanceexcept:7,integ:7,integr:[3,8],intend:[0,3,5],intent:[7,8],interact:[0,5],interest:[5,7,8],interfac:[2,3],interfer:5,intern:[3,6,7],interop:[3,7],interpret:[0,7],intersect:7,introduc:[6,7],introduct:[2,3],invalid:[5,7],invari:7,invoc:4,invok:[0,4,5,7],involv:[4,5,7],isaft:7,isempti:7,isinst:5,isn:[5,7],issu:[3,6,7,8],issuanc:[7,8],issuer:7,item:[1,7],iter:[5,7],itself:[0,4,7],java:[3,4,5,7],javaclass:5,javacommercialpap:7,javaflow:5,jdk1:1,jdk:[1,7],jetbrain:[1,3],jira:[3,6],jmx:6,join:7,joint:7,junit:[3,7],just:[0,1,4,5,7],justifi:2,jvm:[0,3,5,6],jvmstatic:5,kafka:[4,6],keep:[0,5,7,8],kei:[0,3,4,5,6,7],kept:5,key_mismatch_at_issu:7,keymanagementservic:5,keypair:[5,7],keyword:7,kick:5,kill:6,kind:[0,3,4,7],know:[3,5],known:0,kotin:7,kotlin:[1,2],kryo:[3,4,5],label:[7,8],labori:7,languag:[0,1,2,3,7,8],larg:5,later:[3,4,5,6,7],latest:1,latter:7,layer:[5,6],layout:8,lazi:6,lazili:7,lead:7,learn:[2,6],least:7,leav:5,ledger:[0,2,5,7,8],ledgertransact:5,left:[4,5],legal:[0,7],legalcontractrefer:7,less:[5,7,8],let:[0,5,7],level:[1,4,7],librari:[3,5,7],lifecycl:[5,7,8],like:[0,1,4,5,6,7],likewis:7,limit:[0,2,6,7],line:[1,5,7],link:[0,7],list:[0,4,7],liter:0,littl:7,load:7,local:[0,1,5],locat:7,lock:7,log:[5,6],logger:5,logic:[0,3,4,5,6,7],logo:1,look:[5,7],loop:7,lose:6,low:5,ltx:5,lurch:5,machin:[0,2,4],made:2,mai:[0,3,4,5,6,7],main:[5,7,8],maintain:0,make:[4,5,6,7],makenod:4,maker:3,malici:5,manag:2,mani:[0,3,4,5,7],manual:4,map:7,mappabl:7,mark:[5,7],marker:7,market:2,match:[0,4,7],matur:7,maturityd:7,maximis:0,mean:[0,4],measur:[6,7],mechan:7,meet:7,mega_corp:7,mega_corp_kei:7,mega_corp_pubkei:8,megacorp:[7,8],member:5,memori:2,menu:1,mere:7,merg:[3,7],mess:5,messag:[0,2],messagehandlerregistr:4,messagerecipi:4,messagerecipientgroup:4,messagingservic:[4,5],method:[4,5,7,8],middl:[4,5],might:[5,7],mileston:6,mind:[5,7],mine:0,minim:5,minimum:[0,6],minu:7,minut:3,misc:4,miss:[5,7],mix:[5,6,7],mock:[4,6],mode:4,modif:[6,7],modifi:[1,7],modul:[4,7],moment:4,monei:7,monetari:7,monitor:6,month:5,more:[0,3,4,7],most:[4,5,7],mostli:7,move:[5,7,8],movement:[5,7],much:[0,3,5,7],multi:[5,6,7],multipl:[0,4,7],must:[0,5,7],mutabl:[0,7],mutual:5,mykeypair:5,name:[4,5,7],nativ:5,natur:7,naval:0,necessari:6,necessarili:[6,7],need:[0,2,4,5,7],neither:[5,7],nest:5,net:[7,8],network:[2,3],neutral:3,never:7,newown:7,next:[1,5,6,7],node:[0,4,5,6,8],non:[0,2],normal:[5,7],not_matured_at_redempt:7,note:[0,1,5,7],noth:[0,7],notic:7,notion:[0,3,7],notnul:7,now:[1,4,5,7,8],nugget:7,nullpublickei:7,number:7,obj:7,object:[0,4,5,7,8],observ:6,observatori:0,obsolet:3,obtain:8,obvious:7,occur:[5,7],odd:[5,7],off:[4,5,7,8],offer:5,often:[0,5,7],onc:[3,4,5,7],onli:[0,3,4,5,7,8],onto:[7,8],opaqu:[3,4],opaquebyt:7,open:[1,5,8],openjdk:1,oper:[4,7],opposit:7,option:[4,7],oracl:[0,1],order:[3,7,8],ordinari:[0,3,5,7],org:[1,7],orient:2,origin:7,other:[0,3,4,5,6,7],othersid:5,otherwis:7,our:[0,5,6,7],ourselv:[5,7],oursignatur:5,out:[0,1,5,6,7],outcom:5,outlin:5,outpoint:0,output:[0,5,7,8],outputst:5,outsid:[0,4,5,7],outstat:7,over:[4,5,7],overrid:[5,7],overview:2,own:[4,5,7,8],ownablest:5,owned_bi:7,owner:[5,6,7],ownership:[5,7],owningkei:7,p2p:6,packag:6,packet:0,page:[6,7],pai:[5,7,8],pair:[0,5],paper:[2,3,5],paper_1:[7,8],parallel:[4,7],paramet:[5,7],parameteris:0,part:[0,5,6,7],parti:[2,3],partial:[5,7],partialtransact:[5,7],partialtx:5,particip:[0,7],particular:5,partner:5,pass:[4,5,7,8],past:7,path:7,pattern:[0,7],payment:[5,7,8],peer:[3,4],pend:6,penni:7,peopl:[0,3,7],perform:[5,7],perhap:7,perman:[3,7],persist:[3,4,5],perspect:[5,7],pick:5,piec:[0,4,5,7],ping:4,pki:0,place:[0,3,6,7],plai:5,platform:[0,2,3,4,5,7],pleas:[0,7],pluggabl:6,plugin:1,point:[0,5,7],pointer:5,pong:4,pool:[5,6],poor:0,pop:[1,4],popular:3,posess:5,possibl:[0,2,4,5,7],potenti:[3,7],pound:7,power:[0,2],practic:[0,7],pre:[0,5,7],preced:7,preliminari:4,prepar:7,presenc:6,present:[2,6,7],press:7,pretti:[5,7],prevent:7,price:[0,5],primari:3,primit:7,priv:5,privaci:[0,7],privat:[0,5,7],probabl:[1,7],problem:[5,7],proce:5,process:[4,7],produc:[5,7,8],product:[2,3,7],profit:[7,8],program:[0,3,4,7],programref:7,progress:5,project:1,proof:[0,2],propag:[2,7],properti:7,protect:5,protocol:[0,2,3,4],protocolstatemachin:5,prototyp:0,prove:[0,2,6,7],provid:[0,4,5,7],ptx:5,publickei:[5,7],pull:1,pump:4,purchas:5,pure:0,purpos:[3,7],put:[5,7],qualiti:2,quantiti:[0,3,7],queue:4,quickli:[4,7],quit:[5,7],r3cev:5,r3repositori:1,random63bitvalu:5,random:[0,5],rapid:3,rather:[0,5,7],rational:0,reachabl:5,read:[2,3,5,7],readabl:3,reader:7,readi:7,real:[3,4,7],realism:4,realiti:7,realli:[5,7],reason:[5,7],reassign:7,receiv:[0,4,5,7,8],recipi:[4,7],recognis:[0,7],record:[6,7],recreat:5,red:1,redeem:[3,7,8],redempt:[7,8],redemptiontim:[7,8],ref:[5,7],refer:[0,3,5,7],refin:3,reflect:7,refus:1,regist:[4,5],registr:4,regular:[3,5,7],reissuanc:7,reject:7,rel:0,relat:[5,7],relationship:7,releas:8,relev:0,reli:0,reliabl:4,relianc:0,remain:[7,8],rememb:[5,7],remov:[4,7],render:8,repeat:4,replac:7,replic:0,report:[4,6],repres:[0,4,5,7],request:5,requir:[2,3,4,5,6],requiresinglecommand:7,requirethat:[5,7],resolut:[0,2,6],resolv:[5,6],resourc:5,respect:7,respons:5,rest:[0,4],restart:[1,5],restor:5,result:[0,5,7],resultfutur:5,resum:5,resurrect:5,retri:4,reus:5,reveal:7,rewrit:5,right:[1,4,5],rigid:0,risk:5,roadmap:2,roll:6,rollov:7,room:5,root:[7,8],rout:[5,6],router:4,rule:[5,7],run:[0,1,4,5,7],runawai:6,runbuy:5,runnetwork:4,runsel:5,runtim:6,safe:[0,5,6,7],sai:7,sale:7,same:[0,3,4,5,7,8],sandbox:[0,3,6,7],saniti:5,satisfi:[5,7],save:7,scala:[3,7],scalabl:[0,7],scene:[5,7],scope:[0,7],screen:1,script:[0,7],seamless:3,search:[1,7],second:[5,7],secondari:5,secp256r1:3,section:7,secur:[0,4,5],securehash:7,see:[4,5,6,7],seen:[6,7,8],select:[1,7],sell:[5,7],seller:2,sellerimpl:5,sellerinitialarg:5,sellerownerkei:5,sellertradeinfo:5,semi:0,send:[0,4,5,7],sendandrec:5,sens:[5,7],sent:[4,5,7],separ:[5,6,7],sequenc:4,sequenti:5,serial:[3,7],serialis:[3,4,5,7],serializablewithkryo:7,serializeablewithkryo:7,server:6,servic:[4,5],servicehub:5,session:[4,5],sessionid:5,set:0,setter:7,settl:4,settlement:5,sever:[0,5,7],sha256:7,sha:0,share:[0,2,5,7],she:7,shortcut:3,shorthand:7,shot:4,should:[0,1,3,4,5,6,7],shouldn:5,show:[0,1,3,7,8],shown:7,shutdown:5,side:5,sig:[5,7],sign:[0,3,5,7],signatur:[0,3,5,6,7],signedwiretransact:[5,7],signer:7,signwith:[5,7],signwithecdsa:5,similar:[0,7],similarli:7,simpl:[4,5,7,8],simpler:3,simplest:5,simpli:[4,5,7],simplifi:[0,3,4,7],simultan:[4,5,7],singl:[0,5,7,8],singlemessagerecipi:[4,5],singleton:7,sit:4,site:6,size:[5,7],skeleton:5,slight:7,slightli:7,small:[0,3,5,7,8],smart:[2,3],smm:5,smooth:7,snippet:7,softwar:3,sold:[5,7,8],solv:[5,7],some:[0,3,4,5,6,7,8],somed:7,someon:[4,7],someprofit:[7,8],someth:[1,5,7],sometim:[0,4,7],somewhat:0,somewher:[7,8],sort:5,sound:[5,7,8],sourc:5,space:7,special:0,specif:[0,4,5,7,8],specifi:[3,4,7],speed:5,spend:[0,5,6,7],split:[3,7],spread:[4,5],squar:8,src:[7,8],stack:5,stage:[5,6,7],stai:0,standard:[2,3,7],standardis:[0,7],start:[0,2,5],state:[0,2,3,4],stateandref:[5,7],stateless:0,statemachinemanag:5,statement:[5,7],stateref:[0,5],statesoftyp:5,status:0,step:[5,6,7],still:[0,7],stock:0,stop:[4,5,6],storag:[0,6],store:[5,7],straightforward:[5,7],stream:5,string:[4,5,7],strong:3,structur:[0,1,3,5,7],studi:7,stuff:5,stx:5,style:4,subgraph:6,subgroup:0,submenu:1,successor:3,suffici:[2,4],suffix:7,suggest:7,suitabl:6,sum:7,sumcashbi:[5,7],sumcashornul:7,summaris:0,superclass:5,supertyp:7,support:[3,5,6,7],suppos:[5,7],sure:[5,7],surround:7,surviv:5,suspend:5,swap:5,symbol:1,synchronis:0,syntax:[3,7],system:[0,3,5,6,7],tab:1,tailor:2,take:[3,5,7,8],target:[0,3],targetrecipi:4,task:[0,5,6],techniqu:7,tell:4,tempor:6,temporarili:5,tempt:7,temptat:5,ten:7,term:[0,7],termin:5,terminolog:0,test:[1,2,3,4,5,6],test_tx_tim:7,testutil:7,testwithinmemorynetwork:4,text:1,than:[0,2,5,7,8],thei:[0,3,4,5,6,7],them:[3,4,5,7],themselv:[4,7],theori:2,therefor:[3,7],thesi:6,thi:[0,1,2,3,4,5,6,7,8],thing:[0,3,5,6,7],think:[1,5,7],third:[5,7],those:[4,7],though:[4,5,7],thought:[0,3],thread:[4,5,6],three:[3,7],threshold:7,through:[0,5,6,7],thrown:7,thu:7,tighten:7,tightli:5,time:[0,3,5,6,7,8],timelin:7,timestamp:[0,5,7],timestampedwiretransact:5,timestampingservic:5,todo:[5,7],togeth:[0,7],too:[5,7,8],took:5,tool:3,top:[5,7],topic:[4,5],topriv:5,tosignedtransact:[5,7],tostr:7,total:7,totimestampedtransact:5,trace:5,track:5,tracker:3,trade:[2,3],trade_top:5,traderequest:5,tradit:7,traffic:5,transact:[0,2,5,6,7,8],transactionforverif:7,transactiongroup:[5,7],transactiongroupdsl:8,transactiongroupfor:8,transactiongroupfortest:7,transfer:7,transit:[2,7],treat:7,tri:7,trick:5,tricki:5,truth:5,tsa:0,ture:0,turn:[5,7],tutori:[2,3,5,7],twice:3,two:[2,3,4],twopartytradeprotocol:5,twopartytradeprotocolimpl:5,txbit:5,txhash:[0,7],type:[0,5,7],typetobui:5,typic:[4,5,7],unacceptablepriceexcept:5,under:7,underscor:7,understand:[2,4],unexecut:7,unfinsish:5,unfortun:[5,7],unguess:5,uniqu:0,unit:[1,3,4,5,7,8],unless:[5,7],unlik:7,unnecessari:7,unpack:5,unread:5,unrecognis:7,unsaf:6,unserialis:5,unspent:0,unsupportedoperationexcept:7,until:[4,5],unus:4,unusu:7,unwieldi:7,updat:[0,1,5,7],upgrad:[1,2,6],upload:6,upon:7,url:1,usabl:3,usag:7,user:[0,3,4,5],util:[3,4,7],utxo:0,val:[4,5,7,8],valid:[0,5,6,7],valu:[3,7,8],vari:7,variabl:[5,7],variant:7,variou:[0,3,5,7],vendor:3,verbos:7,veri:[0,3,8],verif:[0,3],verifi:[0,2,3,5,6],verifysignatur:5,verifytoledgertransact:5,versa:5,version:[1,3,5,7],versu:5,via:[0,5],vice:5,virtual:[0,2],visibl:0,visualis:2,vote:6,wai:[0,3,5,6,7],wait:[1,4,5],wallet:[0,5,7],walletservic:5,wan:6,want:[1,4,5,7],websit:7,well:[0,3,5,7],were:[5,7],what:[0,2],whatev:5,when:[4,5,6,7],where:[0,4,5],wherea:7,whether:4,which:[0,3,4,5,7],whilst:[0,5,7],who:[3,4,5,7],whole:7,why:[0,3,5,7],wide:[4,7],wiki:[0,7],wikipedia:7,window:[0,8],wire:5,wirecommand:[5,7],wiretransact:5,wish:[4,5,6,7],within:0,withnewown:5,withoutown:7,won:[4,7],work:[0,1,2,3,4,5,7],world:[0,5,7],worn:7,worri:[3,5],worth:7,would:[3,4,5,7],wouldn:7,wrap:7,wrapper:5,write:[2,3,5],written:[0,3,7],wtx:5,www:1,yet:[0,7],yield:0,you:[0,1,3,4,5,7,8],your:[2,4,5],your_usernam:1,zero:7},titles:["Data model","Getting set up","Welcome to the R3 prototyping repository!","What’s included?","Networking and messaging","Protocol state machines","Roadmap","Writing a contract","Using the visualiser"],titleterms:{"class":7,"function":7,about:1,api:7,asset:7,base:7,bitcoin:0,buyer:5,check:7,command:7,commerci:7,comparison:0,complain:1,contract:[3,7],craft:7,data:0,descript:0,ethereum:0,fungibl:7,get:1,how:7,implement:[4,5],includ:3,intellij:1,interfac:4,introduct:5,kotlin:3,lack:1,machin:5,manag:5,memori:4,messag:4,model:0,network:4,non:7,orient:7,paper:7,parti:5,protocol:5,prototyp:2,repositori:2,requir:7,roadmap:6,sdk:1,seller:5,set:1,smart:7,start:7,state:[5,7],test:7,theori:5,trade:5,two:5,understand:7,verifi:7,visualis:8,welcom:2,what:3,without:1,write:7,your:7}}) \ No newline at end of file +Search.setIndex({envversion:46,filenames:["data-model","getting-set-up","index","inthebox","messaging","protocol-state-machines","roadmap","tutorial","visualiser"],objects:{},objnames:{},objtypes:{},terms:{"0_xx":1,"1mb":5,"8u45":1,"abstract":5,"boolean":7,"break":7,"byte":[0,3,5],"case":[0,4,5,7],"catch":[1,5],"class":4,"default":[1,7],"final":[4,5,6,7],"function":4,"import":[0,1,4,7],"instanceof":7,"int":7,"long":[4,5,7],"new":[0,1,2,3,5,7],"null":7,"public":[0,3,4,5,6,7],"return":[4,5,7],"short":[4,7],"static":[5,7],"super":5,"switch":[5,7],"throw":[5,7],"transient":5,"true":[0,4,7,8],"try":[0,5,7,8],"var":7,"void":7,abil:[0,4,7],abl:4,about:[],abov:[4,5,7],accept:[0,4,5,7],acceptablepric:5,access:[4,5],accident:7,accord:5,account:0,achiev:4,across:5,act:4,action:7,actor:[5,7],actual:[4,5,7],adapt:6,add:[4,5,7],addarg:[5,7],addinputst:[5,7],addit:7,addition:5,addmessagehandl:4,addoutputst:[5,7],address:[0,4,7],administr:3,affection:7,after:[0,3,5,7,8],again:[4,7],against:[5,7],agre:[1,5],agreement:0,algorithm:[0,3,7,8],alic:[7,8],aliceaddr:4,alicegetsback:[7,8],alicenod:4,aliv:5,all:[0,1,4,5,6,7],allow:[3,5,6,7],allpossiblerecipi:4,almost:7,along:[3,4,5,7],alreadi:7,alright:5,also:[0,1,4,5,7],alt:7,alter:[5,7],although:[0,4,7],alwai:[0,7],amount:[3,5,6,7],ani:[0,4,5,7],annot:7,anoth:[5,7],anyon:7,anyth:[0,4,5,7],anywher:[4,7],apach:[4,6],api:6,appear:7,appendix:2,applic:0,approach:[0,5,6,7],arbitrari:[0,7],arbitrarili:3,area:4,aren:[5,7],arg:[5,7,8],argument:[0,4,5,7],around:[0,4,5,7,8],arrai:[0,3],arrang:5,arriv:5,articl:[0,4,5],artifact:7,ask:7,assembl:0,assert:[5,7],asset:[],assetforsal:5,assetmismatchexcept:5,assettosel:5,assettypenam:5,assist:[5,7,8],associ:[0,7],assum:[5,6,7],atom:[5,7],attach:[0,7],attempt:[0,1,2,4,5],attent:5,audit:[0,5,6],authenticatedobject:7,author:[0,4],authoris:5,auto:7,autom:7,automat:[4,5,7],avail:[4,7],avoid:5,awkward:5,back:[5,6,7],backend:[4,6],background:[0,4],backtick:7,bad:[5,7],balanc:7,bankrupt:7,bankruptci:0,base:[4,6],basic:[0,3,4,6,7],bear:[5,7],beauti:8,becaus:[1,4,5,7],becom:7,been:[0,7],befor:[0,3,5,7],begin:[0,5,7],behav:7,behaviour:3,behind:[5,7],below:5,benefit:[5,7],best:6,beta:1,better:[2,3,7,8],between:[5,7],beyond:[0,7],big:[5,7],bill:7,bind:0,bit:[5,7,8],bitbucket:1,bitcoinj:5,blank:7,block:[0,2,4,5,6,7],blockchain:5,blue:8,bob:7,bobaddr:4,bobnod:4,bond:7,bookkeep:[3,7],boost:3,borrow:8,both:[0,3,4,5,7],bound:5,briefli:8,bring:6,broadcast:4,brows:3,bug:3,build:[1,3,5,6,7],builder:7,built:[5,7],bunch:7,bundl:0,busi:[0,3,4,5,7],buyer:[],buyerimpl:5,buyerinitialarg:5,buyersessionid:5,bytearrai:4,bytecod:[0,5,7],calcul:[5,7],calibr:0,call:[0,3,4,5,7],callback:[4,5],caller:7,can:[0,1,3,4,5,6,7,8],cannot:[0,7],canon:6,capabl:[6,7],care:[4,5],carefulli:3,cash:[3,5,7,8],cashkt:7,cashsigningpubkei:5,cashstat:5,caus:7,center:7,certain:[3,7],cev:1,chain:[0,5,7],chanc:5,chang:[4,5,6,7,8],channel:5,chat:5,check:[],checksufficientsignatur:5,choos:[1,7],circl:8,claim:[0,3,7],classload:5,clean:5,clear:5,clearer:[4,5],click:[1,8],cluster:6,cmd:7,code:[0,1,3,4,5,6,7],codebas:7,collect:7,collector:5,com:[1,5],combin:[2,7],come:[3,5],command:[],commerci:[],commercial_pap:7,commercialpap:[3,7,8],commercialpapertest:[7,8],common:[5,7],commonli:7,commun:1,companion:[5,7],compar:[0,4],compil:7,complet:[0,4,5,7],complex:[0,5,7],complic:5,compos:[6,7],comput:5,concept:[0,7],conceptu:5,concern:[5,7],condit:5,confid:6,configur:1,conflict:[0,2,6],confus:5,connect:7,consensu:6,consid:[0,7],consist:[0,3,5],constant:7,construct:[4,5,7],constructor:7,consum:0,contact:5,contain:[0,5,6,7],content:[1,4,7],continu:5,contract:[],contractst:[7,8],contractstateref:7,contrast:[0,5],contribut:7,control:[0,1,7],conveni:7,convert:7,convinc:5,copi:[5,7],core:[4,6,7],correct:7,correctli:[0,5,7],correspond:7,cost:7,could:[5,7],counter:5,coupl:5,cours:7,cover:[0,5,7],cp_program_id:7,craft:[],craftissu:7,craftmov:7,craftredeem:7,craftspend:[5,7],creat:[0,4,5,7],createmessag:4,creation:[2,7],crisp:7,crop:0,crowdfund:3,currenc:[3,7],current:[0,3,4,5,7,8],currentwallet:5,curv:3,dai:[7,8],dashboard:6,databas:3,date:7,debug:5,decid:7,declar:[4,5,7],defin:[0,3,4,5,7,8],definit:7,delet:7,deliv:4,deliveri:[4,5,7],demonstr:6,denomin:3,depend:[1,5,7],deploy:6,deposit:3,depth:7,deriv:7,describ:[2,5,7],deseri:5,design:[0,2,3,7],desir:[5,7],despit:[5,7],destin:4,destroi:[0,7],destroypaperatredempt:[7,8],detail:[0,4,5,7],develop:[0,3,4,5],diagram:8,diamond:8,didn:7,differ:[0,5,7],difficult:[4,5],digit:[0,5,7],direct:7,directori:[1,7],dirti:7,disallow:7,discuss:4,disk:5,disprov:[2,6],disput:7,distinguish:7,distribut:[0,3,5,6],distrust:5,doc:7,document:[0,2,3,7],doe:[0,3,4,5,7],doesn:[0,4,5,7],dollar:[7,8],domain:[7,8],don:[0,1,3,4,5,7],done:[0,5,7],doubl:[5,6,7],doubt:3,down:7,download:[1,6],drag:8,drive:0,dsl:[6,7,8],due:[3,5,7],dummi:7,dummy_pubkey_1:7,duplic:7,durat:7,dynam:7,each:[0,3,4,5,7],earli:[7,8],eas:4,easi:7,easier:[5,7],easili:5,edit:1,editor:1,effect:7,either:[5,7],element:0,ellipt:3,els:7,emb:7,embed:0,emit:7,empti:[5,7],enabl:7,encapsul:5,encount:3,end:[3,5,7],enforc:[6,7],engin:7,english:7,enorm:5,enough:[4,5,6,7],ensur:[0,4,5,7],enter:7,entir:[0,4,7],entiti:[0,5,7],entri:[0,7],envisag:7,equal:7,equival:7,error:5,especi:8,essenti:7,etc:7,even:[3,4,5,6,7],event:[0,6],everi:[0,5,7],everyth:[4,7],evolv:7,exact:7,exactli:[0,4,7],examin:[0,7],exampl:[0,4,5,6,7,8],except:7,exchang:[5,7],execut:[0,7],executor:4,exercis:7,exist:[0,2,7],expect:[3,4,5,7],expectfailureoftx:7,experi:6,experiment:[5,6],explain:[4,5,7],explicit:5,explicitli:[0,7],explor:[1,2,3,6,7],exploratori:4,expos:[4,5],express:[0,3,5,6,7],extend:[3,7],extens:7,extern:3,extract:[0,7],extrem:7,face:[3,7,8],facevalu:7,fact:[0,5,7],factor:0,fail:[4,7],failur:[5,7],fairli:5,fake:7,fals:[4,5,7],familiar:[0,7],far:[5,7],fast:4,favour:7,featur:[7,8],feel:7,few:[3,4,5,7],field:[5,7,8],file:[4,5,7],fill:[5,7],filterisinst:7,finalis:5,financ:5,financi:[0,2,5],find:[0,5],finish:[4,5],firm:7,first:[1,2,5,6,7],firstli:[5,7],fit:0,fix:[0,4,5,6],flesh:6,flexibl:0,flow:7,follow:[1,2,4,5,7,8],foo:4,fooutil:7,forget:7,form:[5,7],formal:7,format:0,forth:5,found:[1,5],four:7,frame:5,framework:[3,5,8],free:[0,5,6],freeform:7,frequent:5,fresh:7,freshkei:5,freshli:7,from:[0,1,3,4,5,7,8],front:7,full:[5,7],fulli:[4,5,7],fullysign:5,fun:[5,7],fundament:[2,7],fungibl:[],funni:5,futur:[0,2,5,6,7,8],gain:3,game:5,garbag:5,gather:7,gcd:0,gener:[5,7],get:[],getclass:7,getcommand:7,getfacevalu:7,getinput:7,getissu:7,getlegalcontractrefer:7,getmaturityd:7,getoutput:7,getown:7,getprogramref:7,getsign:7,getter:7,gettim:7,getvalu:7,git:1,give:[0,6,7],given:[0,4,7],global:[0,7],glue:5,goal:[2,3,5],gone:7,good:[5,6,7,8],got:5,gradl:[1,3],gradlew:1,graph:[0,7,8],green:1,group:[0,4,7,8],groupstat:7,guava:3,hack:0,had:7,hand:[5,7],handl:[0,4,5,6,7],handler:[4,5],happen:[5,7],happi:5,hard:5,hash:[0,3,7],hashcod:7,hassl:5,have:[0,3,4,5,6,7],haven:7,heap:5,heart:7,heavili:0,held:7,hell:5,hello:5,help:4,helper:[4,7],her:[7,8],here:[3,4,5,7,8],high:5,higher:[1,7],highlight:7,hit:1,hold:[0,4],holder:7,home:1,hotspot:6,how:[4,6],howev:[5,7],http:[1,7],hub:5,hundr:5,hypothesi:2,idea:[0,1,3,5,7],ideal:[5,7],ident:[0,5,7],identifi:[0,3,4,5],identityless:0,identityservic:5,ignor:7,illegalargumentexcept:7,illegalstateexcept:7,imagin:[5,7],immedi:7,immut:[0,7],impl:5,implement:[],impli:5,implicitli:7,impos:[5,7],improv:[0,6,7,8],inbackground:4,includ:[],incorrect:5,increas:4,independ:7,index:[0,7],indic:[5,7],individu:[4,7],industri:[2,3],infer:7,infix:7,info:5,inform:[0,7],infrastructur:0,inherit:[4,5,7],initi:[4,5,7],inmemorymessagingtest:4,inoutgroup:7,input:[0,5,7,8],insert:4,insid:[0,4,5,7],instal:1,instanc:[0,5,7],instant:7,instanti:[0,5],instead:[0,3,7],institut:3,institutionrefer:7,instruct:7,insufficientbalanceexcept:7,integ:7,integr:[3,8],intend:[0,3,5],intent:[7,8],interact:[0,5],interest:[5,7,8],interfac:[],interfer:5,intern:[3,6,7],interop:[3,7],interpret:[0,7],intersect:7,introduc:[6,7],introduct:[],invalid:[5,7],invari:7,invoc:4,invok:[0,4,5,7],involv:[4,5,7],isaft:7,isempti:7,isinst:5,isn:[5,7],issu:[3,6,7,8],issuanc:[7,8],issuer:7,item:[1,7],iter:[5,7],itself:[0,4,7],java:[3,4,5,7],javaclass:5,javacommercialpap:7,javaflow:5,jdk1:1,jdk:[1,7],jetbrain:[1,3],jira:[3,6],jmx:6,join:7,joint:7,junit:[3,7],just:[0,1,4,5,7],justifi:2,jvm:[0,3,5,6],jvmstatic:5,kafka:[4,6],keep:[0,5,7,8],kei:[0,3,4,5,6,7],kept:5,key_mismatch_at_issu:7,keymanagementservic:5,keypair:[5,7],keyword:7,kick:5,kill:6,kind:[0,3,4,7],know:[3,5],known:0,kotin:7,kotlin:[],kryo:[3,4,5],label:[7,8],labori:7,languag:[0,1,2,3,7,8],larg:5,later:[3,4,5,6,7],latest:1,latter:7,layer:[5,6],layout:8,lazi:6,lazili:7,lead:7,learn:[2,6],least:7,leav:5,ledger:[0,2,5,7,8],ledgertransact:5,left:[4,5],legal:[0,7],legalcontractrefer:7,less:[5,7,8],let:[0,5,7],level:[1,4,7],librari:[3,5,7],lifecycl:[5,7,8],like:[0,1,4,5,6,7],likewis:7,limit:[0,2,6,7],line:[1,5,7],link:[0,7],list:[0,4,7],liter:0,littl:7,load:7,local:[0,1,5],locat:7,lock:7,log:[5,6],logger:5,logic:[0,3,4,5,6,7],logo:1,look:[5,7],loop:7,lose:6,low:5,ltx:5,lurch:5,machin:4,made:2,mai:[0,3,4,5,6,7],main:[5,7,8],maintain:0,make:[4,5,6,7],makenod:4,maker:3,malici:5,manag:[],mani:[0,3,4,5,7],manual:4,map:7,mappabl:7,mark:[5,7],marker:7,market:2,match:[0,4,7],matur:7,maturityd:7,maximis:0,mean:[0,4],measur:[6,7],mechan:7,meet:7,mega_corp:7,mega_corp_kei:7,mega_corp_pubkei:8,megacorp:[7,8],member:5,memori:[],menu:1,mere:7,merg:[3,7],mess:5,messag:[],messagehandlerregistr:4,messagerecipi:4,messagerecipientgroup:4,messagingservic:[4,5],method:[4,5,7,8],middl:[4,5],might:[5,7],mileston:6,mind:[5,7],mine:0,minim:5,minimum:[0,6],minu:7,minut:3,misc:4,miss:[5,7],mix:[5,6,7],mock:[4,6],mode:4,modif:[6,7],modifi:[1,7],modul:[4,7],moment:4,monei:7,monetari:7,monitor:6,month:5,more:[0,3,4,7],most:[4,5,7],mostli:7,move:[5,7,8],movement:[5,7],much:[0,3,5,7],multi:[5,6,7],multipl:[0,4,7],must:[0,5,7],mutabl:[0,7],mutual:5,mykeypair:5,name:[4,5,7],nativ:5,natur:7,naval:0,necessari:6,necessarili:[6,7],need:[0,2,4,5,7],neither:[5,7],nest:5,net:[7,8],network:[],neutral:3,never:7,newown:7,next:[1,5,6,7],node:[0,4,5,6,8],non:[],normal:[5,7],not_matured_at_redempt:7,note:[0,1,5,7],noth:[0,7],notic:7,notion:[0,3,7],notnul:7,now:[1,4,5,7,8],nugget:7,nullpublickei:7,number:7,obj:7,object:[0,4,5,7,8],observ:6,observatori:0,obsolet:3,obtain:8,obvious:7,occur:[5,7],odd:[5,7],off:[4,5,7,8],offer:5,often:[0,5,7],onc:[3,4,5,7],onli:[0,3,4,5,7,8],onto:[7,8],opaqu:[3,4],opaquebyt:7,open:[1,5,8],openjdk:1,oper:[4,7],opposit:7,option:[4,7],oracl:[0,1],order:[3,7,8],ordinari:[0,3,5,7],org:[1,7],orient:[],origin:7,other:[0,3,4,5,6,7],othersid:5,otherwis:7,our:[0,5,6,7],ourselv:[5,7],oursignatur:5,out:[0,1,5,6,7],outcom:5,outlin:5,outpoint:0,output:[0,5,7,8],outputst:5,outsid:[0,4,5,7],outstat:7,over:[4,5,7],overrid:[5,7],overview:2,own:[4,5,7,8],ownablest:5,owned_bi:7,owner:[5,6,7],ownership:[5,7],owningkei:7,p2p:6,packag:6,packet:0,page:[6,7],pai:[5,7,8],pair:[0,5],paper:[],paper_1:[7,8],parallel:[4,7],paramet:[5,7],parameteris:0,part:[0,5,6,7],parti:[],partial:[5,7],partialtransact:[],partialtx:5,particip:[0,7],particular:5,partner:5,pass:[4,5,7,8],past:7,path:7,pattern:[0,7],payment:[5,7,8],peer:[3,4],pend:6,penni:7,peopl:[0,3,7],perform:[5,7],perhap:7,perman:[3,7],persist:[3,4,5],perspect:[5,7],pick:5,piec:[0,4,5,7],ping:4,pki:0,place:[0,3,6,7],plai:5,platform:[0,2,3,4,5,7],pleas:[0,7],pluggabl:6,plugin:1,point:[0,5,7],pointer:5,pong:4,pool:[5,6],poor:0,pop:[1,4],popular:3,posess:5,possibl:[0,2,4,5,7],potenti:[3,7],pound:7,power:[0,2],practic:[0,7],pre:[0,5,7],preced:7,preliminari:4,prepar:7,presenc:6,present:[2,6,7],press:7,pretti:[5,7],prevent:7,price:[0,5],primari:3,primit:7,priv:5,privaci:[0,7],privat:[0,5,7],probabl:[1,7],problem:[5,7],proce:5,process:[4,7],produc:[5,7,8],product:[2,3,7],profit:[7,8],program:[0,3,4,7],programref:7,progress:5,project:1,proof:[0,2],propag:[2,7],properti:7,protect:5,protocol:4,protocolstatemachin:5,prototyp:[],prove:[0,2,6,7],provid:[0,4,5,7],ptx:5,publickei:[5,7],pull:1,pump:4,purchas:5,pure:0,purpos:[3,7],put:[5,7],qualiti:2,quantiti:[0,3,7],queue:4,quickli:[4,7],quit:[5,7],r3cev:5,r3repositori:1,random63bitvalu:5,random:[0,5],rapid:3,rather:[0,5,7],rational:0,reachabl:5,read:[2,3,5,7],readabl:3,reader:7,readi:7,real:[3,4,7],realism:4,realiti:7,realli:[5,7],reason:[5,7],reassign:7,receiv:[0,4,5,7,8],recipi:[4,7],recognis:[0,7],record:[6,7],recreat:5,red:1,redeem:[3,7,8],redempt:[7,8],redemptiontim:[7,8],ref:[5,7],refer:[0,3,5,7],refin:3,reflect:7,refus:1,regist:[4,5],registr:4,regular:[3,5,7],reissuanc:7,reject:7,rel:0,relat:[5,7],relationship:7,releas:8,relev:0,reli:0,reliabl:4,relianc:0,remain:[7,8],rememb:[5,7],remov:[4,7],render:8,repeat:4,replac:7,replic:0,report:[4,6],repres:[0,4,5,7],request:5,requir:[4,6],requiresinglecommand:7,requirethat:[5,7],resolut:[0,2,6],resolv:[5,6],resourc:5,respect:7,respons:5,rest:[0,4],restart:[1,5],restor:5,result:[0,5,7],resultfutur:5,resum:5,resurrect:5,retri:4,reus:5,reveal:7,rewrit:5,right:[1,4,5],rigid:0,risk:5,roadmap:[],roll:6,rollov:7,room:5,root:[7,8],rout:[5,6],router:4,rule:[5,7],run:[0,1,4,5,7],runawai:6,runbuy:5,runnetwork:4,runsel:5,runtim:6,safe:[0,5,6,7],sai:7,sale:7,same:[0,3,4,5,7,8],sandbox:[0,3,6,7],saniti:5,satisfi:[5,7],save:7,scala:[3,7],scalabl:[0,7],scene:[5,7],scope:[0,7],screen:1,script:[0,7],seamless:3,search:[1,7],second:[5,7],secondari:5,secp256r1:3,section:7,secur:[0,4,5],securehash:7,see:[4,5,6,7],seen:[6,7,8],select:[1,7],sell:[5,7],seller:[],sellerimpl:5,sellerinitialarg:5,sellerownerkei:5,sellertradeinfo:5,semi:0,send:[0,4,5,7],sendandrec:5,sens:[5,7],sent:[4,5,7],separ:[5,6,7],sequenc:4,sequenti:5,serial:[3,7],serialis:[3,4,5,7],serializablewithkryo:7,serializeablewithkryo:7,server:6,servic:[4,5],servicehub:5,session:[4,5],sessionid:5,set:[],setter:7,settl:4,settlement:5,sever:[0,5,7],sha256:7,sha:0,share:[0,2,5,7],she:7,shortcut:3,shorthand:7,shot:4,should:[0,1,3,4,5,6,7],shouldn:5,show:[0,1,3,7,8],shown:7,shutdown:5,side:5,sig:[5,7],sign:[0,3,5,7],signatur:[0,3,5,6,7],signedwiretransact:[5,7],signer:7,signwith:[5,7],signwithecdsa:5,similar:[0,7],similarli:7,simpl:[4,5,7,8],simpler:3,simplest:5,simpli:[4,5,7],simplifi:[0,3,4,7],simultan:[4,5,7],singl:[0,5,7,8],singlemessagerecipi:[4,5],singleton:7,sit:4,site:6,size:[5,7],skeleton:5,slight:7,slightli:7,small:[0,3,5,7,8],smart:[],smm:5,smooth:7,snippet:7,softwar:3,sold:[5,7,8],solv:[5,7],some:[0,3,4,5,6,7,8],somed:7,someon:[4,7],someprofit:[7,8],someth:[1,5,7],sometim:[0,4,7],somewhat:0,somewher:[7,8],sort:5,sound:[5,7,8],sourc:5,space:7,special:0,specif:[0,4,5,7,8],specifi:[3,4,7],speed:5,spend:[0,5,6,7],split:[3,7],spread:[4,5],squar:8,src:[7,8],stack:5,stage:[5,6,7],stai:0,standard:[2,3,7],standardis:[0,7],start:[],state:4,stateandref:[5,7],stateless:0,statemachinemanag:5,statement:[5,7],stateref:[0,5],statesoftyp:5,status:0,step:[5,6,7],still:[0,7],stock:0,stop:[4,5,6],storag:[0,6],store:[5,7],straightforward:[5,7],stream:5,string:[4,5,7],strong:3,structur:[0,1,3,5,7],studi:7,stuff:5,stx:5,style:4,subgraph:6,subgroup:0,submenu:1,successor:3,suffici:[2,4],suffix:7,suggest:7,suitabl:6,sum:7,sumcashbi:[5,7],sumcashornul:7,summaris:0,superclass:5,supertyp:7,support:[3,5,6,7],suppos:[5,7],sure:[5,7],surround:7,surviv:5,suspend:5,swap:5,symbol:1,synchronis:0,syntax:[3,7],system:[0,3,5,6,7],tab:1,tailor:2,take:[3,5,7,8],target:[0,3],targetrecipi:4,task:[0,5,6],techniqu:7,tell:4,tempor:6,temporarili:5,tempt:7,temptat:5,ten:7,term:[0,7],termin:5,terminolog:0,test:[4,6],test_tx_tim:7,testutil:7,testwithinmemorynetwork:4,text:1,than:[0,2,5,7,8],thei:[0,3,4,5,6,7],them:[3,4,5,7],themselv:[4,7],theori:[],therefor:[3,7],thesi:6,thi:[0,1,2,3,4,5,6,7,8],thing:[0,3,5,6,7],think:[1,5,7],third:[5,7],those:[4,7],though:[4,5,7],thought:[0,3],thread:[4,5,6],three:[3,7],threshold:7,through:[0,5,6,7],thrown:7,thu:7,tighten:7,tightli:5,time:[0,3,5,6,7,8],timelin:7,timestamp:[0,5,7],timestampedwiretransact:5,timestampingservic:5,todo:[5,7],togeth:[0,7],too:[5,7,8],took:5,tool:3,top:[5,7],topic:[4,5],topriv:5,tosignedtransact:[5,7],tostr:7,total:7,totimestampedtransact:5,trace:5,track:5,tracker:3,trade:[],trade_top:5,traderequest:5,tradit:7,traffic:5,transact:[0,2,5,6,7,8],transactionbuild:[5,7],transactionforverif:7,transactiongroup:[5,7],transactiongroupdsl:8,transactiongroupfor:8,transactiongroupfortest:7,transfer:7,transit:[2,7],treat:7,tri:7,trick:5,tricki:5,truth:5,tsa:0,ture:0,turn:[5,7],tutori:[2,3,5,7],twice:3,two:4,twopartytradeprotocol:5,twopartytradeprotocolimpl:5,txbit:5,txhash:[0,7],type:[0,5,7],typetobui:5,typic:[4,5,7],unacceptablepriceexcept:5,under:7,underscor:7,understand:4,unexecut:7,unfinsish:5,unfortun:[5,7],unguess:5,uniqu:0,unit:[1,3,4,5,7,8],unless:[5,7],unlik:7,unnecessari:7,unpack:5,unread:5,unrecognis:7,unsaf:6,unserialis:5,unspent:0,unsupportedoperationexcept:7,until:[4,5],unus:4,unusu:7,unwieldi:7,updat:[0,1,5,7],upgrad:[1,2,6],upload:6,upon:7,url:1,usabl:3,usag:7,user:[0,3,4,5],util:[3,4,7],utxo:0,val:[4,5,7,8],valid:[0,5,6,7],valu:[3,7,8],vari:7,variabl:[5,7],variant:7,variou:[0,3,5,7],vendor:3,verbos:7,veri:[0,3,8],verif:[0,3],verifi:6,verifysignatur:5,verifytoledgertransact:5,versa:5,version:[1,3,5,7],versu:5,via:[0,5],vice:5,virtual:[0,2],visibl:0,visualis:[],vote:6,wai:[0,3,5,6,7],wait:[1,4,5],wallet:[0,5,7],walletservic:5,wan:6,want:[1,4,5,7],websit:7,well:[0,3,5,7],were:[5,7],what:[],whatev:5,when:[4,5,6,7],where:[0,4,5],wherea:7,whether:4,which:[0,3,4,5,7],whilst:[0,5,7],who:[3,4,5,7],whole:7,why:[0,3,5,7],wide:[4,7],wiki:[0,7],wikipedia:7,window:[0,8],wire:5,wirecommand:[5,7],wiretransact:5,wish:[4,5,6,7],within:0,withnewown:5,withoutown:7,won:[4,7],work:[0,1,2,3,4,5,7],world:[0,5,7],worn:7,worri:[3,5],worth:7,would:[3,4,5,7],wouldn:7,wrap:7,wrapper:5,write:[],written:[0,3,7],wtx:5,www:1,yet:[0,7],yield:0,you:[0,1,3,4,5,7,8],your:4,your_usernam:1,zero:7},titles:["Data model","Getting set up","Welcome to the R3 prototyping repository!","What’s included?","Networking and messaging","Protocol state machines","Roadmap","Writing a contract","Using the visualiser"],titleterms:{"class":7,"function":7,about:1,api:7,asset:7,base:7,bitcoin:0,buyer:5,check:7,command:7,commerci:7,comparison:0,complain:1,contract:[3,7],craft:7,data:0,descript:0,ethereum:0,fungibl:7,get:1,how:7,implement:[4,5],includ:3,intellij:1,interfac:4,introduct:5,kotlin:3,lack:1,machin:5,manag:5,memori:4,messag:4,model:0,network:4,non:7,orient:7,paper:7,parti:5,protocol:5,prototyp:2,repositori:2,requir:7,roadmap:6,sdk:1,seller:5,set:1,smart:7,start:7,state:[5,7],test:7,theori:5,trade:5,two:5,understand:7,verifi:7,visualis:8,welcom:2,what:3,without:1,write:7,your:7}}) \ No newline at end of file diff --git a/docs/build/html/tutorial.html b/docs/build/html/tutorial.html index 5216b2ce61..622248a008 100644 --- a/docs/build/html/tutorial.html +++ b/docs/build/html/tutorial.html @@ -741,22 +741,22 @@ like a module), the basic concept is the same: preparation of a transaction usin

For our commercial paper contract however, the things that can be done with it are quite simple. Let’s start with a method to wrap up the issuance process:

-
fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): PartialTransaction {
+
fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): TransactionBuilder {
     val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate)
-    return PartialTransaction(state, WireCommand(Commands.Issue, issuance.party.owningKey))
+    return TransactionBuilder(state, WireCommand(Commands.Issue, issuance.party.owningKey))
 }
 

We take a reference that points to the issuing party (i.e. the caller) and which can contain any internal bookkeeping/reference numbers that we may require. Then the face value of the paper, and the maturity date. It -returns a PartialTransaction. A PartialTransaction is one of the few mutable classes the platform provides. +returns a TransactionBuilder. A TransactionBuilder is one of the few mutable classes the platform provides. It allows you to add inputs, outputs and commands to it and is designed to be passed around, potentially between multiple contracts.

Note

Crafting methods should ideally be written to compose with each other, that is, they should take a -PartialTransaction as an argument instead of returning one, unless you are sure it doesn’t make sense to +TransactionBuilder as an argument instead of returning one, unless you are sure it doesn’t make sense to combine this type of transaction with others. In this case, issuing CP at the same time as doing other things would just introduce complexity that isn’t likely to be worth it, so we return a fresh object each time: instead, an issuer should issue the CP (starting out owned by themselves), and then sell it in a separate transaction.

@@ -767,12 +767,12 @@ to issue CP onto the ledger that’s immediately owned by someone else, they

The returned partial transaction has a WireCommand object as a parameter. This is a container for any object that implements the Command interface, along with a key that is expected to sign this transaction. In this case, issuance requires that the issuing party sign, so we put the key of the party there.

-

The PartialTransaction constructor we used above takes a variable argument list for convenience. You can pass in +

The TransactionBuilder constructor we used above takes a variable argument list for convenience. You can pass in any ContractStateRef (input), ContractState (output) or Command objects and it’ll build up the transaction for you.

What about moving the paper, i.e. reassigning ownership to someone else?

-
fun craftMove(tx: PartialTransaction, paper: StateAndRef<State>, newOwner: PublicKey) {
+
fun craftMove(tx: TransactionBuilder, paper: StateAndRef<State>, newOwner: PublicKey) {
     tx.addInputState(paper.ref)
     tx.addOutputState(paper.state.copy(owner = newOwner))
     tx.addArg(WireCommand(Commands.Move, paper.state.owner))
@@ -780,7 +780,7 @@ for you.

-

Here, the method takes a pre-existing PartialTransaction and adds to it. This is correct because typically +

Here, the method takes a pre-existing TransactionBuilder and adds to it. This is correct because typically you will want to combine a sale of CP atomically with the movement of some other asset, such as cash. So both craft methods should operate on the same transaction. You can see an example of this being done in the unit tests for the commercial paper contract.

@@ -790,7 +790,7 @@ state on the ledger.

Finally, we can do redemption.

@Throws(InsufficientBalanceException::class)
-fun craftRedeem(tx: PartialTransaction, paper: StateAndRef<State>, wallet: List<StateAndRef<Cash.State>>) {
+fun craftRedeem(tx: TransactionBuilder, paper: StateAndRef<State>, wallet: List<StateAndRef<Cash.State>>) {
     // Add the cash movement using the states in our wallet.
     Cash().craftSpend(tx, paper.state.faceValue, paper.state.owner, wallet)
     tx.addInputState(paper.ref)
@@ -813,10 +813,10 @@ from the issuer of the commercial paper to the current owner. If we don’t
 an exception is thrown. And then we add the paper itself as an input, but, not an output (as we wish to delete it
 from the ledger permanently). Finally, we add a Redeem command that should be signed by the owner of the commercial
 paper.

-

A PartialTransaction is not by itself ready to be used anywhere, so first, we must convert it to something that +

A TransactionBuilder is not by itself ready to be used anywhere, so first, we must convert it to something that is recognised by the network. The most important next step is for the participating entities to sign it using the signWith() method. This takes a keypair, serialises the transaction, signs the serialised form and then stores the -signature inside the PartialTransaction. Once all parties have signed, you can call PartialTransaction.toSignedTransaction() +signature inside the TransactionBuilder. Once all parties have signed, you can call TransactionBuilder.toSignedTransaction() to get a SignedWireTransaction object. This is an immutable form of the transaction that’s ready for timestamping.

Note

diff --git a/docs/source/protocol-state-machines.rst b/docs/source/protocol-state-machines.rst index 69705fe896..3cc0149344 100644 --- a/docs/source/protocol-state-machines.rst +++ b/docs/source/protocol-state-machines.rst @@ -353,7 +353,7 @@ OK, let's do the same for the buyer side: // the state we are being offered! For now, just assume validity! // Generate the shared transaction that both sides will sign, using the data we have. - val ptx = PartialTransaction() + val ptx = TransactionBuilder() // Add input and output states for the movement of cash, by using the Cash contract // to generate the states. val wallet = serviceHub.walletService.currentWallet diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index d649e35247..7b77bc6846 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst @@ -662,19 +662,19 @@ a method to wrap up the issuance process: .. sourcecode:: kotlin - fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): PartialTransaction { + fun craftIssue(issuance: InstitutionReference, faceValue: Amount, maturityDate: Instant): TransactionBuilder { val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate) - return PartialTransaction(state, WireCommand(Commands.Issue, issuance.party.owningKey)) + return TransactionBuilder(state, WireCommand(Commands.Issue, issuance.party.owningKey)) } We take a reference that points to the issuing party (i.e. the caller) and which can contain any internal bookkeeping/reference numbers that we may require. Then the face value of the paper, and the maturity date. It -returns a ``PartialTransaction``. A ``PartialTransaction`` is one of the few mutable classes the platform provides. +returns a ``TransactionBuilder``. A ``TransactionBuilder`` is one of the few mutable classes the platform provides. It allows you to add inputs, outputs and commands to it and is designed to be passed around, potentially between multiple contracts. .. note:: Crafting methods should ideally be written to compose with each other, that is, they should take a - ``PartialTransaction`` as an argument instead of returning one, unless you are sure it doesn't make sense to + ``TransactionBuilder`` as an argument instead of returning one, unless you are sure it doesn't make sense to combine this type of transaction with others. In this case, issuing CP at the same time as doing other things would just introduce complexity that isn't likely to be worth it, so we return a fresh object each time: instead, an issuer should issue the CP (starting out owned by themselves), and then sell it in a separate transaction. @@ -687,7 +687,7 @@ The returned partial transaction has a ``WireCommand`` object as a parameter. Th that implements the ``Command`` interface, along with a key that is expected to sign this transaction. In this case, issuance requires that the issuing party sign, so we put the key of the party there. -The ``PartialTransaction`` constructor we used above takes a variable argument list for convenience. You can pass in +The ``TransactionBuilder`` constructor we used above takes a variable argument list for convenience. You can pass in any ``ContractStateRef`` (input), ``ContractState`` (output) or ``Command`` objects and it'll build up the transaction for you. @@ -697,13 +697,13 @@ What about moving the paper, i.e. reassigning ownership to someone else? .. sourcecode:: kotlin - fun craftMove(tx: PartialTransaction, paper: StateAndRef, newOwner: PublicKey) { + fun craftMove(tx: TransactionBuilder, paper: StateAndRef, newOwner: PublicKey) { tx.addInputState(paper.ref) tx.addOutputState(paper.state.copy(owner = newOwner)) tx.addArg(WireCommand(Commands.Move, paper.state.owner)) } -Here, the method takes a pre-existing ``PartialTransaction`` and adds to it. This is correct because typically +Here, the method takes a pre-existing ``TransactionBuilder`` and adds to it. This is correct because typically you will want to combine a sale of CP atomically with the movement of some other asset, such as cash. So both craft methods should operate on the same transaction. You can see an example of this being done in the unit tests for the commercial paper contract. @@ -719,7 +719,7 @@ Finally, we can do redemption. .. sourcecode:: kotlin @Throws(InsufficientBalanceException::class) - fun craftRedeem(tx: PartialTransaction, paper: StateAndRef, wallet: List>) { + fun craftRedeem(tx: TransactionBuilder, paper: StateAndRef, wallet: List>) { // Add the cash movement using the states in our wallet. Cash().craftSpend(tx, paper.state.faceValue, paper.state.owner, wallet) tx.addInputState(paper.ref) @@ -740,10 +740,10 @@ an exception is thrown. And then we add the paper itself as an input, but, not a from the ledger permanently). Finally, we add a Redeem command that should be signed by the owner of the commercial paper. -A ``PartialTransaction`` is not by itself ready to be used anywhere, so first, we must convert it to something that +A ``TransactionBuilder`` is not by itself ready to be used anywhere, so first, we must convert it to something that is recognised by the network. The most important next step is for the participating entities to sign it using the ``signWith()`` method. This takes a keypair, serialises the transaction, signs the serialised form and then stores the -signature inside the ``PartialTransaction``. Once all parties have signed, you can call ``PartialTransaction.toSignedTransaction()`` +signature inside the ``TransactionBuilder``. Once all parties have signed, you can call ``TransactionBuilder.toSignedTransaction()`` to get a ``SignedWireTransaction`` object. This is an immutable form of the transaction that's ready for *timestamping*. .. note:: Timestamping and passing around of partial transactions for group signing is not yet fully implemented. diff --git a/src/main/kotlin/contracts/Cash.kt b/src/main/kotlin/contracts/Cash.kt index aad70dbb54..0515d05165 100644 --- a/src/main/kotlin/contracts/Cash.kt +++ b/src/main/kotlin/contracts/Cash.kt @@ -151,7 +151,7 @@ class Cash : Contract { /** * Puts together an issuance transaction for the specified amount that starts out being owned by the given pubkey. */ - fun craftIssue(tx: PartialTransaction, amount: Amount, at: PartyReference, owner: PublicKey) { + fun craftIssue(tx: TransactionBuilder, amount: Amount, at: PartyReference, owner: PublicKey) { check(tx.inputStates().isEmpty()) check(tx.outputStates().sumCashOrNull() == null) tx.addOutputState(Cash.State(at, amount, owner)) @@ -167,7 +167,7 @@ class Cash : Contract { * about which type of cash claims they are willing to accept. */ @Throws(InsufficientBalanceException::class) - fun craftSpend(tx: PartialTransaction, amount: Amount, to: PublicKey, + fun craftSpend(tx: TransactionBuilder, amount: Amount, to: PublicKey, cashStates: List>, onlyFromParties: Set? = null): List { // Discussion // diff --git a/src/main/kotlin/contracts/CommercialPaper.kt b/src/main/kotlin/contracts/CommercialPaper.kt index 2a4eda81bc..b76848209f 100644 --- a/src/main/kotlin/contracts/CommercialPaper.kt +++ b/src/main/kotlin/contracts/CommercialPaper.kt @@ -117,15 +117,15 @@ class CommercialPaper : Contract { * an existing transaction because you aren't able to issue multiple pieces of CP in a single transaction * at the moment: this restriction is not fundamental and may be lifted later. */ - fun craftIssue(issuance: PartyReference, faceValue: Amount, maturityDate: Instant): PartialTransaction { + fun craftIssue(issuance: PartyReference, faceValue: Amount, maturityDate: Instant): TransactionBuilder { val state = State(issuance, issuance.party.owningKey, faceValue, maturityDate) - return PartialTransaction().withItems(state, Command(Commands.Issue(), issuance.party.owningKey)) + return TransactionBuilder().withItems(state, Command(Commands.Issue(), issuance.party.owningKey)) } /** * Updates the given partial transaction with an input/output/command to reassign ownership of the paper. */ - fun craftMove(tx: PartialTransaction, paper: StateAndRef, newOwner: PublicKey) { + fun craftMove(tx: TransactionBuilder, paper: StateAndRef, newOwner: PublicKey) { tx.addInputState(paper.ref) tx.addOutputState(paper.state.copy(owner = newOwner)) tx.addCommand(Commands.Move(), paper.state.owner) @@ -139,7 +139,7 @@ class CommercialPaper : Contract { * @throws InsufficientBalanceException if the wallet doesn't contain enough money to pay the redeemer */ @Throws(InsufficientBalanceException::class) - fun craftRedeem(tx: PartialTransaction, paper: StateAndRef, wallet: List>) { + fun craftRedeem(tx: TransactionBuilder, paper: StateAndRef, wallet: List>) { // Add the cash movement using the states in our wallet. Cash().craftSpend(tx, paper.state.faceValue, paper.state.owner, wallet) tx.addInputState(paper.ref) diff --git a/src/main/kotlin/contracts/CrowdFund.kt b/src/main/kotlin/contracts/CrowdFund.kt index 4985350264..6b98fd92ec 100644 --- a/src/main/kotlin/contracts/CrowdFund.kt +++ b/src/main/kotlin/contracts/CrowdFund.kt @@ -142,16 +142,16 @@ class CrowdFund : Contract { * Returns a transaction that registers a crowd-funding campaing, owned by the issuing institution's key. Does not update * an existing transaction because it's not possible to register multiple campaigns in a single transaction */ - fun craftRegister(owner: PartyReference, fundingTarget: Amount, fundingName: String, closingTime: Instant): PartialTransaction { + fun craftRegister(owner: PartyReference, fundingTarget: Amount, fundingName: String, closingTime: Instant): TransactionBuilder { val campaign = Campaign(owner = owner.party.owningKey, name = fundingName, target = fundingTarget, closingTime = closingTime) val state = State(campaign) - return PartialTransaction().withItems(state, Command(Commands.Register(), owner.party.owningKey)) + return TransactionBuilder().withItems(state, Command(Commands.Register(), owner.party.owningKey)) } /** * Updates the given partial transaction with an input/output/command to fund the opportunity. */ - fun craftPledge(tx: PartialTransaction, campaign: StateAndRef, subscriber: PublicKey) { + fun craftPledge(tx: TransactionBuilder, campaign: StateAndRef, subscriber: PublicKey) { tx.addInputState(campaign.ref) tx.addOutputState(campaign.state.copy( pledges = campaign.state.pledges + CrowdFund.Pledge(subscriber, 1000.DOLLARS) @@ -159,7 +159,7 @@ class CrowdFund : Contract { tx.addCommand(Commands.Pledge(), subscriber) } - fun craftClose(tx: PartialTransaction, campaign: StateAndRef, wallet: List>) { + fun craftClose(tx: TransactionBuilder, campaign: StateAndRef, wallet: List>) { tx.addInputState(campaign.ref) tx.addOutputState(campaign.state.copy(closed = true)) tx.addCommand(Commands.Close(), campaign.state.campaign.owner) diff --git a/src/main/kotlin/contracts/protocols/TwoPartyTradeProtocol.kt b/src/main/kotlin/contracts/protocols/TwoPartyTradeProtocol.kt index 940bf83d6c..3f1858f85a 100644 --- a/src/main/kotlin/contracts/protocols/TwoPartyTradeProtocol.kt +++ b/src/main/kotlin/contracts/protocols/TwoPartyTradeProtocol.kt @@ -155,7 +155,7 @@ private class TwoPartyTradeProtocolImpl(private val smm: StateMachineManager) : // For now, just assume validity! // Generate the shared transaction that both sides will sign, using the data we have. - val ptx = PartialTransaction() + val ptx = TransactionBuilder() // Add input and output states for the movement of cash, by using the Cash contract to generate the states. val wallet = serviceHub.walletService.currentWallet val cashStates = wallet.statesOfType() diff --git a/src/main/kotlin/core/Transactions.kt b/src/main/kotlin/core/Transactions.kt index 936bb07bad..93dda34c73 100644 --- a/src/main/kotlin/core/Transactions.kt +++ b/src/main/kotlin/core/Transactions.kt @@ -31,7 +31,7 @@ import java.util.* * keypairs. Note that a sighash is not the same thing as a *transaction id*, which is the hash of a SignedWireTransaction * i.e. the outermost serialised form with everything included. * - * A PartialTransaction is a transaction class that's mutable (unlike the others which are all immutable). It is + * A TransactionBuilder is a transaction class that's mutable (unlike the others which are all immutable). It is * intended to be passed around contracts that may edit it by adding new states/commands or modifying the existing set. * Then once the states and commands are right, this class can be used as a holding bucket to gather signatures from * multiple parties. @@ -67,7 +67,7 @@ data class WireTransaction(val inputStates: List, class NotOnTimeException : Exception() /** A mutable transaction that's in the process of being built, before all signatures are present. */ -class PartialTransaction(private val inputStates: MutableList = arrayListOf(), +class TransactionBuilder(private val inputStates: MutableList = arrayListOf(), private val outputStates: MutableList = arrayListOf(), private val commands: MutableList = arrayListOf()) { @@ -92,7 +92,7 @@ class PartialTransaction(private val inputStates: MutableList } /** A more convenient way to add items to this transaction that calls the add* methods for you based on type */ - public fun withItems(vararg items: Any): PartialTransaction { + public fun withItems(vararg items: Any): TransactionBuilder { for (t in items) { when (t) { is ContractStateRef -> inputStates.add(t) diff --git a/src/test/kotlin/contracts/CashTests.kt b/src/test/kotlin/contracts/CashTests.kt index a9b41aa942..2bce05032e 100644 --- a/src/test/kotlin/contracts/CashTests.kt +++ b/src/test/kotlin/contracts/CashTests.kt @@ -103,7 +103,7 @@ class CashTests { this.accepts() } - val ptx = PartialTransaction() + val ptx = TransactionBuilder() Cash().craftIssue(ptx, 100.DOLLARS, MINI_CORP.ref(12,34), owner = DUMMY_PUBKEY_1) assertTrue(ptx.inputStates().isEmpty()) val s = ptx.outputStates()[0] as Cash.State @@ -312,7 +312,7 @@ class CashTests { ) fun makeSpend(amount: Amount, dest: PublicKey): WireTransaction { - val tx = PartialTransaction() + val tx = TransactionBuilder() Cash().craftSpend(tx, amount, dest, WALLET) return tx.toWireTransaction() } @@ -327,7 +327,7 @@ class CashTests { @Test fun craftSimpleSpendWithParties() { - val tx = PartialTransaction() + val tx = TransactionBuilder() Cash().craftSpend(tx, 80.DOLLARS, ALICE, WALLET, setOf(MINI_CORP)) assertEquals(WALLET[2].ref, tx.inputStates()[0]) } diff --git a/src/test/kotlin/contracts/CommercialPaperTests.kt b/src/test/kotlin/contracts/CommercialPaperTests.kt index 77ca095c79..c1f1177c63 100644 --- a/src/test/kotlin/contracts/CommercialPaperTests.kt +++ b/src/test/kotlin/contracts/CommercialPaperTests.kt @@ -149,7 +149,7 @@ class CommercialPaperTests { // Alice pays $9000 to MiniCorp to own some of their debt. val moveTX: LedgerTransaction = run { - val ptx = PartialTransaction() + val ptx = TransactionBuilder() Cash().craftSpend(ptx, 9000.DOLLARS, MINI_CORP_PUBKEY, alicesWallet) CommercialPaper().craftMove(ptx, issueTX.outRef(0), ALICE) ptx.signWith(MINI_CORP_KEY) @@ -165,7 +165,7 @@ class CommercialPaperTests { ) fun makeRedeemTX(time: Instant): LedgerTransaction { - val ptx = PartialTransaction() + val ptx = TransactionBuilder() ptx.setTime(time, DummyTimestampingAuthority.identity, 30.seconds) CommercialPaper().craftRedeem(ptx, moveTX.outRef(1), corpWallet) ptx.signWith(ALICE_KEY) diff --git a/src/test/kotlin/contracts/CrowdFundTests.kt b/src/test/kotlin/contracts/CrowdFundTests.kt index e42e3132cb..8880e141a5 100644 --- a/src/test/kotlin/contracts/CrowdFundTests.kt +++ b/src/test/kotlin/contracts/CrowdFundTests.kt @@ -125,7 +125,7 @@ class CrowdFundTests { // Alice pays $1000 to MiniCorp to fund their campaign. val pledgeTX: LedgerTransaction = run { - val ptx = PartialTransaction() + val ptx = TransactionBuilder() CrowdFund().craftPledge(ptx, registerTX.outRef(0), ALICE) Cash().craftSpend(ptx, 1000.DOLLARS, MINI_CORP_PUBKEY, aliceWallet) ptx.setTime(TEST_TX_TIME, DummyTimestampingAuthority.identity, 30.seconds) @@ -143,7 +143,7 @@ class CrowdFundTests { ) // MiniCorp closes their campaign. fun makeFundedTX(time: Instant): LedgerTransaction { - val ptx = PartialTransaction() + val ptx = TransactionBuilder() ptx.setTime(time, DUMMY_TIMESTAMPER.identity, 30.seconds) CrowdFund().craftClose(ptx, pledgeTX.outRef(0), miniCorpWallet) ptx.signWith(MINI_CORP_KEY) diff --git a/src/test/kotlin/core/serialization/TransactionSerializationTests.kt b/src/test/kotlin/core/serialization/TransactionSerializationTests.kt index add4682705..fc95173c94 100644 --- a/src/test/kotlin/core/serialization/TransactionSerializationTests.kt +++ b/src/test/kotlin/core/serialization/TransactionSerializationTests.kt @@ -25,11 +25,11 @@ class TransactionSerializationTests { val changeState = Cash.State(depositRef, 400.POUNDS, TestUtils.keypair.public) val fakeStateRef = ContractStateRef(SecureHash.sha256("fake tx id"), 0) - lateinit var tx: PartialTransaction + lateinit var tx: TransactionBuilder @Before fun setup() { - tx = PartialTransaction().withItems( + tx = TransactionBuilder().withItems( fakeStateRef, outputState, changeState, Command(Cash.Commands.Move(), arrayListOf(TestUtils.keypair.public)) ) } @@ -75,7 +75,7 @@ class TransactionSerializationTests { // If the signature was replaced in transit, we don't like it. assertFailsWith(SignatureException::class) { - val tx2 = PartialTransaction().withItems(fakeStateRef, outputState, changeState, + val tx2 = TransactionBuilder().withItems(fakeStateRef, outputState, changeState, Command(Cash.Commands.Move(), TestUtils.keypair2.public)) tx2.signWith(TestUtils.keypair2)