-
Notifications
You must be signed in to change notification settings - Fork 301
feat(contract_manager): impl contract manager for ton #2076
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
// Helper function to parse DataSource from a Cell | ||
export function parseDataSource(cell: Cell): DataSource { | ||
const slice = cell.beginParse(); | ||
const emitterChain = slice.loadUint(16); | ||
const emitterAddress = slice.loadUint(256).toString(16).padStart(64, "0"); | ||
return { emitterChain, emitterAddress }; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this to the sdk
export function parseGuardianSetKeys(cell: Cell): string[] { | ||
const keys: string[] = []; | ||
|
||
function parseCell(c: Cell) { | ||
let slice = c.beginParse(); | ||
while (slice.remainingRefs > 0 || slice.remainingBits >= 160) { | ||
if (slice.remainingBits >= 160) { | ||
const bitsToSkip = slice.remainingBits - 160; | ||
slice = slice.skip(bitsToSkip); | ||
const key = slice.loadBits(160); | ||
keys.push("0x" + key.toString()); | ||
} | ||
if (slice.remainingRefs > 0) { | ||
parseCell(slice.loadRef()); | ||
} | ||
} | ||
} | ||
|
||
parseCell(cell); | ||
return keys; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to the sdk
// Create a dictionary for data sources | ||
const dataSourcesDict = Dictionary.empty( | ||
Dictionary.Keys.Uint(32), | ||
Dictionary.Keys.Uint(8), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix previous bug
No description provided.