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

Random numbers for decentralized sequencer interactions #474

Open
wants to merge 3 commits into
base: szynek/sequencer-client
Choose a base branch
from

Conversation

szynwelski
Copy link
Contributor

No description provided.

@szynwelski szynwelski marked this pull request as ready for review November 3, 2023 11:51
}
const base64 = this._activeTx.random.replace(/-/g, '+').replace(/_/g, '/');
const array = Uint8Array.from(atob(base64), c => c.charCodeAt(0));
const bigInt = Buffer.from(array).readBigUInt64BE();
Copy link
Contributor

Choose a reason for hiding this comment

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

please add
import { Buffer } from 'warp-isomorphic';

Buffer is nodejs specific and the above code might not work in browser.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The import has been added.

@@ -260,6 +280,9 @@ export class SWVrf {

// returns a random value in a range from 1 to maxValue
randomInt(maxValue: number): number {
Copy link
Contributor

Choose a reason for hiding this comment

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

please mark as Deprecated and update the docs here https://docs.warp.cc/docs/sdk/advanced/vrf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added comments with @deprecated. I will update all documentation related to the new sequencer as part of the task at warp-contracts/sequencer#85.

@szynwelski szynwelski force-pushed the szynek/sequencer-client branch 4 times, most recently from 9acada5 to 3f81256 Compare November 21, 2023 12:14
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.

None yet

2 participants