You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This change set contains a set of functions to generate a transaction (from
proposal, endorsements and a signing identity) and validate it (given a set
of root CAs). The validation code will be used by the committer. The tx
assembling code should be helpful for the SDK team to understand how
transactions should be assembled. Additionally, it has changed the type of
messages exchanged everywhere to be of the proper type and with signatures
(obtained from a fixed identity for now). Finally, it contains an initial
implementation of VSCC with unit tests (which is however not yet called by
the committer).
Change-Id: I375ecc7e61516f3c4ab8fd874aa564e99cc720fb
Signed-off-by: Alessandro Sorniotti <[email protected]>
fmt.Printf("Error getting tx from block(%s)\n", err)
131
-
} elseiftx!=nil {
132
-
ift, err:=proto.Marshal(tx); err==nil {
133
-
block.Transactions=append(block.Transactions, t)
132
+
} elseifenv!=nil {
133
+
// validate the transaction: here we check that the transaction
134
+
// is properly formed, properly signed and that the security
135
+
// chain binding proposal to endorsements to tx holds. We do
136
+
// NOT check the validity of endorsements, though. That's a
137
+
// job for VSCC below
138
+
_, err:=peer.ValidateTransaction(env)
139
+
iferr!=nil {
140
+
// TODO: this code needs to receive a bit more attention and discussion: it's not clear what it means if a transaction which causes a failure in validation is just dropped on the floor
// at first, we check whether the message is valid
345
-
// TODO: Do the checks performed by this function belong here or in the ESCC? From a security standpoint they should be performed as early as possible so here seems to be a good place
0 commit comments