diff --git a/Cargo.lock b/Cargo.lock index c0af9ab..55e1899 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -584,7 +584,7 @@ dependencies = [ [[package]] name = "substreams-antelope-tokens" -version = "1.0.0" +version = "1.0.1" dependencies = [ "antelope", "prost", diff --git a/Cargo.toml b/Cargo.toml index 7e92dfa..b6f68c2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "substreams-antelope-tokens" -version = "1.0.0" +version = "1.0.1" authors = [ "Denis ", "Yaro ", diff --git a/Makefile b/Makefile index d659ca7..a691817 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,11 @@ gui: .PHONY: parquet parquet: - substreams-sink-files run eos.substreams.pinax.network:443 substreams.yaml map_events s3://pinax/eos/48034848cd64dcd70f95e06de9ed5d1478d0133e?region=us-east-1 2: --encoder parquet + substreams-sink-files run eos.substreams.pinax.network:443 substreams.yaml map_events './out' 400000000: --encoder parquet + +.PHONY: s3 +s3: + substreams-sink-files run eos.substreams.pinax.network:443 substreams.yaml map_events 's3://pinax/eos/48034848cd64dcd70f95e06de9ed5d1478d0133e?region=us-east-1' 2: --encoder parquet .PHONY: schema schema: diff --git a/proto/v1/eosio.token.proto b/proto/v1/eosio.token.proto index c2fefbf..8e881a4 100644 --- a/proto/v1/eosio.token.proto +++ b/proto/v1/eosio.token.proto @@ -24,7 +24,7 @@ message Transfer { string trx_id = 5; uint32 index = 6; // Action execution_index uint32 action_ordinal = 7; - repeated string authorization = 8; // Vec (ex: ["account@active"]) + string authorization = 8; // Vec (ex: ["account@active"]) // contract & scope string contract = 10; // Name (ex: "eosio.token") @@ -54,7 +54,7 @@ message Issue { string trx_id = 5; uint32 index = 6; // Action execution_index uint32 action_ordinal = 7; - repeated string authorization = 8; // Vec (ex: ["account@active"]) + string authorization = 8; // Vec (ex: ["account@active"]) // contract & scope string contract = 10; // Name (ex: "eosio.token") @@ -83,7 +83,7 @@ message Retire { string trx_id = 5; uint32 index = 6; // Action execution_index uint32 action_ordinal = 7; - repeated string authorization = 8; // Vec (ex: ["account@active"]) + string authorization = 8; // Vec (ex: ["account@active"]) // contract & scope string contract = 10; // Name (ex: "eosio.token") @@ -111,7 +111,7 @@ message Create { string trx_id = 5; uint32 index = 6; // Action execution_index uint32 action_ordinal = 7; - repeated string authorization = 8; // Vec (ex: ["account@active"]) + string authorization = 8; // Vec (ex: ["account@active"]) // contract & scope string contract = 10; // Name (ex: "eosio.token") diff --git a/src/pb/antelope.eosio.token.v1.rs b/src/pb/antelope.eosio.token.v1.rs index dfc78f8..ffa3f0b 100644 --- a/src/pb/antelope.eosio.token.v1.rs +++ b/src/pb/antelope.eosio.token.v1.rs @@ -37,8 +37,8 @@ pub struct Transfer { #[prost(uint32, tag="7")] pub action_ordinal: u32, /// Vec (ex: \["account@active"\]) - #[prost(string, repeated, tag="8")] - pub authorization: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="8")] + pub authorization: ::prost::alloc::string::String, /// contract & scope /// /// Name (ex: "eosio.token") @@ -88,8 +88,8 @@ pub struct Issue { #[prost(uint32, tag="7")] pub action_ordinal: u32, /// Vec (ex: \["account@active"\]) - #[prost(string, repeated, tag="8")] - pub authorization: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="8")] + pub authorization: ::prost::alloc::string::String, /// contract & scope /// /// Name (ex: "eosio.token") @@ -137,8 +137,8 @@ pub struct Retire { #[prost(uint32, tag="7")] pub action_ordinal: u32, /// Vec (ex: \["account@active"\]) - #[prost(string, repeated, tag="8")] - pub authorization: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="8")] + pub authorization: ::prost::alloc::string::String, /// contract & scope /// /// Name (ex: "eosio.token") @@ -184,8 +184,8 @@ pub struct Create { #[prost(uint32, tag="7")] pub action_ordinal: u32, /// Vec (ex: \["account@active"\]) - #[prost(string, repeated, tag="8")] - pub authorization: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag="8")] + pub authorization: ::prost::alloc::string::String, /// contract & scope /// /// Name (ex: "eosio.token") diff --git a/src/utils.rs b/src/utils.rs index b9eb3ee..885e505 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,4 +1,5 @@ use antelope::{Asset, Name}; +use std::iter::Iterator; use substreams::pb::substreams::Clock; use substreams_antelope::pb::PermissionLevel; @@ -23,11 +24,12 @@ pub fn to_date(clock: &Clock) -> String { .to_string() } -pub fn authorization_to_string(authorization: &Vec) -> Vec { +pub fn authorization_to_string(authorization: &Vec) -> String { authorization .iter() .map(|a| format!("{}@{}", a.actor, a.permission)) - .collect() + .collect::>() + .join(",") } pub fn parse_json_asset(data_json: &str, key: &str) -> Option { diff --git a/substreams.yaml b/substreams.yaml index b211b6d..9dea090 100644 --- a/substreams.yaml +++ b/substreams.yaml @@ -1,7 +1,7 @@ specVersion: v0.1.0 package: name: antelope_tokens - version: v1.0.0 + version: v1.0.1 url: https://github.com/pinax-network/substreams-antelope-tokens imports: