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

fix: simulation fails for tx missing soroban auth entry #146

Merged
merged 48 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
b6ff821
chore: add jest setup to coverage all files (#101)
Brunonascdev Mar 26, 2024
e78148d
refactor: fix circular import
fazzatti Mar 26, 2024
e9497cb
test: contract engine initial structure
fazzatti Mar 26, 2024
1d20ca7
Merge pull request #102 from CheesecakeLabs/unit-test
Brunonascdev Mar 26, 2024
a4a6bde
Contract Engine unit tests (#103)
fazzatti Mar 28, 2024
f66a40c
refactor: contract engine errors (#104)
fazzatti Mar 28, 2024
47ccf16
Update docs and minor adjustments to jsdocs (#105)
fazzatti Mar 28, 2024
c30ab86
packaging: bump version to 0.7.0 (#108)
fazzatti Mar 28, 2024
81b25eb
test: add build transaction unit tests
Brunonascdev Apr 1, 2024
1a17047
Merge branch 'develop' of github.com:CheesecakeLabs/stellar-plus into…
Brunonascdev Apr 1, 2024
961ad28
chore: merge with develop
Brunonascdev Apr 1, 2024
7249e02
test: add build transaction failure tests
Brunonascdev Apr 1, 2024
44561cb
refactor: make networkConfig variable private
Brunonascdev Apr 1, 2024
ec59df0
Merge pull request #110 from CheesecakeLabs/test/build-transaction-un…
Brunonascdev Apr 1, 2024
d8924db
test: add unit test for fee bump pipeline (#113)
Brunonascdev Apr 1, 2024
88a8b0a
test: add unit tests for classic signature requirements pipeline (#115)
fazzatti Apr 1, 2024
619b65f
Add unit tests for simulate transaction pipeline (#117)
fazzatti Apr 2, 2024
9712847
Add unit tests for classic transaction pipeline (#118)
fazzatti Apr 2, 2024
e2d382a
test: add unit tests for soroban transaction pipeline (#119)
fazzatti Apr 2, 2024
0da0a45
test: add unit test for sign transaction pipeline
Brunonascdev Apr 2, 2024
85c2044
Merge branch 'develop' of github.com:CheesecakeLabs/stellar-plus into…
Brunonascdev Apr 2, 2024
13e354a
Merge pull request #120 from CheesecakeLabs/test/sign-transaction-pip…
Brunonascdev Apr 2, 2024
72d7b93
test: add unit test for submit transaction pipeline
Brunonascdev Apr 3, 2024
ef9c214
Merge pull request #122 from CheesecakeLabs/test/submit-transaction-p…
Brunonascdev Apr 3, 2024
0d57031
Add unit tests soroban auth (#123)
fazzatti Apr 3, 2024
882cd85
Complete unit test coverage for account handlers (#125)
fazzatti Apr 5, 2024
10ace5d
Create test-coverage.yml action (#126)
fazzatti Apr 5, 2024
89405b9
Add unit test for base account handler (#127)
fazzatti Apr 5, 2024
4ab013b
Add unit test for soroban get transaction pipeline (#124)
fazzatti Apr 5, 2024
228a50f
Add unit tests for the classic asset handler (#128)
fazzatti Apr 5, 2024
4823037
feat: remove issuer requirement for classic assets (#129)
fazzatti Apr 8, 2024
210cbd7
test: add unit test to soroban token handler (#131)
fazzatti Apr 24, 2024
cf4b2e9
feat: remove helper classes for account (#132)
fazzatti Apr 24, 2024
c008ca6
Standardize default network configs and custom (#133)
fazzatti Apr 25, 2024
20abb09
packaging: bump version to v0.8.0
fazzatti Apr 25, 2024
158165a
Merge branch 'main' into develop
fazzatti Apr 25, 2024
5bf176a
Fix merge issues (#137)
fazzatti Apr 25, 2024
9eff855
Update stellar sdk (#139)
fazzatti Apr 30, 2024
39af9af
packaging: bump version to 0.8.1
fazzatti Apr 30, 2024
2fb5cee
Merge branch 'main' into develop
fazzatti Apr 30, 2024
2f367fa
Minor fixes (#141)
fazzatti May 1, 2024
75d6f4b
Merge branch 'main' into develop
fazzatti May 1, 2024
364ca4b
Contract engine improvements (#144)
fazzatti May 7, 2024
25c35aa
chore: bump version to 0.8.3
fazzatti May 7, 2024
aecd297
Merge branch 'main' into develop
fazzatti May 7, 2024
b6b97bb
fix: soroban auth simulation fails if partial auth entries are present
fazzatti May 10, 2024
703c935
chore: bump version to 0.8.4
fazzatti May 10, 2024
6d5ed86
Merge branch 'main' into develop
fazzatti May 10, 2024
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stellar-plus",
"version": "0.8.3",
"version": "0.8.4",
"description": "beta version of stellar-plus, an all-in-one sdk for the Stellar blockchain",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
Expand Down
18 changes: 17 additions & 1 deletion src/stellar-plus/core/pipelines/soroban-auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,14 @@ export class SorobanAuthPipeline extends ConveyorBelt<

let updatedTransaction
try {
updatedTransaction = this.updateTransaction(transaction, authEntries, simulation.transactionData)
updatedTransaction = this.updateTransaction(
transaction,
[
...this.getSourceCredentialAuth(simulation.result?.auth), // Reinject unsigned source credentials. These are signed in the classic signing pipeline
...authEntries,
],
simulation.transactionData
)
} catch (error) {
throw PSAError.couldntUpdateTransaction(
error as Error,
Expand Down Expand Up @@ -182,4 +189,13 @@ export class SorobanAuthPipeline extends ConveyorBelt<
})
: []
}

protected getSourceCredentialAuth(authEntries?: xdr.SorobanAuthorizationEntry[]): xdr.SorobanAuthorizationEntry[] {
return authEntries
? authEntries.filter((entry) => {
const credentials = entry.credentials()
return credentials.switch() === xdr.SorobanCredentialsType.sorobanCredentialsSourceAccount()
})
: []
}
}
Loading