+
Skip to content
Merged
Show file tree
Hide file tree
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
40 changes: 32 additions & 8 deletions conduit/plugins/importers/algod/algod_importer.go
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,40 @@ func (algodImp *algodImporter) Init(ctx context.Context, initProvider data.InitP
return err
}

genesis := sdk.Genesis{}

// Don't fail on unknown properties here since the go-algorand and SDK genesis types differ slightly
err = json.LenientDecode([]byte(genesisResponse), &genesis)
if err != nil {
return err
}
if reflect.DeepEqual(genesis, sdk.Genesis{}) {
if reflect.DeepEqual(genesisResponse, models.Genesis{}) {
return fmt.Errorf("unable to fetch genesis file from API at %s", algodImp.cfg.NetAddr)
}

genesis := sdk.Genesis{
SchemaID: genesisResponse.Id,
Network: genesisResponse.Network,
Proto: genesisResponse.Proto,
Allocation: make([]sdk.GenesisAllocation, len(genesisResponse.Alloc)),
RewardsPool: genesisResponse.Rwd,
FeeSink: genesisResponse.Fees,
Timestamp: int64(genesisResponse.Timestamp),
Comment: genesisResponse.Comment,
DevMode: genesisResponse.Devmode,
}

// Convert allocations
for i, alloc := range genesisResponse.Alloc {
var state sdk.Account
stateBytes := json.Encode(alloc.State)
if stateBytes == nil {
return fmt.Errorf("error converting allocation state for address %s: %w", alloc.Addr, err)
}
err = json.LenientDecode(stateBytes, &state)
if err != nil {
return fmt.Errorf("error unmarshaling allocation state: %w", err)
}
genesis.Allocation[i] = sdk.GenesisAllocation{
Address: alloc.Addr,
Comment: alloc.Comment,
State: state,
}
}

algodImp.genesis = &genesis

return algodImp.catchupNode(genesis.Network, uint64(initProvider.NextDBRound()))
Expand Down
1 change: 1 addition & 0 deletions conduit/plugins/processors/filterprocessor/Filter_tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
|txn.apid|SignedTxn.Txn.ApplicationFields.ApplicationCallTxnFields.ApplicationID|
|txn.apls.nbs|SignedTxn.Txn.ApplicationFields.ApplicationCallTxnFields.LocalStateSchema.NumByteSlice|
|txn.apls.nui|SignedTxn.Txn.ApplicationFields.ApplicationCallTxnFields.LocalStateSchema.NumUint|
|txn.aprv|SignedTxn.Txn.ApplicationFields.ApplicationCallTxnFields.RejectVersion|
|txn.arcv|SignedTxn.Txn.AssetTransferTxnFields.AssetReceiver|
|txn.asnd|SignedTxn.Txn.AssetTransferTxnFields.AssetSender|
|txn.caid|SignedTxn.Txn.AssetConfigTxnFields.ConfigAsset|
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions conduit/plugins/processors/filterprocessor/filter_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 1, len(output.Payset))
assert.Equal(t, uint64(2), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(2), output.Payset[0].SignedTxnWithAD.ApplicationID)

Choose a reason for hiding this comment

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

This is fine, of course, but I sometimes use:
assert.EqualValues(t, 2, output.Payset[0].SignedTxnWithAD.ApplicationID) to avoid the casts.

},
},
{"alias 2", `---
Expand All @@ -267,8 +267,8 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 2, len(output.Payset))
assert.Equal(t, uint64(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, uint64(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
},
},

Expand All @@ -281,8 +281,8 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 2, len(output.Payset))
assert.Equal(t, uint64(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, uint64(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
},
},
{"alias 4", `---
Expand All @@ -294,7 +294,7 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 1, len(output.Payset))
assert.Equal(t, uint64(11), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(11), output.Payset[0].SignedTxnWithAD.ApplicationID)
},
},

Expand All @@ -307,8 +307,8 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 2, len(output.Payset))
assert.Equal(t, uint64(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, uint64(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(2), output.Payset[1].SignedTxnWithAD.ApplicationID)
},
},

