Closed gabkov closed 2 months ago
I think returning WrappedBackend
there makes sense? cc @matevz
Unless perhaps you'd prefer recommending usage of NewWrappedBackend
instead if users want that functionality.
Generally you shouldn't need WrappedBackend
for handling the smart contract (e.g. abigen-generated .go files use bind.ContractBackend
in their constructor). If you really need sapphire-specific Transactor, you can simply cast it, for example:
backend, err = sapphire.WrapClient(client, func(digest [32]byte) ([]byte, error) {
return crypto.Sign(digest[:], myKey)
})
sapphireBackend, ok := backend.(*sapphire.WrappedBackend)
txOpts = sapphireBackend.Transactor(c.fromAddress)
fmt.Println(txOpts.GasPrice.String())
https://github.com/oasisprotocol/sapphire-paratime/blob/398f116299fb3bdab421ee81b1e7f0c3aa73136b/clients/go/compat.go#L157