forked from hyperledger-labs/fabric-token-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove orion commit processor (hyperledger-labs#613)
Signed-off-by: Angelo De Caro <[email protected]> Signed-off-by: Alexandros Filios <[email protected]>
- Loading branch information
Showing
62 changed files
with
1,101 additions
and
700 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package common | ||
|
||
import ( | ||
"github.com/hyperledger-labs/fabric-smart-client/integration" | ||
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/common" | ||
"github.com/hyperledger-labs/fabric-token-sdk/integration/token/common/views" | ||
"github.com/hyperledger-labs/fabric-token-sdk/token" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
func CheckFinality(network *integration.Infrastructure, id string, txID string, tmsID *token.TMSID, fail bool) { | ||
if len(id) == 0 { | ||
return | ||
} | ||
_, err := network.Client(id).CallView("TxFinality", common.JSONMarshall(&views.TxFinality{ | ||
TxID: txID, | ||
TMSID: tmsID, | ||
})) | ||
if fail { | ||
Expect(err).To(HaveOccurred()) | ||
} else { | ||
Expect(err).NotTo(HaveOccurred()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
Copyright IBM Corp. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package views | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/hyperledger-labs/fabric-smart-client/platform/view/services/assert" | ||
"github.com/hyperledger-labs/fabric-smart-client/platform/view/view" | ||
"github.com/hyperledger-labs/fabric-token-sdk/token" | ||
"github.com/hyperledger-labs/fabric-token-sdk/token/services/ttx" | ||
) | ||
|
||
type TxFinality struct { | ||
TxID string | ||
TMSID *token.TMSID | ||
} | ||
|
||
type TxFinalityView struct { | ||
*TxFinality | ||
} | ||
|
||
func (r *TxFinalityView) Call(context view.Context) (interface{}, error) { | ||
var tmsID token.TMSID | ||
if r.TMSID != nil { | ||
tmsID = *r.TMSID | ||
} | ||
tms := token.GetManagementService(context, token.WithTMSID(tmsID)) | ||
assert.NotNil(tms) | ||
return context.RunView(ttx.NewFinalityWithOpts(ttx.WithTxID(r.TxID), ttx.WithTMSID(tms.ID()))) | ||
} | ||
|
||
type TxFinalityViewFactory struct{} | ||
|
||
func (p *TxFinalityViewFactory) NewView(in []byte) (view.View, error) { | ||
f := &TxFinalityView{TxFinality: &TxFinality{}} | ||
err := json.Unmarshal(in, f.TxFinality) | ||
assert.NoError(err, "failed unmarshalling input") | ||
|
||
return f, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.