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

chore: Fix client output map #3517

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -47,13 +47,13 @@ jobs:
go-version: "1.23.2"

- name: install rust-toolchain
uses: actions-rs/toolchain@v1.0.7
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: 1.80.0
toolchain: nightly-2023-12-18

- name: install wasm-pack
run: |
curl https://raw.githubusercontent.com/rustwasm/wasm-pack/refs/heads/master/docs/_installer/init.sh -sSf | env VERSION=v0.13.0 sh
curl https://raw.githubusercontent.com/rustwasm/wasm-pack/refs/heads/master/docs/_installer/init.sh -sSf | env VERSION=v0.12.1 sh

- name: install schema
run: |
4 changes: 2 additions & 2 deletions contracts/wasm/testcore/rs/testcoreimpl/src/funcs.rs
Original file line number Diff line number Diff line change
@@ -232,11 +232,11 @@ pub fn func_test_event_log_deploy(ctx: &ScFuncContext, _f: &TestEventLogDeployCo
ctx.deploy_contract(&program_hash, CONTRACT_NAME_DEPLOYED, None);
}

pub fn func_test_event_log_event_data(ctx: &ScFuncContext, f: &TestEventLogEventDataContext) {
pub fn func_test_event_log_event_data(_ctx: &ScFuncContext, f: &TestEventLogEventDataContext) {
f.events.test();
}

pub fn func_test_event_log_generic_data(ctx: &ScFuncContext, f: &TestEventLogGenericDataContext) {
pub fn func_test_event_log_generic_data(_ctx: &ScFuncContext, f: &TestEventLogGenericDataContext) {
f.events.counter(f.params.counter().value());
}

4 changes: 2 additions & 2 deletions contracts/wasm/testwasmlib/rs/testwasmlibimpl/src/funcs.rs
Original file line number Diff line number Diff line change
@@ -1381,10 +1381,10 @@ pub fn func_activate(ctx: &ScFuncContext, f: &ActivateContext) {
testwasmlib::ScFuncs::deactivate(ctx).func.delay(delay).post();
}

pub fn func_deactivate(ctx: &ScFuncContext, f: &DeactivateContext) {
pub fn func_deactivate(_ctx: &ScFuncContext, f: &DeactivateContext) {
f.state.active().set_value(false);
}

pub fn view_get_active(ctx: &ScViewContext, f: &GetActiveContext) {
pub fn view_get_active(_ctx: &ScViewContext, f: &GetActiveContext) {
f.results.active().set_value(f.state.active().value());
}
24 changes: 23 additions & 1 deletion packages/l1connection/l1connection.go
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import (
iotago "github.com/iotaledger/iota.go/v3"
"github.com/iotaledger/iota.go/v3/builder"
"github.com/iotaledger/iota.go/v3/nodeclient"

"github.com/iotaledger/wasp/packages/cryptolib"
"github.com/iotaledger/wasp/packages/isc"
"github.com/iotaledger/wasp/packages/parameters"
@@ -92,8 +93,29 @@ func (c *l1client) OutputMap(myAddress iotago.Address, timeout ...time.Duration)
defer cancelContext()

bech32Addr := myAddress.Bech32(parameters.L1().Protocol.Bech32HRP)
falseParam := false
trueParam := true

queries := []nodeclient.IndexerQuery{
&nodeclient.BasicOutputsQuery{AddressBech32: bech32Addr},
&nodeclient.BasicOutputsQuery{
AddressBech32: bech32Addr,
IndexerTimelockParas: nodeclient.IndexerTimelockParas{
Copy link
Member

Choose a reason for hiding this comment

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

you need to actually do 2 queries, because this would only give you ones with a timelock that passed, not ones without a timelock

Copy link
Member

Choose a reason for hiding this comment

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

So you need to add a second one where HasTimelock: &falseParam

HasTimelock: &trueParam,
TimelockedBefore: uint32(time.Now().Unix()),
},
IndexerNativeTokenParas: nodeclient.IndexerNativeTokenParas{
HasNativeTokens: &falseParam,
},
},
&nodeclient.BasicOutputsQuery{
AddressBech32: bech32Addr,
IndexerTimelockParas: nodeclient.IndexerTimelockParas{
HasTimelock: &falseParam,
},
IndexerNativeTokenParas: nodeclient.IndexerNativeTokenParas{
HasNativeTokens: &falseParam,
},
},
&nodeclient.FoundriesQuery{AliasAddressBech32: bech32Addr},
&nodeclient.NFTsQuery{AddressBech32: bech32Addr},
&nodeclient.AliasesQuery{GovernorBech32: bech32Addr},