Skip to content

Commit 42f884c

Browse files
authored
Fix incorrect address encoding with leading zeroes (#28), add ThorNode::eth_call (#30)
* Fix incorrect address encoding when leading zeroes are present (fixes #28) * Add `ThorNode::eth_call` and `ThorNode::eth_call_advanced`, add a contract interaction example * Bump version
1 parent 87a7240 commit 42f884c

File tree

11 files changed

+584
-36
lines changed

11 files changed

+584
-36
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ jobs:
7070
- name: Run tests with coverage
7171
run: RUST_BACKTRACE=1 cargo tarpaulin --out Xml --all-features
7272

73-
- name: Submit a transaction to chain
74-
run: RUST_BACKTRACE=1 cargo run --example transaction_broadcast --all-features
73+
- name: Submit several transactions to chain
74+
run: |
75+
RUST_BACKTRACE=1 cargo run --example transaction_broadcast --all-features
76+
RUST_BACKTRACE=1 cargo run --example contract_interaction --all-features
7577
env:
7678
TEST_TO_ADDRESS: ${{ secrets.TO_ADDRESS }}
7779
TEST_MNEMONIC: ${{ secrets.MNEMONIC }}

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,16 @@ Possible header types:
99
- `Bug Fixes` for any bug fixes.
1010
- `Breaking Changes` for any backwards-incompatible changes.
1111

12-
## v0.1.0-beta.3 (pending)
12+
## v0.1.0-beta.5 (pending)
13+
Nothing yet:(
14+
15+
## v0.1.0-beta.4
16+
- Fixed incorrect address encoding in presence of leading zeroes (#28).
17+
- Added `ThorNode::eth_call` and `ThorNode::eth_call_advanced` for `view` and `pure` functions calling.
18+
- Added a contract interaction example.
19+
20+
## v0.1.0-beta.3
21+
- Increased MSRV to 1.69.0 due to incompatible upstream dependency.
1322

1423
### Features
1524
- Added `TransactionBuilder` to simplify transaction preparation.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "thor-devkit"
3-
version = "0.1.0-beta.3"
3+
version = "0.1.0-beta.4"
44
authors = ["Stanislav Terliakov <terlya.stas@gmail.com>"]
55
description = "Rust library to aid coding with VeChain: wallets, transactions signing, encoding and verification, smart contract ABI interfacing, etc."
66
documentation = "https://docs.rs/thor-devkit"

data/energy.abi

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
[
2+
{
3+
"constant": true,
4+
"inputs": [],
5+
"name": "name",
6+
"outputs": [
7+
{
8+
"name": "",
9+
"type": "string"
10+
}
11+
],
12+
"payable": false,
13+
"stateMutability": "pure",
14+
"type": "function"
15+
},
16+
{
17+
"constant": false,
18+
"inputs": [
19+
{
20+
"name": "_spender",
21+
"type": "address"
22+
},
23+
{
24+
"name": "_value",
25+
"type": "uint256"
26+
}
27+
],
28+
"name": "approve",
29+
"outputs": [
30+
{
31+
"name": "success",
32+
"type": "bool"
33+
}
34+
],
35+
"payable": false,
36+
"stateMutability": "nonpayable",
37+
"type": "function"
38+
},
39+
{
40+
"constant": true,
41+
"inputs": [],
42+
"name": "totalSupply",
43+
"outputs": [
44+
{
45+
"name": "",
46+
"type": "uint256"
47+
}
48+
],
49+
"payable": false,
50+
"stateMutability": "view",
51+
"type": "function"
52+
},
53+
{
54+
"constant": false,
55+
"inputs": [
56+
{
57+
"name": "_from",
58+
"type": "address"
59+
},
60+
{
61+
"name": "_to",
62+
"type": "address"
63+
},
64+
{
65+
"name": "_amount",
66+
"type": "uint256"
67+
}
68+
],
69+
"name": "transferFrom",
70+
"outputs": [
71+
{
72+
"name": "success",
73+
"type": "bool"
74+
}
75+
],
76+
"payable": false,
77+
"stateMutability": "nonpayable",
78+
"type": "function"
79+
},
80+
{
81+
"constant": true,
82+
"inputs": [],
83+
"name": "decimals",
84+
"outputs": [
85+
{
86+
"name": "",
87+
"type": "uint8"
88+
}
89+
],
90+
"payable": false,
91+
"stateMutability": "pure",
92+
"type": "function"
93+
},
94+
{
95+
"constant": true,
96+
"inputs": [
97+
{
98+
"name": "_owner",
99+
"type": "address"
100+
}
101+
],
102+
"name": "balanceOf",
103+
"outputs": [
104+
{
105+
"name": "balance",
106+
"type": "uint256"
107+
}
108+
],
109+
"payable": false,
110+
"stateMutability": "view",
111+
"type": "function"
112+
},
113+
{
114+
"constant": true,
115+
"inputs": [],
116+
"name": "symbol",
117+
"outputs": [
118+
{
119+
"name": "",
120+
"type": "string"
121+
}
122+
],
123+
"payable": false,
124+
"stateMutability": "pure",
125+
"type": "function"
126+
},
127+
{
128+
"constant": false,
129+
"inputs": [
130+
{
131+
"name": "_to",
132+
"type": "address"
133+
},
134+
{
135+
"name": "_amount",
136+
"type": "uint256"
137+
}
138+
],
139+
"name": "transfer",
140+
"outputs": [
141+
{
142+
"name": "success",
143+
"type": "bool"
144+
}
145+
],
146+
"payable": false,
147+
"stateMutability": "nonpayable",
148+
"type": "function"
149+
},
150+
{
151+
"constant": false,
152+
"inputs": [
153+
{
154+
"name": "_from",
155+
"type": "address"
156+
},
157+
{
158+
"name": "_to",
159+
"type": "address"
160+
},
161+
{
162+
"name": "_amount",
163+
"type": "uint256"
164+
}
165+
],
166+
"name": "move",
167+
"outputs": [
168+
{
169+
"name": "success",
170+
"type": "bool"
171+
}
172+
],
173+
"payable": false,
174+
"stateMutability": "nonpayable",
175+
"type": "function"
176+
},
177+
{
178+
"constant": true,
179+
"inputs": [],
180+
"name": "totalBurned",
181+
"outputs": [
182+
{
183+
"name": "",
184+
"type": "uint256"
185+
}
186+
],
187+
"payable": false,
188+
"stateMutability": "view",
189+
"type": "function"
190+
},
191+
{
192+
"constant": true,
193+
"inputs": [
194+
{
195+
"name": "_owner",
196+
"type": "address"
197+
},
198+
{
199+
"name": "_spender",
200+
"type": "address"
201+
}
202+
],
203+
"name": "allowance",
204+
"outputs": [
205+
{
206+
"name": "remaining",
207+
"type": "uint256"
208+
}
209+
],
210+
"payable": false,
211+
"stateMutability": "view",
212+
"type": "function"
213+
},
214+
{
215+
"anonymous": false,
216+
"inputs": [
217+
{
218+
"indexed": true,
219+
"name": "_from",
220+
"type": "address"
221+
},
222+
{
223+
"indexed": true,
224+
"name": "_to",
225+
"type": "address"
226+
},
227+
{
228+
"indexed": false,
229+
"name": "_value",
230+
"type": "uint256"
231+
}
232+
],
233+
"name": "Transfer",
234+
"type": "event"
235+
},
236+
{
237+
"anonymous": false,
238+
"inputs": [
239+
{
240+
"indexed": true,
241+
"name": "_owner",
242+
"type": "address"
243+
},
244+
{
245+
"indexed": true,
246+
"name": "_spender",
247+
"type": "address"
248+
},
249+
{
250+
"indexed": false,
251+
"name": "_value",
252+
"type": "uint256"
253+
}
254+
],
255+
"name": "Approval",
256+
"type": "event"
257+
}
258+
]

0 commit comments

Comments
 (0)