Skip to content

Commit

Permalink
♻️ (context-module): Use signature mode depending on config
Browse files Browse the repository at this point in the history
  • Loading branch information
aussedatlo committed Oct 7, 2024
1 parent fd1d341 commit 14068b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ describe("HttpTypedDataDataSource", () => {
const config = {
cal: {
url: "https://crypto-assets-service.api.ledger.com/v1",
mode: "prod",
},
} as ContextModuleConfig;
datasource = new HttpTypedDataDataSource(config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,29 +87,29 @@ export class HttpTypedDataDataSource implements TypedDataDataSource {
if (this.isFieldFilterWithContractInfo(field)) {
messageInfo = {
displayName: field.display_name,
signature: field.signatures.prod,
signature: field.signatures[this.config.cal.mode],
filtersCount: field.field_mappers_count,
};
} else if (version === "v1" && this.isFieldFilterV1(field)) {
filters.push({
type: "raw",
displayName: field.display_name,
path: field.field_path,
signature: field.signatures.prod,
signature: field.signatures[this.config.cal.mode],
});
} else if (this.isFieldFilterV2(field)) {
filters.push({
type: field.format,
displayName: field.display_name,
path: field.field_path,
signature: field.signatures.prod,
signature: field.signatures[this.config.cal.mode],
});
} else if (this.isFieldFilterV2WithCoinRef(field)) {
filters.push({
type: field.format,
displayName: field.display_name,
path: field.field_path,
signature: field.signatures.prod,
signature: field.signatures[this.config.cal.mode],
tokenIndex: field.coin_ref,
});
} else {
Expand Down

0 comments on commit 14068b6

Please sign in to comment.