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

Support New Ledger Interface #936

Closed
winder opened this issue Mar 16, 2022 · 0 comments
Closed

Support New Ledger Interface #936

winder opened this issue Mar 16, 2022 · 0 comments
Labels
new-feature-request Feature request that needs triage Team Carbon-11

Comments

@winder
Copy link
Contributor

winder commented Mar 16, 2022

Problem

A small change in the ledger interface was introduced after adding the initial support for the new ledger. This is now preventing us from updating the submodule.

Solution

Implement new interface.

// LookupApplication loads an application resource that matches the request parameters from the ledger.
func (l *Ledger) LookupApplication(rnd basics.Round, addr basics.Address, aidx basics.AppIndex) (ledgercore.AppResource, error) {
	r, err := l.lookupResource(rnd, addr, basics.CreatableIndex(aidx), basics.AppCreatable)
	return ledgercore.AppResource{AppParams: r.AppParams, AppLocalState: r.AppLocalState}, err
}

// LookupAsset loads an asset resource that matches the request parameters from the ledger.
func (l *Ledger) LookupAsset(rnd basics.Round, addr basics.Address, aidx basics.AssetIndex) (ledgercore.AssetResource, error) {
	r, err := l.lookupResource(rnd, addr, basics.CreatableIndex(aidx), basics.AssetCreatable)
	return ledgercore.AssetResource{AssetParams: r.AssetParams, AssetHolding: r.AssetHolding}, err
}

Urgency

This will block a future release unless addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage Team Carbon-11
Projects
None yet
Development

No branches or pull requests

1 participant