Files
Dmitry Bespalov e113092d59 refs/heads/create-safe-prototype Added Eth package - a new version of the Ethereum RPC Api that would reduce program complexity.
- New way to use rpc methods for easier batching and completion blocks
- Using classes instead of structs in places where reuse of member variables is needed
- New API would work with the domain types and not with JSON types, thus making program complexity lower.
2022-02-06 18:45:50 +01:00

18 lines
442 B
Swift

//
// Created by Dmitry Bespalov on 06.02.22.
//
import Foundation
import Solidity
extension Sol.Address: NodeDataCodable {
public init(decoding data: Data) throws {
try self.init(data: data)
}
public func encodeNodeData() throws -> Data {
// we need to return 20-byte value. Address is ABI-encoded as UInt160, so we need to get the suffix.
let result = encode().suffix(20)
return result
}
}