Skip to content

Commit

Permalink
fix: 🐛 Use getLegsFromChain for getting legs after creation
Browse files Browse the repository at this point in the history
  • Loading branch information
prashantasdeveloper committed Nov 27, 2024
1 parent eb1ea7a commit b0d380c
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
Empty file removed AccountsService
Empty file.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@polymeshassociation/fireblocks-signing-manager": "^2.5.0",
"@polymeshassociation/hashicorp-vault-signing-manager": "^3.4.0",
"@polymeshassociation/local-signing-manager": "^3.3.0",
"@polymeshassociation/polymesh-sdk": "27.0.0-alpha.4",
"@polymeshassociation/polymesh-sdk": "^27.0.0-alpha.5",
"@polymeshassociation/signing-manager-types": "^3.2.0",
"class-transformer": "0.5.1",
"class-validator": "^0.14.0",
Expand Down
2 changes: 1 addition & 1 deletion src/settlements/settlements.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ describe('SettlementsController', () => {
it('should create an instruction and return the data returned by the service', async () => {
const mockInstruction = new MockInstruction();

when(mockInstruction.getLegs).calledWith().mockResolvedValue({ data: [] });
when(mockInstruction.getLegsFromChain).calledWith().mockResolvedValue({ data: [] });

const mockData = {
...txResult,
Expand Down
2 changes: 1 addition & 1 deletion src/settlements/settlements.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ export class SettlementsController {
transactions,
details,
}) => {
const { data: legs } = await instruction.getLegs();
const { data: legs } = await instruction.getLegsFromChain();

return new CreatedInstructionModel({
instruction,
Expand Down
2 changes: 1 addition & 1 deletion src/settlements/venues.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('VenuesController', () => {
it('should create an instruction and return the data returned by the service', async () => {
const mockInstruction = new MockInstruction();

when(mockInstruction.getLegs).calledWith().mockResolvedValue({ data: [] });
when(mockInstruction.getLegsFromChain).calledWith().mockResolvedValue({ data: [] });

const mockData = {
...txResult,
Expand Down
2 changes: 1 addition & 1 deletion src/settlements/venues.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class VenuesController {
transactions,
details,
}) => {
const { data: legs } = await instruction.getLegs();
const { data: legs } = await instruction.getLegsFromChain();

return new CreatedInstructionModel({
instruction,
Expand Down
1 change: 1 addition & 0 deletions src/test-utils/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ export class MockInstruction {
public reject = jest.fn();
public details = jest.fn();
public getLegs = jest.fn();
public getLegsFromChain = jest.fn();
public getAffirmations = jest.fn();
public getOffChainAffirmations = jest.fn();
public getOffChainAffirmationForLeg = jest.fn();
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1954,10 +1954,10 @@
dependencies:
"@polymeshassociation/signing-manager-types" "^3.3.0"

"@polymeshassociation/[email protected].4":
version "27.0.0-alpha.4"
resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-27.0.0-alpha.4.tgz#999da175d0fed8e075a34fe58fc3b5dd108cdd0b"
integrity sha512-i/FT36KsdeKntKpVD6V+H+MszTog0yC6JDM/tbRtZls71wmZClfMz1jC4ihdnfF02+DVlKvKWH1oEIv1AImJgg==
"@polymeshassociation/polymesh-sdk@^27.0.0-alpha.5":
version "27.0.0-alpha.5"
resolved "https://registry.yarnpkg.com/@polymeshassociation/polymesh-sdk/-/polymesh-sdk-27.0.0-alpha.5.tgz#0e8c1318d0632c535ffa5e89808dcfdb03440578"
integrity sha512-Dgb9vz9c7O+gzuZX+TSx62N/UPeO3TyqkdJ2lF+S6xxDpswBPhWvBtpxwFTyHYnOrBFlXG4APLy5C2T+1526bw==
dependencies:
"@apollo/client" "^3.8.1"
"@polkadot/api" "11.2.1"
Expand Down

0 comments on commit b0d380c

Please sign in to comment.