Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F myci fix #756

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,39 @@ jobs:
run: make ${{ matrix.tests }}

itest:
needs: checks
# needs: checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tests: [
dlog-fabric-t1,
dlog-fabric-t2,
dlog-fabric-t3,
dlog-fabric-t4,
dlog-fabric-t5,
dlog-fabric-t6,
dlog-fabric-t7,
dlog-fabric-t8,
dlog-fabric-t9,
dlog-fabric-t10,
dlog-fabric-t11,
fabtoken-dlog-fabric,
dloghsm-fabric-t1,
dloghsm-fabric-t2,
fabtoken-fabric-t1,
fabtoken-fabric-t2,
fabtoken-fabric-t3,
fabtoken-fabric-t4,
fabtoken-fabric-t5,
dlog-orion,
fabtoken-orion,
nft-dlog,
nft-fabtoken,
nft-dlog-orion,
nft-fabtoken-orion,
dvp-fabtoken,
dvp-dlog,
# dlog-fabric-t1,
# dlog-fabric-t2,
# dlog-fabric-t3,
# dlog-fabric-t4,
# dlog-fabric-t5,
# dlog-fabric-t6,
# dlog-fabric-t7,
# dlog-fabric-t8,
# dlog-fabric-t9,
# dlog-fabric-t10,
# dlog-fabric-t11,
# fabtoken-dlog-fabric,
# dloghsm-fabric-t1,
# dloghsm-fabric-t2,
# fabtoken-fabric-t1,
# fabtoken-fabric-t2,
# fabtoken-fabric-t3,
# fabtoken-fabric-t4,
# fabtoken-fabric-t5,
# dlog-orion,
# fabtoken-orion,
# nft-dlog,
# nft-fabtoken,
# nft-dlog-orion,
# nft-fabtoken-orion,
# dvp-fabtoken,
# dvp-dlog,
interop-fabtoken-t1,
interop-fabtoken-t2,
interop-fabtoken-t3,
Expand All @@ -123,7 +123,7 @@ jobs:
interop-dlog-t4,
interop-dlog-t5,
interop-dlog-t6,
dlogstress-t1,
# dlogstress-t1,
]

steps:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/IBM/idemix/bccsp/types v0.0.0-20240816143710-3dce4618d760
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da
github.com/hashicorp/go-uuid v1.0.3
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240906110529-b91207af4d1e
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240913075210-92b7063e385b
github.com/hyperledger-labs/orion-sdk-go v0.2.10
github.com/hyperledger-labs/orion-server v0.2.10
github.com/hyperledger/fabric v1.4.0-rc1.0.20230405174026-695dd57e01c2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1071,8 +1071,8 @@ github.com/hidal-go/hidalgo v0.0.0-20201109092204-05749a6d73df/go.mod h1:bPkrxDl
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240906110529-b91207af4d1e h1:34g3yH95u+VZ2BzUqVUKP3fbSnBYEix//HsaWPcYKc8=
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240906110529-b91207af4d1e/go.mod h1:9AELIfs/eawIhoHNKMSmYALaunmpDbs9bdWKyHuJs88=
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240913075210-92b7063e385b h1:l1PsLvPkK+zZhLayQWcHt1RyUCYYm5miI3os1UdQXZM=
github.com/hyperledger-labs/fabric-smart-client v0.3.1-0.20240913075210-92b7063e385b/go.mod h1:9AELIfs/eawIhoHNKMSmYALaunmpDbs9bdWKyHuJs88=
github.com/hyperledger-labs/orion-sdk-go v0.2.10 h1:lFgWgxyvngIhWnIqymYGBmtmq9D6uC5d0uLG9cbyh5s=
github.com/hyperledger-labs/orion-sdk-go v0.2.10/go.mod h1:iN2xZB964AqwVJwL+EnwPOs8z1EkMEbbIg/qYeC7gDY=
github.com/hyperledger-labs/orion-server v0.2.10 h1:G4zbQEL5Egk0Oj+TwHCZWdTOLDBHOjaAEvYOT4G7ozw=
Expand Down
8 changes: 6 additions & 2 deletions integration/token/interop/dlog/dlog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
var _ = Describe("DLog end to end", func() {
BeforeEach(func() { token.Drivers = append(token.Drivers, "dlog") })

for _, t := range integration2.AllTestTypes {
for _, t := range integration2.WebSocketWithReplicationOnly {
Describe("HTLC Single Fabric Network", t.Label, func() {
ts, selector := newTestSuiteSingleFabric(t.CommType, t.ReplicationFactor, "alice", "bob")
AfterEach(ts.TearDown)
Expand Down Expand Up @@ -69,6 +69,7 @@ func newTestSuiteSingleFabric(commType fsc.P2PCommunicationType, factor int, nam
ReplicationOpts: opts,
TokenSDKDriver: "dlog",
SDKs: []api2.SDK{&fdlog.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -80,6 +81,7 @@ func newTestSuiteSingleOrion(commType fsc.P2PCommunicationType, factor int, name
ReplicationOpts: opts,
TokenSDKDriver: "dlog",
SDKs: []api2.SDK{&odlog.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -91,6 +93,7 @@ func newTestSuiteTwoFabric(commType fsc.P2PCommunicationType, factor int, names
ReplicationOpts: opts,
TokenSDKDriver: "dlog",
SDKs: []api2.SDK{&fdlog.SDK{}},
FSCLogSpec: "view-sdk.services.comm=debug:token-sdk=info:fabric-sdk=debug:info",
}))
return ts, selector
}
Expand All @@ -102,6 +105,7 @@ func newTestSuiteNoCrossClaimFabric(commType fsc.P2PCommunicationType, factor in
ReplicationOpts: opts,
TokenSDKDriver: "dlog",
SDKs: []api2.SDK{&fdlog.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -113,7 +117,7 @@ func newTestSuiteNoCrossClaimOrion(commType fsc.P2PCommunicationType, factor int
ReplicationOpts: opts,
TokenSDKDriver: "dlog",
SDKs: []api2.SDK{&fodlog.SDK{}},
FSCLogSpec: "token-sdk=debug:fabric-sdk=debug:view-sdk=debug:info",
FSCLogSpec: "debug",
}))
return ts, selector
}
5 changes: 5 additions & 0 deletions integration/token/interop/fabtoken/fabtoken_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func newTestSuiteSingleFabric(commType fsc.P2PCommunicationType, factor int, nam
ReplicationOpts: opts,
TokenSDKDriver: "fabtoken",
SDKs: []api2.SDK{&ffabtoken.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -80,6 +81,7 @@ func newTestSuiteSingleOrion(commType fsc.P2PCommunicationType, factor int, name
ReplicationOpts: opts,
TokenSDKDriver: "fabtoken",
SDKs: []api2.SDK{&ofabtoken.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -91,6 +93,7 @@ func newTestSuiteTwoFabric(commType fsc.P2PCommunicationType, factor int, names
ReplicationOpts: opts,
TokenSDKDriver: "fabtoken",
SDKs: []api2.SDK{&ffabtoken.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -102,6 +105,7 @@ func newTestSuiteNoCrossClaimFabric(commType fsc.P2PCommunicationType, factor in
ReplicationOpts: opts,
TokenSDKDriver: "fabtoken",
SDKs: []api2.SDK{&ffabtoken.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
Expand All @@ -113,6 +117,7 @@ func newTestSuiteNoCrossClaimOrion(commType fsc.P2PCommunicationType, factor int
ReplicationOpts: opts,
TokenSDKDriver: "fabtoken",
SDKs: []api2.SDK{&fofabtoken.SDK{}},
FSCLogSpec: "debug",
}))
return ts, selector
}
11 changes: 9 additions & 2 deletions integration/token/interop/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"strings"
"time"

views3 "github.com/hyperledger-labs/fabric-token-sdk/integration/token/common/views"
"github.com/pkg/errors"

"github.com/hyperledger-labs/fabric-smart-client/integration"
Expand Down Expand Up @@ -394,7 +395,7 @@ func htlcClaim(network *integration.Infrastructure, tmsID token.TMSID, id *token
}

func fastExchange(network *integration.Infrastructure, id *token3.NodeReference, recipient *token3.NodeReference, tmsID1 token.TMSID, typ1 string, amount1 uint64, tmsID2 token.TMSID, typ2 string, amount2 uint64, deadline time.Duration) {
_, err := network.Client(id.ReplicaName()).CallView("htlc.fastExchange", common.JSONMarshall(&htlc.FastExchange{
res, err := network.Client(id.ReplicaName()).CallView("htlc.fastExchange", common.JSONMarshall(&htlc.FastExchange{
Recipient: network.Identity(recipient.Id()),
TMSID1: tmsID1,
Type1: typ1,
Expand All @@ -405,8 +406,14 @@ func fastExchange(network *integration.Infrastructure, id *token3.NodeReference,
ReclamationDeadline: deadline,
}))
Expect(err).NotTo(HaveOccurred())
txID := common.JSONUnmarshalString(res)
// give time to bob to commit the transaction
time.Sleep(10 * time.Second)
common2.CheckEndorserFinality(network, recipient, txID, &tmsID2, false)
_, err = network.Client(recipient.ReplicaName()).CallView("TxFinality", common.JSONMarshall(&views3.TxFinality{
TxID: txID,
TMSID: &tmsID2,
}))
Expect(err).NotTo(HaveOccurred())
}

func scan(network *integration.Infrastructure, id *token3.NodeReference, hash []byte, hashFunc crypto.Hash, startingTransactionID string, stopOnLastTx bool, opts ...token.ServiceOption) {
Expand Down
2 changes: 2 additions & 0 deletions integration/token/interop/tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ func TestFastExchange(network *integration.Infrastructure, sel *token2.ReplicaSe

fastExchange(network, alice, bob, alpha, "EUR", 10, beta, "USD", 10, 1*time.Hour)

time.Sleep(1 * time.Minute)

CheckBalance(network, sel.Get("alice"), "", "EUR", 20, token.WithTMSID(alpha))
Eventually(CheckBalanceReturnError).WithArguments(network, sel.Get("bob"), "", "EUR", uint64(10), token.WithTMSID(alpha)).WithTimeout(1 * time.Minute).WithPolling(15 * time.Second).Should(Succeed())

Expand Down
17 changes: 10 additions & 7 deletions integration/token/interop/topology.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc"
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/fsc/node"
"github.com/hyperledger-labs/fabric-smart-client/integration/nwo/orion"
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/services/endorser"
"github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token"
fabric2 "github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/fabric"
orion2 "github.com/hyperledger-labs/fabric-token-sdk/integration/nwo/token/orion"
Expand All @@ -31,7 +32,7 @@ func HTLCSingleFabricNetworkTopology(opts common.Opts) []api.Topology {

// FSC
fscTopology := fsc.NewTopology()
//fscTopology.SetLogging("token-sdk=debug:fabric-sdk=debug:info", "")
fscTopology.SetLogging(opts.FSCLogSpec, "")
fscTopology.P2PCommunicationType = opts.CommType

addIssuer(fscTopology).
Expand Down Expand Up @@ -68,7 +69,7 @@ func HTLCSingleOrionNetworkTopology(opts common.Opts) []api.Topology {

// FSC
fscTopology := fsc.NewTopology()
//fscTopology.SetLogging("debug", "")
fscTopology.SetLogging(opts.FSCLogSpec, "")
fscTopology.P2PCommunicationType = opts.CommType

addIssuer(fscTopology).
Expand Down Expand Up @@ -116,7 +117,7 @@ func HTLCTwoFabricNetworksTopology(opts common.Opts) []api.Topology {

// FSC
fscTopology := fsc.NewTopology()
//fscTopology.SetLogging("debug", "")
fscTopology.SetLogging(opts.FSCLogSpec, "")
fscTopology.P2PCommunicationType = opts.CommType

addIssuer(fscTopology).
Expand Down Expand Up @@ -178,7 +179,7 @@ func HTLCNoCrossClaimTopology(opts common.Opts) []api.Topology {

// FSC
fscTopology := fsc.NewTopology()
//fscTopology.SetLogging("db.driver.badger=info:debug", "")
fscTopology.SetLogging(opts.FSCLogSpec, "")
fscTopology.P2PCommunicationType = opts.CommType

addIssuer(fscTopology).
Expand Down Expand Up @@ -245,7 +246,7 @@ func HTLCNoCrossClaimWithOrionTopology(opts common.Opts) []api.Topology {

// FSC
fscTopology := fsc.NewTopology()
//fscTopology.SetLogging("db.driver.badger=info:debug", "")
fscTopology.SetLogging(opts.FSCLogSpec, "")
fscTopology.P2PCommunicationType = opts.CommType

addIssuer(fscTopology).
Expand Down Expand Up @@ -353,7 +354,8 @@ func addAlice(fscTopology *fsc.Topology) *node.Node {
RegisterViewFactory("htlc.lock", &htlc.LockViewFactory{}).
RegisterViewFactory("htlc.reclaimAll", &htlc.ReclaimAllViewFactory{}).
RegisterViewFactory("htlc.fastExchange", &htlc.FastExchangeInitiatorViewFactory{}).
RegisterViewFactory("TxFinality", &views3.TxFinalityViewFactory{})
RegisterViewFactory("TxFinality", &views3.TxFinalityViewFactory{}).
RegisterViewFactory("EndorserFinality", &endorser.FinalityViewFactory{})
}

func addBob(fscTopology *fsc.Topology) *node.Node {
Expand All @@ -372,7 +374,8 @@ func addBob(fscTopology *fsc.Topology) *node.Node {
RegisterResponder(&htlc.LockAcceptView{}, &htlc.LockView{}).
RegisterResponder(&htlc.FastExchangeResponderView{}, &htlc.FastExchangeInitiatorView{}).
RegisterViewFactory("htlc.claim", &htlc.ClaimViewFactory{}).
RegisterViewFactory("TxFinality", &views3.TxFinalityViewFactory{})
RegisterViewFactory("TxFinality", &views3.TxFinalityViewFactory{}).
RegisterViewFactory("EndorserFinality", &endorser.FinalityViewFactory{})
}

func addCustodian(fscTopology *fsc.Topology) *node.Node {
Expand Down
Loading
Loading