Skip to content

the fabric platform was using an orion interface. #596

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

Merged
merged 1 commit into from
Jun 17, 2024
Merged
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
9 changes: 6 additions & 3 deletions platform/fabric/driver/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ SPDX-License-Identifier: Apache-2.0
package driver

import (
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
"github.com/hyperledger-labs/fabric-smart-client/platform/common/driver"
)

type TxValidationStatus = driver2.TxValidationStatus[ValidationCode]
type (
TxValidationStatus = driver.TxValidationStatus[ValidationCode]
QueryExecutor = driver.QueryExecutor
)

type Vault interface {
driver2.Vault[ValidationCode]
driver.Vault[ValidationCode]

// GetEphemeralRWSet returns an ephemeral RWSet for this ledger whose content is unmarshalled
// from the passed bytes.
Expand Down
29 changes: 14 additions & 15 deletions platform/fabric/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import (
"strings"

"github.com/hyperledger-labs/fabric-smart-client/platform/common/core/generic/vault"
fdriver "github.com/hyperledger-labs/fabric-smart-client/platform/fabric/driver"
driver2 "github.com/hyperledger-labs/fabric-smart-client/platform/orion/driver"
"github.com/hyperledger-labs/fabric-smart-client/platform/fabric/driver"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -60,10 +59,10 @@ func (m TransientMap) GetState(key string, state interface{}) error {
}

type RWSet struct {
fdriver.RWSet
driver.RWSet
}

func NewRWSet(rws fdriver.RWSet) *RWSet {
func NewRWSet(rws driver.RWSet) *RWSet {
return &RWSet{RWSet: rws}
}

Expand Down Expand Up @@ -92,22 +91,22 @@ func (r *RWSet) Equals(rws interface{}, nss ...string) error {
type (
Read = vault.VersionedRead
ResultsIterator = vault.VersionedResultsIterator
ValidationCode = fdriver.ValidationCode
ValidationCode = driver.ValidationCode
TxIDEntry = vault.ByNum[ValidationCode]
TxIDIterator = fdriver.TxIDIterator
TxIDIterator = driver.TxIDIterator
)

// Vault models a key-value store that can be updated by committing rwsets
type Vault struct {
vault fdriver.Vault
txIDStore fdriver.TXIDStore
committer fdriver.Committer
transactionService fdriver.EndorserTransactionService
envelopeService fdriver.EnvelopeService
metadataService fdriver.MetadataService
vault driver.Vault
txIDStore driver.TXIDStore
committer driver.Committer
transactionService driver.EndorserTransactionService
envelopeService driver.EnvelopeService
metadataService driver.MetadataService
}

func newVault(ch fdriver.Channel) *Vault {
func newVault(ch driver.Channel) *Vault {
return &Vault{
vault: ch.Vault(),
txIDStore: ch.TXIDStore(),
Expand All @@ -118,7 +117,7 @@ func newVault(ch fdriver.Channel) *Vault {
}
}

func (c *Vault) NewQueryExecutor() (driver2.QueryExecutor, error) {
func (c *Vault) NewQueryExecutor() (driver.QueryExecutor, error) {
return c.vault.NewQueryExecutor()
}

Expand Down Expand Up @@ -173,7 +172,7 @@ func (c *Vault) StoreTransaction(id string, raw []byte) error {
}

func (c *Vault) StoreTransient(id string, tm TransientMap) error {
return c.metadataService.StoreTransient(id, fdriver.TransientMap(tm))
return c.metadataService.StoreTransient(id, driver.TransientMap(tm))
}

// DiscardTx discards the transaction with the given transaction id.
Expand Down
Loading