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

Stricter rules for custom user agent #104

Closed
wants to merge 22 commits into from

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Oct 27, 2022

Closes #96

Blocked by #101 and #102 and #99 😬

--> ./hnsd -a bad/agent
chain (0): chain is fully synced
addrman: added addr: 127.0.0.1:46806
failed adding user agent
failed initializing daemon: EFAILURE

--> ./hnsd -a good_agent
...
[info] (net) Received version (127.0.0.1:60772): version=1 height=0 services=0 agent=/hnsd:1.0.0/good_agent/

@pinheadmz pinheadmz added this to the v2.0.0 milestone Oct 27, 2022
Copy link
Member

@rithvikvibhu rithvikvibhu left a comment

Choose a reason for hiding this comment

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

Agent commit looks good, tests run fine! Left some comments.

await util.close();
});

describe.only('--agent', function () {
Copy link
Member

Choose a reason for hiding this comment

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

.only to be removed? All tests pass without this.

Copy link
Member Author

Choose a reason for hiding this comment

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

yep thanks

await util.waitForSync();

const peer = util.node.pool.peers.head();
assert.strictEqual(peer.agent, '/hnsd:1.0.0/');
Copy link
Member

Choose a reason for hiding this comment

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

Does the test need to be updated with every version bump? Could pick from package.json (which I think was the idea for adding version there)

Edit: yeah just saw version used below

Copy link
Member Author

Choose a reason for hiding this comment

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

yep! fixing...

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.

Suffix user agent with slash
2 participants