Expand All @@ -321,7 +321,7 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 1, len(output.Payset))
assert.Equal(t, uint64(11), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(11), output.Payset[0].SignedTxnWithAD.ApplicationID)
},
},
{"alias 7", `---
Expand All @@ -333,8 +333,8 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 2, len(output.Payset))
assert.Equal(t, uint64(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, uint64(11), output.Payset[1].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(11), output.Payset[1].SignedTxnWithAD.ApplicationID)
},
},

Expand All @@ -347,8 +347,8 @@ filters:
`, func(t *testing.T, output *data.BlockData) {

assert.Equal(t, 2, len(output.Payset))
assert.Equal(t, uint64(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, uint64(11), output.Payset[1].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(4), output.Payset[0].SignedTxnWithAD.ApplicationID)
assert.Equal(t, sdk.AppIndex(11), output.Payset[1].SignedTxnWithAD.ApplicationID)
},
},
}
Expand Down
6 changes: 3 additions & 3 deletions e2e_tests/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ description = "End to end tests for Algorand Conduit"
version = "0.0.1"
requires-python = ">=3.8"
dependencies = [
"boto3==1.24.71",
"boto3==1.38.36",
"msgpack==1.0.4",
"psycopg2==2.9.6",
"psycopg2==2.9.10",
"py-algorand-sdk==1.17.0",
"pytest==6.2.5",
"PyYAML==6.0",
"PyYAML==6.0.1",
"setuptools ==65.3.0",
]

Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module github.com/algorand/conduit

go 1.23
go 1.23.0

toolchain go1.23.3

require (
github.com/algorand/go-algorand-sdk/v2 v2.7.0
github.com/algorand/go-algorand-sdk/v2 v2.9.2-0.20250611180312-61ad62f81280
github.com/algorand/go-codec/codec v1.1.10
github.com/algorand/indexer/v3 v3.7.1
github.com/algorand/indexer/v3 v3.7.3-0.20250612210424-b83805117377
github.com/google/uuid v1.6.0
github.com/jackc/pgx/v4 v4.18.2
github.com/opensearch-project/opensearch-go/v2 v2.3.0
Expand Down Expand Up @@ -85,10 +85,10 @@ require (
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/crypto v0.35.0 // indirect
golang.org/x/net v0.29.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
google.golang.org/protobuf v1.35.2 // indirect
)
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v
github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk=
github.com/algorand/avm-abi v0.2.0 h1:bkjsG+BOEcxUcnGSALLosmltE0JZdg+ZisXKx0UDX2k=
github.com/algorand/avm-abi v0.2.0/go.mod h1:+CgwM46dithy850bpTeHh9MC99zpn2Snirb3QTl2O/g=
github.com/algorand/go-algorand-sdk/v2 v2.7.0 h1:ntORjVgXnm+1jqpj55Fv2MbYitxwE9A+xNYopsN5uoA=
github.com/algorand/go-algorand-sdk/v2 v2.7.0/go.mod h1:BkHnK2PuCqzdGPNeWUo5yo6lRjyDZ9QoMN8GIjfijrA=
github.com/algorand/go-algorand-sdk/v2 v2.9.2-0.20250611180312-61ad62f81280 h1:DiYJJj+OLzvym4fI1+QSP3hrGp19mfp0aPCtS0hJQk0=
github.com/algorand/go-algorand-sdk/v2 v2.9.2-0.20250611180312-61ad62f81280/go.mod h1:D6iKT87/N6ajNpN7uMYPC9/RsOo2BbxnDfvh81E3hOM=
github.com/algorand/go-codec/codec v1.1.10 h1:zmWYU1cp64jQVTOG8Tw8wa+k0VfwgXIPbnDfiVa+5QA=
github.com/algorand/go-codec/codec v1.1.10/go.mod h1:YkEx5nmr/zuCeaDYOIhlDg92Lxju8tj2d2NrYqP7g7k=
github.com/algorand/indexer/v3 v3.7.1 h1:YQXzwLA5DJ1vq5Z82/6IbSmHUyQb5bnFhGJkhh5Ocow=
github.com/algorand/indexer/v3 v3.7.1/go.mod h1:L08o2o+4YdWBUnNjXUaOpGQlhb32PtXXoM37GZWHuEE=
github.com/algorand/indexer/v3 v3.7.3-0.20250612210424-b83805117377 h1:eE62xSW43xMqEJMgBOsCnO9kL3pSjqiiF6BeTdu6JdU=
github.com/algorand/indexer/v3 v3.7.3-0.20250612210424-b83805117377/go.mod h1:2Ct7uqkVvm7QyPGHmopkjMyMeedkLpHm+3TqXeuln/8=
github.com/algorand/oapi-codegen v1.12.0-algorand.0 h1:W9PvED+wAJc+9EeXPONnA+0zE9UhynEqoDs4OgAxKhk=
github.com/algorand/oapi-codegen v1.12.0-algorand.0/go.mod h1:tIWJ9K/qrLDVDt5A1p82UmxZIEGxv2X+uoujdhEAL48=
github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ=
Expand Down Expand Up @@ -315,8 +315,8 @@ golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
Expand All @@ -342,8 +342,8 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=
golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -367,8 +367,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand All @@ -382,8 +382,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载