Skip to content

Commit

Permalink
chore: Update go-perun dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Sophia Koehler <[email protected]>
  • Loading branch information
sophia1ch committed Jan 28, 2025
1 parent d0bd87c commit 80faf4a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions channel/asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ func MakeChainID(id *big.Int) ChainID {
return ChainID{id}
}

// MakeAssetID makes a AssetID for the given id.
func MakeAssetID(id *big.Int) multi.AssetID {
// MakeLedgerBackendID makes a AssetID for the given id.
func MakeLedgerBackendID(id *big.Int) multi.LedgerBackendID {
if id.Sign() < 0 {
panic("must not be smaller than zero")
}
Expand All @@ -66,7 +66,7 @@ func (id *ChainID) UnmarshalBinary(data []byte) error {
// MarshalBinary marshals the chainID into its binary representation.
func (id ChainID) MarshalBinary() (data []byte, err error) {
if id.Sign() == -1 {
return nil, errors.New("cannot marshal negative AssetID")
return nil, errors.New("cannot marshal negative LedgerBackendID")
}
return id.Bytes(), nil
}
Expand Down Expand Up @@ -108,8 +108,8 @@ func (id AssetID) LedgerID() multi.LedgerID {
return &id.ledgerID
}

// AssetID returns the asset ID of the asset.
func (a Asset) AssetID() multi.AssetID {
// LedgerBackendID returns the asset ID of the asset.
func (a Asset) LedgerBackendID() multi.LedgerBackendID {
return a.assetID
}

Expand Down Expand Up @@ -141,12 +141,12 @@ func (a *Asset) UnmarshalBinary(data []byte) error {

// LedgerID returns the ledger ID the asset lives on.
func (a Asset) LedgerID() multi.LedgerID {
return a.AssetID().LedgerID()
return a.LedgerBackendID().LedgerID()
}

// NewAsset creates a new asset from an chainID and the AssetHolder address.
func NewAsset(chainID *big.Int, assetHolder common.Address) *Asset {
id := MakeAssetID(chainID).(AssetID) //nolint: forcetypeassert // AssetID implements multi.AssetID
id := MakeLedgerBackendID(chainID).(AssetID) //nolint: forcetypeassert // LedgerBackendID implements multi.LedgerBackendID
return &Asset{assetID: id, AssetHolder: *wallet.AsWalletAddr(assetHolder)}
}

Expand Down
4 changes: 2 additions & 2 deletions channel/test/randomizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func NewRandomAsset(rng *rand.Rand) *ethchannel.Asset {
return ethchannel.NewAsset(chainID.ChainID(), common.Address(asset))
}

// NewRandomChainID returns a new random AssetID.
// NewRandomChainID returns a new random LedgerBackendID.
func NewRandomChainID(rng *rand.Rand) ethchannel.AssetID {
r := rng.Uint64()
id := new(big.Int).SetUint64(r)
return ethchannel.MakeAssetID(id).(ethchannel.AssetID)
return ethchannel.MakeLedgerBackendID(id).(ethchannel.AssetID)
}
4 changes: 2 additions & 2 deletions client/test/multiledger.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ type testLedger struct {
}

// AssetID returns the asset ID of the ledger.
func (l testLedger) AssetID() multi.AssetID {
return ethchannel.MakeAssetID(ethchannel.MakeChainID(l.simSetup.SimBackend.ChainID()).Int)
func (l testLedger) AssetID() multi.LedgerBackendID {
return ethchannel.MakeLedgerBackendID(ethchannel.MakeChainID(l.simSetup.SimBackend.ChainID()).Int)
}

func setupLedger(ctx context.Context, t *testing.T, rng *rand.Rand, chainID *big.Int) testLedger {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
perun.network/go-perun v0.12.1-0.20250114072911-f46b0c55fe65
perun.network/go-perun v0.12.1-0.20250128081648-21d0af4e234b
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las=
perun.network/go-perun v0.12.1-0.20250114072911-f46b0c55fe65 h1:kJ3AS374fe23a/9puoaOwCr9Bx2L/WJ5p2npDql3m4A=
perun.network/go-perun v0.12.1-0.20250114072911-f46b0c55fe65/go.mod h1:uH8iwi75alXDizxxDzH0A+6uqXPbagCpKfl8ECMv/cA=
perun.network/go-perun v0.12.1-0.20250128081648-21d0af4e234b h1:6FeodthJZB10aWGk/DgtV2VicacyUnLaUoT8OUcwSms=
perun.network/go-perun v0.12.1-0.20250128081648-21d0af4e234b/go.mod h1:uH8iwi75alXDizxxDzH0A+6uqXPbagCpKfl8ECMv/cA=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37 h1:iA5GzEa/hHfVlQpimEjPV09NATwHXxSjWNB0VVodtew=
polycry.pt/poly-go v0.0.0-20220301085937-fb9d71b45a37/go.mod h1:XUBrNtqgEhN3EEOP/5gh7IBd3xVHKidCjXDZfl9+kMU=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down

0 comments on commit 80faf4a

Please sign in to comment.