-
Notifications
You must be signed in to change notification settings - Fork 0
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
Switch to Horizon v2.27.0 update version of the stellar/go repository #6
Conversation
interfaces, event handling channel/env: Add StellarClient to connect to the Stellar blockchain and Soroban. client: Implement payment channel workflow by adding PaymentChannel and PaymentClient services/horizon/docker, testdata: Add docker files and Stellar client binaries to ensure Soroban functionality, as imeplemented in Protocol 20 in the stellar/go SDK.
channel: Finalize Funder workflow, simplify Stellar transactions channel/env: Change StellarClient interaction util: Remove global contract path constant
channel: small formatting changes .assets: Add Perun image for README
Adjudicator.Withdraw.
channel: Remove comments
channel: Increase DefaultSubscriptionPollingInterval, DefaultPollingInterval constants to allow slow query responses during listening of adjudicator events. Remove comments and Println statements. testdata: Include perun_soroban_token.wasm, implementing generic Stellar asset tokens
channel: Adapt channel to Token Asset contract. Include transactions that realize the asset token contract functions. wire: Include string encoding for ScVal
channel: Include contract function calls and arguments to invoke stellar asset token functions. Also, extend IntegrationTestEnv functionality. util: Modify Deploy function to output contract id hash
env: Keep simulateTransaction function from integration test environment
…de Payments between clients channel: Increase buffer size to arbitrarily high value, include "transfer" event hotfix. env: Add BuildGetTokenBalanceArgs function. util: Add wrapping functions to generate accounts and to make it easier to create a payment demo.
channel: Remove xdr.SorobanAuthorizationEntry since the authorization is completed by stellar/go since the recent versions. Also remove makePreImgAuth, which was used to calculate the Signature field in the SorobanAuthorizationEntry. This is now obsolete. channel/env: Remove the TestInteractContract function, which was used to invoke the testinteract function of the payment channel contract. This was used for testing purposes only and is now obsolete. Include a global shared mutex, sharedMtx, to prevent both users invoking the same contract function at the same time. util: Remove CreateFundNewRandomStellarKP, which is now substituted by CreateFundStellarAccounts. Remove SorobanAuthorizationEntry and the i128Param function because it is unused. testdata: perun_soroban_contract and perun_soroban_token are updated to represent the most recent versions of the contracts.
… for testing and debugging purposes only and is now obsolete.
…stellar/go library.
util: Change GetTokenBalance to output token balance of user main: Adapt to new GetTokenBalance output
channel: Remove Println statements channel/env: Remove Println statements
…string, not the public key
… channels has been moved to the perun-stellar-demo repository.
… perun-stellar-demo
…itialization is performed at other places already
…s only used for testing
…ions to perform tests
…djudicator struct. * test(channel): Add adjudicator_test.go, containing a Happy channel test. It describes a standard channel lifetime process
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good Work, some changes necessary I think
@@ -0,0 +1,102 @@ | |||
// Copyright 2023 PolyCrypt GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this already exists in go-perun with a bit cleaner implementation that doesn't need polling. So this can probably be removed.
see go-perun/channel/adjudicator.go TimeTimeout
return ddn | ||
|
||
case *CloseEvent: | ||
|
||
log.Println("CloseEvent received") | ||
conclEvent := pchannel.AdjudicatorEventBase{ | ||
VersionV: e.Version(), | ||
IDV: e.ID(), | ||
TimeoutV: MakeTimeout(timestamp), | ||
} | ||
ccn := &pchannel.ConcludedEvent{AdjudicatorEventBase: conclEvent} | ||
s.closer.Close() | ||
return ccn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why why do we close the subscription here?
return nil | ||
} | ||
|
||
func (f *Funder) GetChannelState(ctx context.Context, params *pchannel.Params, state *pchannel.State) (wire.Channel, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is again duplicate with the adjudicators and adjudicator-subs GetChannelState
. It should also be part of the client
package I was talking about. Same goes for OpenChannel
and FundChannel
.
…et/test to avoid code duplication or double initialization
…ion tests, allowing to choose to run unit tests only. Update README accordingly.
… Stellar binaries docker image. Update README to document docker usage.
* chorse(channel/env): Return errors instead of panic where possible
…thod and add conditions to close AdjEventSub subscription
…dPartyA and fundPartyB. Include safety check to assert that PartyA and PartyB have funded before Fund returns successfully.
…dentical to StellarClient
…ceKey() methods, as they were identical to GetHorizonClient() and GetKeyPair()
…ypair exposure in Funder, Adjudicator and the associated methods. Keypair is now used in channel/env by Stellarclient.keyHolder to sign transactions.
This PR finalizes the channel package, using the most recent versions of the stellar/go components.