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

More Configurability and Working Signatures For Required Routes #29

Merged
merged 15 commits into from
Sep 27, 2024

Conversation

otobongfp
Copy link
Contributor

@otobongfp otobongfp commented Sep 6, 2024

  1. Added the delete feature to the inbox - controller & service.
  2. Added Network ID to the config so that a user can set it, but by default the ID is set mainnet - "L".
  3. Fixed how the http-signatures lib gets the actual url signed by the client..

Copy link
Contributor

@CryptoTabaluga CryptoTabaluga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Contributor

@CryptoTabaluga CryptoTabaluga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test

src/app.module.ts Outdated Show resolved Hide resolved
src/common/config/config.service.ts Outdated Show resolved Hide resolved
src/common/http-signature/verify-signature.middleware.ts Outdated Show resolved Hide resolved
src/config/schema.ts Outdated Show resolved Hide resolved
src/common/http-signature/verify-signature.middleware.ts Outdated Show resolved Hide resolved
import { verify } from '@ltonetwork/http-message-signatures';

export const lto = new LTO();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't create a global LTO object. You don't know the network.

Comment on lines 9 to 13
private lto: LTO;

constructor() {
this.lto = new LTO();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the lto property

const network = getNetwork(walletAddress);

//switch to testnet if address is testnet
if (network == 'T') this.lto = new LTO(network);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This never switches back to mainnet. No need to switch though. Just create a new LTO object for each request.

const lto = new LTO(network)

@otobongfp otobongfp merged commit c75b6e9 into ltonetwork:master Sep 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants