ethers.js/packages/abi/lib.esm/coders/null.js

21 lines
520 B
JavaScript
Raw Permalink Normal View History

"use strict";
import { Coder } from "./abstract-coder";
export class NullCoder extends Coder {
constructor(localName) {
super("null", "", localName, false);
}
2020-11-23 03:43:28 -05:00
defaultValue() {
return null;
}
encode(writer, value) {
if (value != null) {
this._throwError("not null", value);
}
return writer.writeBytes([]);
}
decode(reader) {
reader.readBytes(0);
return reader.coerce(this.name, null);
}
}
2020-07-13 08:03:56 -04:00
//# sourceMappingURL=null.js.map